Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
8e262215
Commit
8e262215
authored
Mar 08, 2016
by
Mathis Rosenhauer
Browse files
cmor: Only query history if global attrs exist
parent
eee26034
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/CMOR.c
View file @
8e262215
...
...
@@ -188,11 +188,16 @@ static void dump_global_attributes(struct kv **ht, int streamID)
static
void
dump_special_attributes
(
struct
kv
**
ht
,
int
streamID
)
{
int
vlistID
=
streamInqVlist
(
streamID
);
/* Any new history will be appended to the existing history. */
int
fileID
=
pstreamFileID
(
streamID
);
size_t
old_historysize
=
(
size_t
)
streamInqHistorySize
(
fileID
)
;
size_t
old_historysize
;
char
*
new_history
=
get_val
(
ht
,
"history"
,
""
);
size_t
historysize
;
int
natts
;
vlistInqNatts
(
vlistID
,
CDI_GLOBAL
,
&
natts
);
if
(
natts
>
0
)
old_historysize
=
(
size_t
)
streamInqHistorySize
(
fileID
);
else
old_historysize
=
0
;
if
(
old_historysize
)
{
...
...
@@ -228,7 +233,6 @@ static void dump_special_attributes(struct kv **ht, int streamID)
const
char
*
value
=
institutInqLongnamePtr
(
vlistInqVarInstitut
(
vlistID
,
0
));
if
(
value
)
hinsert
(
ht
,
"institution"
,
value
);
value
=
modelInqNamePtr
(
vlistInqVarModel
(
vlistID
,
0
));
if
(
value
)
hinsert
(
ht
,
"source"
,
value
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment