Commit e09bd3be authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added support for some global attributes from the Header section.

parent 4671ea47
...@@ -188,11 +188,26 @@ void apply_cmor_table(const char *filename, int nvars, int vlistID2, var_t *vars ...@@ -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); list_t *kvl = pml_get_kvl_ventry(pml, nhentry, hentry);
if ( kvl ) if ( kvl )
{ {
keyValues_t *kv = kvlist_search(kvl, "missing_value"); for ( listNode_t *kvnode = kvl->head; kvnode; kvnode = kvnode->next )
if ( kv && kv->nvalues > 0 )
{ {
lmissval = true; keyValues_t *kv = *(keyValues_t **)kvnode->data;
missval = parameter2double(kv->values[0]); 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) ...@@ -314,6 +329,8 @@ void *CMOR_lite(void *argument)
cdoInitialize(argument); cdoInitialize(argument);
CDO_CMOR_Mode = 1;
cdoOperatorAdd("cmorlite", 0, 0, "parameter table name"); cdoOperatorAdd("cmorlite", 0, 0, "parameter table name");
int operatorID = cdoOperatorID(); int operatorID = cdoOperatorID();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment