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,12 +188,27 @@ 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 )
{
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);
}
}
}
for ( int varID = 0; varID < nvars; varID++ )
......@@ -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();
......
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