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

Replace cdiGridInqKeyStr() by cdiInqKeyString() for CDI_KEY_VDIMNAME.

parent e33c2907
......@@ -838,7 +838,7 @@ int cdiCopyKeys(int cdiID1, int varID1, int cdiID2, int varID2);
#define CDI_KEY_YDIMNAME 912 // Y-axis dimension name
#define CDI_KEY_YLONGNAME 913 // Y-axis longname
#define CDI_KEY_YUNITS 914 // Y-axis units
#define CDI_KEY_VDIMNAME 920 // Vertex dimension name
#define CDI_KEY_VDIMNAME 920 // Vertex dimension name
#define CDI_KEY_GRIDMAP_VARTYPE 921 // Grid mapping var datatype
#define CDI_KEY_GRIDMAP_VARNAME 922 // Grid mapping var name
#define CDI_KEY_GRIDMAP_NAME 923 // Grid mapping name
......
......@@ -168,7 +168,6 @@ void grid_init(grid_t *gridptr)
gridptr->lcomplex = false;
gridptr->hasdims = true;
gridptr->vdimname[0] = 0;
memset(gridptr->uuid, 0, CDI_UUID_SIZE);
gridptr->name = NULL;
gridptr->vtable = &cdiGridVtable;
......@@ -631,7 +630,6 @@ void *grid_key_to_ptr(grid_t *gridptr, int key)
case CDI_KEY_YUNITS: keyptr = (void*)gridptr->y.units; break;
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;
}
return keyptr;
......@@ -2782,7 +2780,7 @@ void gridComplete(grid_t *grid)
}
#define GRID_STR_SERIALIZE(gridP) { gridP->x.dimname, gridP->y.dimname, \
gridP->vdimname, gridP->x.name, gridP->y.name, \
gridP->x.name, gridP->y.name, \
gridP->x.longname, gridP->y.longname, \
gridP->x.units, gridP->y.units }
......@@ -3473,11 +3471,6 @@ void gridPrintKernel(int gridID, int opt, FILE *fp)
if ( attstr[0] ) fprintf(fp, "yunits = %s\n", attstr);
}
if ( type == GRID_UNSTRUCTURED || type == GRID_CURVILINEAR )
{
attstr[0] = 0; cdiGridInqKeyStr(gridID, CDI_KEY_VDIMNAME, CDI_MAX_NAME, attstr);
if ( attstr[0] ) fprintf(fp, "vdimname = %s\n", attstr);
}
if ( type == GRID_UNSTRUCTURED && nvertex > 0 ) fprintf(fp, "nvertex = %d\n", nvertex);
}
......
......@@ -85,7 +85,6 @@ struct grid_gme_t {
};
struct grid_t {
char vdimname[CDI_MAX_NAME];
char *name;
int self;
size_t size;
......
......@@ -2797,7 +2797,7 @@ int cdf_define_all_grids(ncgrid_t *ncgrid, int vlistID, ncdim_t *ncdims, int nva
if ( xdimid != CDI_UNDEFID ) cdiGridDefKeyStr(gridID, CDI_KEY_XDIMNAME, (int)(strlen(ncdims[xdimid].name)+1), ncdims[xdimid].name);
if ( ydimid != CDI_UNDEFID ) cdiGridDefKeyStr(gridID, CDI_KEY_YDIMNAME, (int)(strlen(ncdims[ydimid].name)+1), ncdims[ydimid].name);
if ( vdimid != CDI_UNDEFID ) cdiGridDefKeyStr(gridID, CDI_KEY_VDIMNAME, (int)(strlen(ncdims[vdimid].name)+1), ncdims[vdimid].name);
if ( vdimid != CDI_UNDEFID ) cdiDefKeyString(gridID, CDI_GLOBAL, CDI_KEY_VDIMNAME, ncdims[vdimid].name);
if ( CDI_Debug ) Message("gridID %d %d %s", gridID, ncvarid, ncvar->name);
......@@ -2998,10 +2998,7 @@ int cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
if ( zdimid != CDI_UNDEFID )
cdiZaxisDefKeyStr(zaxisID, CDI_KEY_DIMNAME, (int)(strlen(ncdims[zdimid].name)+1), ncdims[zdimid].name);
/*
if ( vdimid != -1 )
cdiZaxisDefKeyStr(zaxisID, CDI_KEY_VDIMNAME, strlen(ncdims[vdimid].name)+1, ncdims[vdimid].name);
*/
if ( zvar ) Free(zvar);
if ( zcvals )
{
......
......@@ -672,8 +672,9 @@ cdfDefIrregularGridCommon(stream_t *streamptr, int gridID,
dimIDs[ndims-1] = CDI_UNDEFID;
if ( setVdimname )
{
char vdimname[CDI_MAX_NAME+3]; vdimname[0] = 0;
cdiGridInqKeyStr(gridID, CDI_KEY_VDIMNAME, CDI_MAX_NAME, vdimname);
char vdimname[CDI_MAX_NAME+3];
int length = CDI_MAX_NAME;
cdiInqKeyString(gridID, CDI_GLOBAL, CDI_KEY_VDIMNAME, vdimname, &length);
if ( vdimname[0] == 0 ) strcpy(vdimname, vdimname_default);
nvdimID = dimIDs[ndims-1] = checkDimName(fileID, nvertex, vdimname);
if ( nvdimID == CDI_UNDEFID )
......
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