Commit 6d09cefd authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Convert ncgrid avarID struct member to array component.

parent 18044b9a
......@@ -609,7 +609,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
char cellarea[CDI_MAX_NAME] = "area: ";
int ncxvarID = streamptr->ncgrid[gridindex].ncIDs[CDF_VARID_X];
int ncyvarID = streamptr->ncgrid[gridindex].ncIDs[CDF_VARID_Y];
int ncavarID = streamptr->ncgrid[gridindex].avarID;
int ncavarID = streamptr->ncgrid[gridindex].ncIDs[CDF_VARID_A];
if ( ncyvarID != CDI_UNDEFID )
{
size_t len = strlen(coordinates);
......
......@@ -222,12 +222,12 @@ enum {
CDF_DIMID_Y,
CDF_VARID_X,
CDF_VARID_Y,
CDF_VARID_A,
CDF_SIZE_ncIDs,
};
typedef struct {
int gridID;
int ncIDs[CDF_SIZE_ncIDs];
int avarID;
}
ncgrid_t;
#endif
......
......@@ -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].avarID = CDI_UNDEFID;
}
streamptr->vct.ilev = 0;
......
......@@ -976,7 +976,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex)
ncgrid[gridindex].ncIDs[CDF_DIMID_Y] = ydimID;
ncgrid[gridindex].ncIDs[CDF_VARID_X] = ncxvarid;
ncgrid[gridindex].ncIDs[CDF_VARID_Y] = ncyvarid;
ncgrid[gridindex].avarID = ncavarid;
ncgrid[gridindex].ncIDs[CDF_VARID_A] = ncavarid;
}
static
......@@ -1190,7 +1190,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex)
dimID = ncgrid[index].ncIDs[CDF_DIMID_X];
ncxvarid = ncgrid[index].ncIDs[CDF_VARID_X];
ncyvarid = ncgrid[index].ncIDs[CDF_VARID_Y];
ncavarid = ncgrid[index].avarID;
ncavarid = ncgrid[index].ncIDs[CDF_VARID_A];
break;
}
}
......@@ -1305,7 +1305,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex)
ncgrid[gridindex].ncIDs[CDF_DIMID_X] = dimID;
ncgrid[gridindex].ncIDs[CDF_VARID_X] = ncxvarid;
ncgrid[gridindex].ncIDs[CDF_VARID_Y] = ncyvarid;
ncgrid[gridindex].avarID = ncavarid;
ncgrid[gridindex].ncIDs[CDF_VARID_A] = ncavarid;
}
struct attTxtTab2
......@@ -2069,7 +2069,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].avarID = CDI_UNDEFID;
}
for ( int index = 0; index < ngrids; ++index )
......
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