Commit 0e11941f authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added leadtimeid to basetime_t

parent 27fcd619
......@@ -11,7 +11,7 @@
#undef UNDEFID
#define UNDEFID CDI_UNDEFID
void basetimeInit(BaseTime *basetime)
void basetimeInit(basetime_t *basetime)
{
if ( basetime == NULL )
Error("Internal problem! Basetime not allocated.");
......@@ -19,6 +19,7 @@ void basetimeInit(BaseTime *basetime)
(*basetime).ncvarid = UNDEFID;
(*basetime).ncdimid = UNDEFID;
(*basetime).ncvarboundsid = UNDEFID;
(*basetime).leadtimeid = UNDEFID;
(*basetime).lwrf = 0;
}
/*
......
......@@ -6,11 +6,12 @@ typedef struct {
int ncvarid;
int ncdimid;
int ncvarboundsid;
int leadtimeid;
int lwrf; /* TRUE for time axis in WRF format */
}
BaseTime;
basetime_t;
void basetimeInit(BaseTime *basetime);
void basetimeInit(basetime_t *basetime);
#endif /* _BASETIME_H */
/*
......
......@@ -597,10 +597,10 @@ void streamPrintP ( void * streamptr, FILE * fp )
fprintf ( fp, "#\n");
fprintf ( fp, "# streamID %d\n", sp->self);
fprintf ( fp, "#\n");
fprintf ( fp, "#\n");
fprintf ( fp, "self = %d\n", sp->self );
fprintf ( fp, "accesstype = %d\n", sp->accesstype );
fprintf ( fp, "accessmode = %d\n", sp->accessmode );
fprintf ( fp, "accessmode = %d\n", sp->accessmode );
fprintf ( fp, "filetype = %d\n", sp->filetype );
fprintf ( fp, "byteorder = %d\n", sp->byteorder );
fprintf ( fp, "fileID = %d\n", sp->fileID );
......@@ -622,7 +622,7 @@ void streamPrintP ( void * streamptr, FILE * fp )
fprintf ( fp, "// tsteps_t *tsteps;\n" );
fprintf ( fp, "tstepsTableSize= %d\n", sp->tstepsTableSize );
fprintf ( fp, "tstepsNextID = %d\n", sp->tstepsNextID );
fprintf ( fp, "//BaseTime basetime;\n" );
fprintf ( fp, "//basetime_t basetime;\n" );
fprintf ( fp, "ncmode = %d\n", sp->ncmode );
fprintf ( fp, "vlistID = %d\n", sp->vlistID );
fprintf ( fp, "// int xdimID[MAX_GRIDS_PS];\n" );
......
......@@ -221,7 +221,7 @@ typedef struct {
tsteps_t *tsteps;
int tstepsTableSize;
int tstepsNextID;
BaseTime basetime;
basetime_t basetime;
int ncmode;
int vlistID;
int xdimID[MAX_GRIDS_PS];
......
......@@ -7470,8 +7470,7 @@ int cdfInqContents(stream_t *streamptr)
if ( time_has_units )
{
taxis_t *taxis;
taxis = &streamptr->tsteps[0].taxis;
taxis_t *taxis = &streamptr->tsteps[0].taxis;
cdfGetAttText(fileID, ncvarid, "units", attstringlen-1, attstring);
if ( splitBasetime(attstring, taxis) == 1 )
......@@ -7486,8 +7485,7 @@ int cdfInqContents(stream_t *streamptr)
if ( ncvarid != -1 )
{
taxis_t *taxis;
taxis = &streamptr->tsteps[0].taxis;
taxis_t *taxis = &streamptr->tsteps[0].taxis;
taxis->name = strdup(ncvars[ncvarid].name);
if ( ncvars[ncvarid].longname[0] )
......@@ -7520,7 +7518,9 @@ int cdfInqContents(stream_t *streamptr)
}
if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
taxisID = taxisCreate(TAXIS_RELATIVE);
{
taxisID = taxisCreate(TAXIS_RELATIVE);
}
else
{
taxisID = taxisCreate(TAXIS_ABSOLUTE);
......@@ -7531,22 +7531,15 @@ int cdfInqContents(stream_t *streamptr)
}
}
if ( calendar != UNDEFID )
{
taxis_t *taxis;
taxis = &streamptr->tsteps[0].taxis;
taxis->calendar = calendar;
taxisDefCalendar(taxisID, calendar);
}
else if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
if ( calendar == UNDEFID && streamptr->tsteps[0].taxis.type != TAXIS_ABSOLUTE )
{
taxis_t *taxis;
calendar = CALENDAR_STANDARD;
}
taxis = &streamptr->tsteps[0].taxis;
if ( calendar != UNDEFID )
{
taxis_t *taxis = &streamptr->tsteps[0].taxis;
taxis->calendar = calendar;
taxisDefCalendar(taxisID, calendar);
}
......
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