Commit ddece413 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Convert xvarID struct member to array component.

parent 7c9e1bb0
......@@ -589,7 +589,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
}
else if ( gridtype == GRID_LONLAT && xid == CDI_UNDEFID && yid == CDI_UNDEFID && gridsize == 1 )
{
int ncxvarID = streamptr->ncgrid[gridindex].xvarID;
int ncxvarID = streamptr->ncgrid[gridindex].ncIDs[CDF_VARID_X];
int ncyvarID = streamptr->ncgrid[gridindex].yvarID;
if ( ncyvarID != CDI_UNDEFID )
{
......@@ -607,7 +607,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
else if ( gridtype == GRID_UNSTRUCTURED || gridtype == GRID_CURVILINEAR )
{
char cellarea[CDI_MAX_NAME] = "area: ";
int ncxvarID = streamptr->ncgrid[gridindex].xvarID;
int ncxvarID = streamptr->ncgrid[gridindex].ncIDs[CDF_VARID_X];
int ncyvarID = streamptr->ncgrid[gridindex].yvarID;
int ncavarID = streamptr->ncgrid[gridindex].avarID;
if ( ncyvarID != CDI_UNDEFID )
......
......@@ -220,12 +220,12 @@ VCT;
enum {
CDF_DIMID_X,
CDF_DIMID_Y,
CDF_VARID_X,
CDF_SIZE_ncIDs,
};
typedef struct {
int gridID;
int ncIDs[CDF_SIZE_ncIDs];
int xvarID;
int yvarID;
int avarID;
}
......
......@@ -894,7 +894,6 @@ void streamDefaultValue ( stream_t * streamptr )
streamptr->ncgrid[i].gridID = CDI_UNDEFID;
for (size_t j = 0; j < CDF_SIZE_ncIDs; ++j)
streamptr->ncgrid[i].ncIDs[j] = CDI_UNDEFID;
streamptr->ncgrid[i].xvarID = CDI_UNDEFID;
streamptr->ncgrid[i].yvarID = CDI_UNDEFID;
streamptr->ncgrid[i].avarID = CDI_UNDEFID;
}
......
......@@ -771,7 +771,7 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridindex, int ndims,
if ( ndims == 0 )
{
if ( dimKey == CDI_KEY_XDIMNAME )
ncgrid[gridindex].xvarID = ncvarid;
ncgrid[gridindex].ncIDs[CDF_VARID_X] = ncvarid;
else
ncgrid[gridindex].yvarID = ncvarid;
}
......@@ -854,7 +854,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex)
{
xdimID = ncgrid[index].ncIDs[CDF_DIMID_X];
ydimID = ncgrid[index].ncIDs[CDF_DIMID_Y];
ncxvarid = ncgrid[index].xvarID;
ncxvarid = ncgrid[index].ncIDs[CDF_VARID_X];
ncyvarid = ncgrid[index].yvarID;
break;
}
......@@ -978,7 +978,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex)
ncgrid[gridindex].gridID = gridID;
ncgrid[gridindex].ncIDs[CDF_DIMID_X] = xdimID;
ncgrid[gridindex].ncIDs[CDF_DIMID_Y] = ydimID;
ncgrid[gridindex].xvarID = ncxvarid;
ncgrid[gridindex].ncIDs[CDF_VARID_X] = ncxvarid;
ncgrid[gridindex].yvarID = ncyvarid;
ncgrid[gridindex].avarID = ncavarid;
}
......@@ -1192,7 +1192,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex)
IS_EQUAL(gridInqYval(gridID0, (int)dimlen-1), gridInqYval(gridID, (int)dimlen-1)) )
{
dimID = ncgrid[index].ncIDs[CDF_DIMID_X];
ncxvarid = ncgrid[index].xvarID;
ncxvarid = ncgrid[index].ncIDs[CDF_VARID_X];
ncyvarid = ncgrid[index].yvarID;
ncavarid = ncgrid[index].avarID;
break;
......@@ -1307,7 +1307,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex)
ncgrid[gridindex].gridID = gridID;
ncgrid[gridindex].ncIDs[CDF_DIMID_X] = dimID;
ncgrid[gridindex].xvarID = ncxvarid;
ncgrid[gridindex].ncIDs[CDF_VARID_X] = ncxvarid;
ncgrid[gridindex].yvarID = ncyvarid;
ncgrid[gridindex].avarID = ncavarid;
}
......@@ -2073,7 +2073,6 @@ void cdfDefVars(stream_t *streamptr)
streamptr->ncgrid[index].gridID = CDI_UNDEFID;
for (size_t i = 0; i < CDF_SIZE_ncIDs; ++i)
streamptr->ncgrid[index].ncIDs[i] = CDI_UNDEFID;
streamptr->ncgrid[index].xvarID = CDI_UNDEFID;
streamptr->ncgrid[index].yvarID = CDI_UNDEFID;
streamptr->ncgrid[index].avarID = 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