Commit 2c832404 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added interface routine vlistDefVarTimetype() and vlistInqVarTimetype().

parent 6e246856
......@@ -225,8 +225,9 @@ typedef struct {
/* TIME types */
#define TIME_CONSTANT 0 /* obsolate, use TSTEP_CONSTANT */
#define TIME_VARIABLE 1 /* obsolate, use TSTEP_INSTANT */
#define TIME_CONSTANT 0 /* Time constant */
#define TIME_VARYING 1 /* Time varying */
#define TIME_VARIABLE 1 /* obsolate, use TIME_VARYING */
/* TSTEP types */
......@@ -571,6 +572,9 @@ int vlistInqVarZaxis(int vlistID, int varID);
/* used in MPIOM */
int vlistInqVarID(int vlistID, int code);
void vlistDefVarTimetype(int vlistID, int varID, int tsteptype);
int vlistInqVarTimetype(int vlistID, int varID);
void vlistDefVarTsteptype(int vlistID, int varID, int tsteptype);
/* vlistInqVarTsteptype: Get the timestep type of a Variable */
......
......@@ -54,6 +54,7 @@ typedef struct
int param;
int gridID;
int zaxisID;
int timetype; /* TIME_* */
int tsteptype; /* TSTEP_* */
int datatype; /* CDI_DATATYPE_PACKX for GRIB data, else CDI_DATATYPE_FLT32 or CDI_DATATYPE_FLT64 */
int instID;
......@@ -127,7 +128,6 @@ void vlistDestroyVarLongname(int vlistID, int varID);
void vlistDestroyVarStdname(int vlistID, int varID);
void vlistDestroyVarUnits(int vlistID, int varID);
void cdiVlistDestroy_(int vlistID);
void vlistDefVarTsteptype(int vlistID, int varID, int tsteptype);
int vlistInqVarMissvalUsed(int vlistID, int varID);
int vlistHasTime(int vlistID);
......
......@@ -32,6 +32,7 @@ void vlistvarInitEntry(int vlistID, int varID)
vlistptr->vars[varID].flag = 0;
vlistptr->vars[varID].param = 0;
vlistptr->vars[varID].datatype = CDI_UNDEFID;
vlistptr->vars[varID].timetype = CDI_UNDEFID;
vlistptr->vars[varID].tsteptype = TSTEP_INSTANT;
vlistptr->vars[varID].timave = 0;
vlistptr->vars[varID].timaccu = 0;
......@@ -1192,6 +1193,24 @@ void vlistDefVarAddoffset(int vlistID, int varID, double addoffset)
}
void vlistDefVarTimetype(int vlistID, int varID, int timetype)
{
vlist_t *vlistptr = vlist_to_pointer(vlistID);
if (vlistptr->vars[varID].timetype != timetype)
{
vlistptr->vars[varID].timetype = timetype;
reshSetStatus(vlistID, &vlistOps, RESH_DESYNC_IN_USE);
}
}
int vlistInqVarTimetype(int vlistID, int varID)
{
vlist_t *vlistptr = vlist_to_pointer(vlistID);
return vlistptr->vars[varID].timetype;
}
void vlistDefVarTsteptype(int vlistID, int varID, int tsteptype)
{
vlist_t *vlistptr = vlist_to_pointer(vlistID);
......
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