Commit 71f3d70a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added CDI_KEY_MAPNAME.

parent f894b685
......@@ -769,7 +769,8 @@ int gridInqYvals(int gridID, double yvals[]);
#define CDI_KEY_YLONGNAME 907 // Y-axis longname
#define CDI_KEY_XUNITS 908 // X-axis units
#define CDI_KEY_YUNITS 909 // Y-axis units
#define CDI_KEY_MAPPING 920 // Grid mapping name
#define CDI_KEY_MAPNAME 920 // Grid mapping var name
#define CDI_KEY_MAPPING 921 // Grid mapping name
// cdiGridDefKeyStr: Define a CDI grid string value from a key
int cdiGridDefKeyStr(int gridID, int key, int size, const char *mesg);
......
......@@ -158,7 +158,6 @@ void grid_init(grid_t *gridptr)
gridptr->hasdims = true;
gridptr->x.dimname[0] = 0;
gridptr->y.dimname[0] = 0;
gridptr->vdimname[0] = 0;
gridptr->x.name[0] = 0;
gridptr->y.name[0] = 0;
gridptr->x.longname[0] = 0;
......@@ -167,6 +166,9 @@ void grid_init(grid_t *gridptr)
gridptr->y.units[0] = 0;
gridptr->x.stdname = NULL;
gridptr->y.stdname = NULL;
gridptr->vdimname[0] = 0;
gridptr->mapname[0] = 0;
gridptr->mapping[0] = 0;
memset(gridptr->uuid, 0, CDI_UUID_SIZE);
gridptr->name = NULL;
gridptr->vtable = &cdiGridVtable;
......@@ -623,6 +625,7 @@ void *grid_key_to_ptr(grid_t *gridptr, int key)
case CDI_KEY_XDIMNAME: keyptr = (void*)gridptr->x.dimname; break;
case CDI_KEY_YDIMNAME: keyptr = (void*)gridptr->y.dimname; break;
case CDI_KEY_VDIMNAME: keyptr = (void*)gridptr->vdimname; break;
case CDI_KEY_MAPNAME: keyptr = (void*)gridptr->mapname; break;
case CDI_KEY_MAPPING: keyptr = (void*)gridptr->mapping; break;
}
......
......@@ -125,6 +125,7 @@ struct grid_t {
bool lcomplex;
bool hasdims;
char vdimname[CDI_MAX_NAME];
char mapname[CDI_MAX_NAME];
char mapping[CDI_MAX_NAME];
char *name;
struct gridaxis_t x;
......
......@@ -2710,6 +2710,7 @@ void cdf_define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
int projID = lgrid ? grid->proj : gridID;
int ncid = ncvars[gmapvarid].ncid;
cdf_read_mapping_atts(ncid, gmapvarid, projID, ncvars[gmapvarid].name);
cdiGridDefKeyStr(projID, CDI_KEY_MAPNAME, (int)(strlen(ncvars[gmapvarid].name)+1), ncvars[gmapvarid].name);
}
if ( grid->type == GRID_UNSTRUCTURED && gridfile[0] != 0 )
......
Markdown is supported
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