Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
e09bd3be
Commit
e09bd3be
authored
Nov 01, 2016
by
Uwe Schulzweida
Browse files
Added support for some global attributes from the Header section.
parent
4671ea47
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/CMOR_lite.c
View file @
e09bd3be
...
...
@@ -188,11 +188,26 @@ void apply_cmor_table(const char *filename, int nvars, int vlistID2, var_t *vars
list_t
*
kvl
=
pml_get_kvl_ventry
(
pml
,
nhentry
,
hentry
);
if
(
kvl
)
{
keyValues_t
*
kv
=
kvlist_search
(
kvl
,
"missing_value"
);
if
(
kv
&&
kv
->
nvalues
>
0
)
for
(
listNode_t
*
kvnode
=
kvl
->
head
;
kvnode
;
kvnode
=
kvnode
->
next
)
{
lmissval
=
true
;
missval
=
parameter2double
(
kv
->
values
[
0
]);
keyValues_t
*
kv
=
*
(
keyValues_t
**
)
kvnode
->
data
;
const
char
*
key
=
kv
->
key
;
const
char
*
value
=
(
kv
->
nvalues
==
1
)
?
kv
->
values
[
0
]
:
NULL
;
if
(
!
value
)
continue
;
if
(
STR_IS_EQ
(
key
,
"missing_value"
)
)
{
lmissval
=
true
;
missval
=
parameter2double
(
kv
->
values
[
0
]);
}
else
if
(
STR_IS_EQ
(
key
,
"table_id"
)
||
STR_IS_EQ
(
key
,
"modeling_realm"
)
||
STR_IS_EQ
(
key
,
"realm"
)
||
STR_IS_EQ
(
key
,
"project_id"
)
||
STR_IS_EQ
(
key
,
"frequency"
)
)
{
cdiDefAttTxt
(
vlistID2
,
CDI_GLOBAL
,
key
,
(
int
)
strlen
(
value
),
value
);
}
}
}
...
...
@@ -314,6 +329,8 @@ void *CMOR_lite(void *argument)
cdoInitialize
(
argument
);
CDO_CMOR_Mode
=
1
;
cdoOperatorAdd
(
"cmorlite"
,
0
,
0
,
"parameter table name"
);
int
operatorID
=
cdoOperatorID
();
...
...
Write
Preview
Supports
Markdown
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