Commit 5535db49 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed TAXIS_CONSTANT to TIME_CONSTANT.

parent 2c832404
......@@ -3,6 +3,10 @@
* using CGRIBEX library version 1.9.0
* Version 1.9.1 released
2017-09-28 Uwe Schulzweida
* Renamed TAXIS_CONSTANT to TIME_CONSTANT
2017-09-20 Uwe Schulzweida
* vlistCopyFlag: copy datatype (bug fix)
......
......@@ -377,8 +377,7 @@ void printShortinfo(int streamID, int vlistID, int vardis)
/* tsteptype */
int tsteptype = vlistInqVarTsteptype(vlistID, varID);
if ( tsteptype == TSTEP_CONSTANT ) fprintf(stdout, "%-8s ", "constant");
else if ( tsteptype == TSTEP_INSTANT ) fprintf(stdout, "%-8s ", "instant");
if ( tsteptype == TSTEP_INSTANT ) fprintf(stdout, "%-8s ", "instant");
else if ( tsteptype == TSTEP_INSTANT2 ) fprintf(stdout, "%-8s ", "instant");
else if ( tsteptype == TSTEP_INSTANT3 ) fprintf(stdout, "%-8s ", "instant");
else if ( tsteptype == TSTEP_MIN ) fprintf(stdout, "%-8s ", "min");
......@@ -978,7 +977,7 @@ int main(int argc, char *argv[])
{
for ( varID = 0; varID < nvars; varID++ )
{
if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT && tsID > 0 ) continue;
if ( vlistInqVarTimetype(vlistID1, varID) == TIME_CONSTANT && tsID > 0 ) continue;
number = vlistInqVarNumber(vlistID1, varID);
gridID = vlistInqVarGrid(vlistID1, varID);
......
......@@ -35,8 +35,8 @@ int main(void)
vlistID = vlistCreate();
// Define the variables
varID1 = vlistDefVar(vlistID, gridID, zaxisID1, TSTEP_CONSTANT);
varID2 = vlistDefVar(vlistID, gridID, zaxisID2, TSTEP_CONSTANT);
varID1 = vlistDefVar(vlistID, gridID, zaxisID1, TIME_CONSTANT);
varID2 = vlistDefVar(vlistID, gridID, zaxisID2, TIME_CONSTANT);
// Define the variable names
vlistDefVarName(vlistID, varID1, "varname1");
......
......@@ -43,9 +43,9 @@ void cdfGetSlapDescription(stream_t *streamptr, int varID, size_t (*start)[4], s
{
int vlistID = streamptr->vlistID;
int tsID = streamptr->curTsID;
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int tsteptype = vlistInqVarTsteptype(vlistID, varID);
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int timetype = vlistInqVarTimetype(vlistID, varID);
int gridindex = vlistGridIndex(vlistID, gridID);
if ( CDI_Debug ) Message("tsID = %d", tsID);
......@@ -70,7 +70,7 @@ void cdfGetSlapDescription(stream_t *streamptr, int varID, size_t (*start)[4], s
(*count)[ndims] = length; \
ndims++; \
} while(0)
if ( tsteptype != TSTEP_CONSTANT ) addDimension((size_t)tsID, 1);
if ( timetype != TIME_CONSTANT ) addDimension((size_t)tsID, 1);
if ( zid != CDI_UNDEFID ) addDimension(0, (size_t)zaxisInqSize(zaxisID));
if ( yid != CDI_UNDEFID ) addDimension(0, (size_t)gridInqYsize(gridID));
if ( xid != CDI_UNDEFID ) addDimension(0, (size_t)gridInqXsize(gridID));
......@@ -420,7 +420,7 @@ void cdfGetSliceSlapDescription(stream_t *streamptr, int varId, int levelId, boo
int ncvarid = streamptr->vars[varId].ncvarid;
int gridId = vlistInqVarGrid(vlistId, varId);
int tsteptype = vlistInqVarTsteptype(vlistId, varId);
int timetype = vlistInqVarTimeptype(vlistId, varId);
int gridsize = gridInqSize(gridId);
streamptr->numvals += gridsize;
......@@ -443,7 +443,7 @@ void cdfGetSliceSlapDescription(stream_t *streamptr, int varId, int levelId, boo
ndims++; \
} while(0)
if ( tsteptype != TSTEP_CONSTANT ) addDimension((size_t)tsID, 1);
if ( timetype != TIME_CONSTANT ) addDimension((size_t)tsID, 1);
if ( skipdim == 1 ) addDimension(0, 1);
for ( int id = 0; id < 3; ++id )
......
......@@ -342,12 +342,12 @@ int cdfDefVar(stream_t *streamptr, int varID)
if ( streamptr->vars[varID].ncvarid != CDI_UNDEFID )
return streamptr->vars[varID].ncvarid;
int vlistID = streamptr->vlistID;
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int tsteptype = vlistInqVarTsteptype(vlistID, varID);
int code = vlistInqVarCode(vlistID, varID);
int param = vlistInqVarParam(vlistID, varID);
int vlistID = streamptr->vlistID;
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int timetype = vlistInqVarTimetype(vlistID, varID);
int code = vlistInqVarCode(vlistID, varID);
int param = vlistInqVarParam(vlistID, varID);
int pnum, pcat, pdis;
cdiDecodeParam(param, &pnum, &pcat, &pdis);
......@@ -382,7 +382,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
int tid = streamptr->basetime.ncdimid;
if ( vlistHasTime(vlistID) && tsteptype != TSTEP_CONSTANT )
if ( vlistHasTime(vlistID) && timetype != TIME_CONSTANT )
{
if ( tid == CDI_UNDEFID ) Error("Internal problem, time undefined!");
chunks[ndims] = 1;
......@@ -1005,9 +1005,9 @@ void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data
int ncvarid = cdfDefVar(streamptr, varID);
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int tsteptype = vlistInqVarTsteptype(vlistID, varID);
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int timetype = vlistInqVarTimetype(vlistID, varID);
int xid = CDI_UNDEFID, yid = CDI_UNDEFID;
if ( gridInqType(gridID) == GRID_TRAJECTORY )
......@@ -1024,7 +1024,7 @@ void cdf_write_var(stream_t *streamptr, int varID, int memtype, const void *data
int zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
int zid = streamptr->zaxisID[zaxisindex];
if ( tsteptype != TSTEP_CONSTANT )
if ( timetype != TIME_CONSTANT )
{
start[ndims] = (size_t)ntsteps - 1;
count[ndims] = 1;
......@@ -1100,9 +1100,9 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
int ncvarid = cdfDefVar(streamptr, varID);
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int tsteptype = vlistInqVarTsteptype(vlistID, varID);
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int timetype = vlistInqVarTimetype(vlistID, varID);
if ( gridInqType(gridID) == GRID_TRAJECTORY )
{
......@@ -1118,7 +1118,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
int zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
int zid = streamptr->zaxisID[zaxisindex];
if ( tsteptype != TSTEP_CONSTANT )
if ( timetype != TIME_CONSTANT )
{
start[ndims] = (size_t)ntsteps - 1;
count[ndims] = 1;
......@@ -1195,9 +1195,9 @@ void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
int ncvarid = cdfDefVar(streamptr, varID);
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int tsteptype = vlistInqVarTsteptype(vlistID, varID);
int gridID = vlistInqVarGrid(vlistID, varID);
int zaxisID = vlistInqVarZaxis(vlistID, varID);
int timetype = vlistInqVarTimetype(vlistID, varID);
vlistInqVarDimorder(vlistID, varID, &dimorder);
if ( gridInqType(gridID) == GRID_TRAJECTORY )
......@@ -1217,7 +1217,7 @@ void cdf_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtyp
bool swapxy = (dimorder[2] == 2 || dimorder[0] == 1) && xid != CDI_UNDEFID && yid != CDI_UNDEFID;
size_t ndims = 0;
if ( tsteptype != TSTEP_CONSTANT )
if ( timetype != TIME_CONSTANT )
{
start[ndims] = (size_t)ntsteps - 1;
count[ndims] = 1;
......
......@@ -557,22 +557,22 @@ int vlistInqModel(int vlistID);
/* VLIST VAR routines */
/* vlistDefVarTiles: Create a new tile-based variable */
int vlistDefVarTiles(int vlistID, int gridID, int zaxisID, int tsteptype, int tilesetID);
int vlistDefVarTiles(int vlistID, int gridID, int zaxisID, int timetype, int tilesetID);
/* vlistDefVar: Create a new variable */
int vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype);
int vlistDefVar(int vlistID, int gridID, int zaxisID, int timetype);
void vlistChangeVarGrid(int vlistID, int varID, int gridID);
void vlistChangeVarZaxis(int vlistID, int varID, int zaxisID);
void vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *tsteptype);
void vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *timetype);
int vlistInqVarGrid(int vlistID, int varID);
int vlistInqVarZaxis(int vlistID, int varID);
/* used in MPIOM */
int vlistInqVarID(int vlistID, int code);
void vlistDefVarTimetype(int vlistID, int varID, int tsteptype);
void vlistDefVarTimetype(int vlistID, int varID, int timetype);
int vlistInqVarTimetype(int vlistID, int varID);
void vlistDefVarTsteptype(int vlistID, int varID, int tsteptype);
......
......@@ -54,13 +54,13 @@ typedef struct {
bool calendar;
bool climatology;
bool lformulaterms;
int tsteptype;
int param;
int code;
int tabnum;
int bounds;
int gridID;
int zaxisID;
int timetype;
int gridtype;
int zaxistype;
int xdim;
......@@ -195,7 +195,7 @@ void setForecastTime(const char *timestr, taxis_t *taxis)
static
int setBaseTime(const char *timeunits, taxis_t *taxis)
{
int timetype = TAXIS_ABSOLUTE;
int taxistype = TAXIS_ABSOLUTE;
int rdate = -1, rtime = -1;
size_t len = strlen(timeunits);
......@@ -220,14 +220,14 @@ int setBaseTime(const char *timeunits, taxis_t *taxis)
while ( isspace(tu[pos]) ) ++pos;
if ( str_is_equal(tu+pos, "since") )
timetype = TAXIS_RELATIVE;
taxistype = TAXIS_RELATIVE;
while ( pos < len && !isspace(tu[pos]) ) ++pos;
if ( tu[pos] )
{
while ( isspace(tu[pos]) ) ++pos;
if ( timetype == TAXIS_ABSOLUTE )
if ( taxistype == TAXIS_ABSOLUTE )
{
if ( timeunit == TUNIT_DAY )
{
......@@ -246,7 +246,7 @@ int setBaseTime(const char *timeunits, taxis_t *taxis)
}
}
}
else if ( timetype == TAXIS_RELATIVE )
else if ( taxistype == TAXIS_RELATIVE )
{
scanTimeString(tu+pos, &rdate, &rtime);
......@@ -259,13 +259,13 @@ int setBaseTime(const char *timeunits, taxis_t *taxis)
}
}
taxis->type = timetype;
taxis->type = taxistype;
taxis->unit = timeunit;
Free(tu);
if ( CDI_Debug )
Message("timetype = %d unit = %d", timetype, timeunit);
Message("taxistype = %d unit = %d", taxistype, timeunit);
return 0;
}
......@@ -520,7 +520,7 @@ void cdfCreateRecords(stream_t *streamptr, int tsID)
int nvrecs = 0;
for ( int varID = 0; varID < nvars; varID++ )
{
if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
if ( vlistInqVarTimetype(vlistID, varID) != TIME_CONSTANT )
{
int zaxisID = vlistInqVarZaxis(vlistID, varID);
nvrecs += zaxisInqSize(zaxisID);
......@@ -543,7 +543,7 @@ void cdfCreateRecords(stream_t *streamptr, int tsID)
for ( int recID = 0, vrecID = 0; recID < nrecs; recID++ )
{
int varID = destTstep->records[recID].varID;
if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
if ( vlistInqVarTimetype(vlistID, varID) != TIME_CONSTANT )
{
destTstep->recIDs[vrecID++] = recID;
}
......@@ -640,7 +640,7 @@ void init_ncvars(long nvars, ncvar_t *ncvars)
ncvars[ncvarid].calendar = false;
ncvars[ncvarid].climatology = false;
ncvars[ncvarid].lformulaterms = false;
ncvars[ncvarid].tsteptype = TSTEP_CONSTANT;
ncvars[ncvarid].timetype = TIME_CONSTANT;
ncvars[ncvarid].param = CDI_UNDEFID;
ncvars[ncvarid].code = CDI_UNDEFID;
ncvars[ncvarid].tabnum = 0;
......@@ -1128,7 +1128,7 @@ void cdf_scan_var_attr(int nvars, ncvar_t *ncvars, ncdim_t *ncdims, int timedimi
{
if ( timedimid == dimidsp[0] )
{
ncvars[ncvarid].tsteptype = TSTEP_INSTANT;
ncvars[ncvarid].timetype = TIME_VARYING;
cdf_set_dim(ncvars, ncvarid, 0, T_AXIS);
}
else
......@@ -3095,7 +3095,7 @@ void cdf_define_all_vars(stream_t *streamptr, int vlistID, int instID, int model
int zaxisID = ncvars[ncvarid].zaxisID;
stream_new_var(streamptr, gridID, zaxisID, CDI_UNDEFID);
int varID = vlistDefVar(vlistID, gridID, zaxisID, ncvars[ncvarid].tsteptype);
int varID = vlistDefVar(vlistID, gridID, zaxisID, ncvars[ncvarid].timetype);
#if defined (HAVE_NETCDF4)
if ( ncvars[ncvarid].deflate )
......@@ -3160,7 +3160,7 @@ void cdf_define_all_vars(stream_t *streamptr, int vlistID, int instID, int model
int ixyz = 0;
static const int ipow10[4] = {1, 10, 100, 1000};
if ( ncvars[ncvarid].tsteptype != TSTEP_CONSTANT ) iodim++;
if ( ncvars[ncvarid].timetype != TIME_CONSTANT ) iodim++;
const int *dimids = ncvars[ncvarid].dimids;
......
......@@ -595,7 +595,7 @@ cgribexScanTsConstAdjust(stream_t *streamptr, taxis_t *taxis)
{
streamptr->ntsteps = 0;
for ( int varID = 0; varID < streamptr->nvars; varID++ )
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
}
}
......@@ -1035,7 +1035,7 @@ int cgribexScanTimestep2(stream_t * streamptr)
if ( ! streamptr->tsteps[tsID].records[recID].used )
{
varID = streamptr->tsteps[tsID].records[recID].varID;
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
else
{
......
......@@ -178,7 +178,7 @@ void extAddRecord(stream_t *streamptr, int param, int level, int xysize,
int vlistID = streamptr->vlistID;
int tsID = streamptr->curTsID;
int recID = recordNewEntry(streamptr, tsID);
record_t *record = &streamptr->tsteps[tsID].records[recID];
record_t *record = &streamptr->tsteps[tsID].records[recID];
record->size = recsize;
record->position = position;
......@@ -330,9 +330,7 @@ void extScanTimestep1(stream_t *streamptr)
{
streamptr->ntsteps = 0;
for ( varID = 0; varID < streamptr->nvars; varID++ )
{
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
}
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
}
}
......@@ -461,7 +459,7 @@ int extScanTimestep2(stream_t *streamptr)
if ( ! streamptr->tsteps[tsID].records[recID].used )
{
varID = streamptr->tsteps[tsID].records[recID].varID;
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
else
{
......
......@@ -1004,9 +1004,7 @@ int gribapiScanTimestep1(stream_t * streamptr)
{
streamptr->ntsteps = 0;
for ( int varID = 0; varID < streamptr->nvars; varID++ )
{
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
}
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
}
......@@ -1208,7 +1206,7 @@ int gribapiScanTimestep2(stream_t * streamptr)
if ( ! streamptr->tsteps[tsID].records[recID].used )
{
int varID = streamptr->tsteps[tsID].records[recID].varID;
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
else
{
......
......@@ -845,9 +845,7 @@ void iegScanTimestep1(stream_t *streamptr)
{
streamptr->ntsteps = 0;
for ( int varID = 0; varID < streamptr->nvars; varID++ )
{
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
}
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
}
}
......@@ -980,7 +978,7 @@ int iegScanTimestep2(stream_t *streamptr)
if ( ! streamptr->tsteps[tsID].records[recID].used )
{
int varID = streamptr->tsteps[tsID].records[recID].varID;
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
else
{
......
......@@ -334,7 +334,7 @@ void cdi_create_records(stream_t *streamptr, int tsID)
{
int varID = sourceTstep->records[recID].varID;
nrecords += (varID == CDI_UNDEFID /* varID = CDI_UNDEFID for write mode !!! */
|| vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT);
|| vlistInqVarTimetype(vlistID, varID) != TIME_CONSTANT);
// printf("varID nrecords %d %d %d \n", varID, nrecords, vlistInqVarTsteptype(vlistID, varID));
}
}
......@@ -366,7 +366,7 @@ void cdi_create_records(stream_t *streamptr, int tsID)
destTstep->records[recID].used = curRecord->used;
if ( curRecord->used != CDI_UNDEFID && curRecord->varID != -1 ) /* curRecord->varID = -1 for write mode !!! */
{
if ( vlistInqVarTsteptype(vlistID, curRecord->varID) != TSTEP_CONSTANT )
if ( vlistInqVarTimetype(vlistID, curRecord->varID) != TIME_CONSTANT )
{
destTstep->records[recID].position = CDI_UNDEFID;
destTstep->records[recID].size = 0;
......
......@@ -334,7 +334,7 @@ void srvScanTimestep1(stream_t *streamptr)
{
streamptr->ntsteps = 0;
for ( int varID = 0; varID < streamptr->nvars; varID++ )
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
}
}
......@@ -460,7 +460,7 @@ int srvScanTimestep2(stream_t *streamptr)
if ( ! streamptr->tsteps[tsID].records[recID].used )
{
int varID = streamptr->tsteps[tsID].records[recID].varID;
vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
vlistDefVarTimetype(vlistID, varID, TIME_CONSTANT);
}
else
{
......
......@@ -757,8 +757,9 @@ void cdi_generate_vars(stream_t *streamptr)
/* generate new variable */
int varID = stream_new_var(streamptr, gridID, zaxisID, tilesetID);
varID = vlistDefVarTiles(vlistID, gridID, zaxisID, tsteptype, tilesetID);
varID = vlistDefVarTiles(vlistID, gridID, zaxisID, TIME_VARYING, tilesetID);
vlistDefVarTsteptype(vlistID, varID, tsteptype);
vlistDefVarParam(vlistID, varID, param);
vlistDefVarDatatype(vlistID, varID, prec);
vlistDefVarTimave(vlistID, varID, timave);
......
......@@ -1499,7 +1499,7 @@ int vlistHasTime(int vlistID)
if ( !(CDI_reduce_dim && vlistptr->ntsteps == 1) )
{
for ( int varID = 0; varID < vlistptr->nvars; varID++ )
if ( vlistptr->vars[varID].tsteptype != TSTEP_CONSTANT )
if ( vlistptr->vars[varID].timetype != TIME_CONSTANT )
{
hastime = true;
break;
......
......@@ -129,10 +129,10 @@ void vlistCheckVarID(const char *caller, int vlistID, int varID)
}
int vlistDefVarTiles(int vlistID, int gridID, int zaxisID, int tsteptype, int tilesetID)
int vlistDefVarTiles(int vlistID, int gridID, int zaxisID, int timetype, int tilesetID)
{
if ( CDI_Debug )
Message("gridID = %d zaxisID = %d tsteptype = %d", gridID, zaxisID, tsteptype);
Message("gridID = %d zaxisID = %d timetype = %d", gridID, zaxisID, timetype);
int varID = vlistvarNewEntry(vlistID);
......@@ -140,13 +140,13 @@ int vlistDefVarTiles(int vlistID, int gridID, int zaxisID, int tsteptype, int ti
vlistptr->nvars++;
vlistptr->vars[varID].gridID = gridID;
vlistptr->vars[varID].zaxisID = zaxisID;
vlistptr->vars[varID].tsteptype = tsteptype;
vlistptr->vars[varID].timetype = timetype;
vlistptr->vars[varID].subtypeID = tilesetID;
if ( tsteptype < 0 )
if ( timetype < 0 )
{
Message("Unexpected tstep type %d, set to TSTEP_INSTANT!", tsteptype);
vlistptr->vars[varID].tsteptype = TSTEP_INSTANT;
Message("Unexpected time type %d, set to TIME_VARYING!", timetype);
vlistptr->vars[varID].timetype = TIME_VARYING;
}
vlistAdd2GridIDs(vlistptr, gridID);
......@@ -163,14 +163,13 @@ int vlistDefVarTiles(int vlistID, int gridID, int zaxisID, int tsteptype, int ti
@Function vlistDefVar
@Title Define a Variable
@Prototype int vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype)
@Prototype int vlistDefVar(int vlistID, int gridID, int zaxisID, int timetype)
@Parameter
@Item vlistID Variable list ID, from a previous call to @fref{vlistCreate}.
@Item gridID Grid ID, from a previous call to @fref{gridCreate}.
@Item zaxisID Z-axis ID, from a previous call to @fref{zaxisCreate}.
@Item tsteptype One of the set of predefined CDI timestep types.
The valid CDI timestep types are @func{TSTEP_CONSTANT}, @func{TSTEP_INSTANT},
@func{TSTEP_ACCUM}, @func{TSTEP_AVG}, @func{TSTEP_MAX}, @func{TSTEP_MIN} and @func{TSTEP_SD}.
@Item timetype One of the set of predefined CDI timestep types.
The valid CDI timestep types are @func{TIME_CONSTANT} and @func{TIME_VARYING}.
@Description
The function @func{vlistDefVar} adds a new variable to vlistID.
......@@ -188,7 +187,7 @@ and add a variable with @func{vlistDefVar}.
int vlistID, varID;
...
vlistID = vlistCreate();
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_INSTANT);
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARYING);
...
streamDefVlist(streamID, vlistID);
...
......@@ -197,10 +196,10 @@ vlistDestroy(vlistID);
@EndSource
@EndFunction
*/
int vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype)
int vlistDefVar(int vlistID, int gridID, int zaxisID, int timetype)
{
/* call "vlistDefVarTiles" with a trivial tile index: */
return vlistDefVarTiles(vlistID, gridID, zaxisID, tsteptype, CDI_UNDEFID);
return vlistDefVarTiles(vlistID, gridID, zaxisID, timetype, CDI_UNDEFID);
}
void
......@@ -279,15 +278,15 @@ void vlistDefVarCode(int vlistID, int varID, int code)
}
void vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *tsteptype)
void vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *timetype)
{
vlist_t *vlistptr = vlist_to_pointer(vlistID);
vlistCheckVarID(__func__, vlistID, varID);
*gridID = vlistptr->vars[varID].gridID;
*zaxisID = vlistptr->vars[varID].zaxisID;
*tsteptype = vlistptr->vars[varID].tsteptype;
*gridID = vlistptr->vars[varID].gridID;
*zaxisID = vlistptr->vars[varID].zaxisID;
*timetype = vlistptr->vars[varID].timetype;
return;
}
......@@ -699,8 +698,8 @@ int vlistInqVarSize(int vlistID, int varID)
{
vlistCheckVarID(__func__, vlistID, varID);
int zaxisID, gridID, tsteptype;
vlistInqVar(vlistID, varID, &gridID, &zaxisID, &tsteptype);
int zaxisID, gridID, timetype;
vlistInqVar(vlistID, varID, &gridID, &zaxisID, &timetype);
int nlevs = zaxisInqSize(zaxisID);
......@@ -1236,7 +1235,7 @@ The function @func{vlistInqVarTsteptype} returns the timestep type of a Variable
@Result
@func{vlistInqVarTsteptype} returns the timestep type of the Variable,
one of the set of predefined CDI timestep types.
The valid CDI timestep types are @func{TSTEP_CONSTANT}, @func{TSTEP_INSTANT},
The valid CDI timestep types are @func{TSTEP_INSTANT},
@func{TSTEP_ACCUM}, @func{TSTEP_AVG}, @func{TSTEP_MAX}, @func{TSTEP_MIN} and @func{TSTEP_SD}.
@EndFunction
......@@ -2025,7 +2024,7 @@ int vlistVarCompare(vlist_t *a, int varIDA, vlist_t *b, int varIDB)
#define FCMP2(f) (namespaceResHDecode(pva->f).idx \
!= namespaceResHDecode(pvb->f).idx)
int diff = FCMP(fvarID) | FCMP(mvarID) | FCMP(flag) | FCMP(param)
| FCMP(datatype) | FCMP(tsteptype) | FCMP(timave) | FCMP(timaccu)
| FCMP(datatype) | FCMP(timetype) | FCMP(tsteptype) | FCMP(timave) | FCMP(timaccu)
| FCMP(chunktype) | FCMP(xyz) | FCMP2(gridID) | FCMP2(zaxisID)
| FCMP2(instID) | FCMP2(modelID) | FCMP2(tableID) | FCMP(missvalused)
| FCMPFLT(missval) | FCMPFLT(addoffset) | FCMPFLT(scalefactor) | FCMPSTR(name)
......@@ -2098,7 +2097,7 @@ void vlistVarPack(vlist_t *p, int varID, char * buf, int size, int *position,
tempbuf[0] = var->flag;
tempbuf[1] = var->gridID;
tempbuf[2] = var->zaxisID;
tempbuf[3] = var->tsteptype;
tempbuf[3] = var->timetype;
tempbuf[4] = namesz = var->name?(int)strlen(var->name):0;
tempbuf[5] = longnamesz = var->longname?(int)strlen(var->longname):0;
tempbuf[6] = stdnamesz = var->stdname?(int)strlen(var->stdname):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