Commit 2160282b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribex: use timerange indication to identify different variables

parent d8d7a3d4
......@@ -3,6 +3,10 @@
* Version 1.7.0 released
* using CGRIBEX library version 1.7.0
2014-08-13 Uwe Schulzweida
* cgribex: use timerange indication to identify different variables
2014-08-12 Daniel Reinert
* listDestroy(): set resHListSize=0 [Bug #5058]
......
......@@ -375,6 +375,8 @@ void printShortinfo(int streamID, int vlistID, int vardis)
else if ( tsteptype == TSTEP_MIN ) fprintf(stdout, "%-8s ", "min");
else if ( tsteptype == TSTEP_MAX ) fprintf(stdout, "%-8s ", "max");
else if ( tsteptype == TSTEP_ACCUM ) fprintf(stdout, "%-8s ", "accum");
else if ( tsteptype == TSTEP_RANGE ) fprintf(stdout, "%-8s ", "range");
else if ( tsteptype == TSTEP_DIFF ) fprintf(stdout, "%-8s ", "diff");
else fprintf(stdout, "%-8s ", "unknown");
/* layer info */
......
......@@ -533,7 +533,6 @@ compvar_t cgribexVarSet(int param, int level1, int level2, int leveltype, int tr
static
int cgribexVarCompare(compvar_t compVar, record_t record)
{
int rstatus;
compvar_t compVar0;
compVar0.param = record.param;
......@@ -542,7 +541,7 @@ int cgribexVarCompare(compvar_t compVar, record_t record)
compVar0.ltype = record.ltype;
compVar0.tsteptype = record.tsteptype;
rstatus = memcmp(&compVar0, &compVar, sizeof(compvar_t));
int rstatus = memcmp(&compVar0, &compVar, sizeof(compvar_t));
return (rstatus);
}
......
......@@ -121,7 +121,7 @@ void paramInitEntry(int varID, int param)
}
static
int varGetEntry(int param, int zaxistype, int ltype, const char *name)
int varGetEntry(int param, int zaxistype, int ltype, int tsteptype, const char *name)
{
int varID;
......@@ -129,7 +129,8 @@ int varGetEntry(int param, int zaxistype, int ltype, const char *name)
{
if ( vartable[varID].param == param &&
vartable[varID].zaxistype == zaxistype &&
vartable[varID].ltype == ltype )
vartable[varID].ltype == ltype &&
vartable[varID].tsteptype == tsteptype )
{
if ( name && name[0] && vartable[varID].name && vartable[varID].name[0] )
{
......@@ -325,7 +326,7 @@ void varAddRecord(int recID, int param, int gridID, int zaxistype, int lbounds,
int levelID = -1;
if ( ! (cdiSplitLtype105 == 1 && zaxistype == ZAXIS_HEIGHT) )
varID = varGetEntry(param, zaxistype, ltype, name);
varID = varGetEntry(param, zaxistype, ltype, tsteptype, name);
if ( varID == UNDEFID )
{
......@@ -449,23 +450,20 @@ void cdi_generate_vars(stream_t *streamptr)
double *dlevels = NULL;
double *dlevels1 = NULL;
double *dlevels2 = NULL;
int vlistID;
int *varids, index, varid;
int index, varid;
double level_sf = 1;
int vlistID = streamptr->vlistID;
vlistID = streamptr->vlistID;
varids = (int *) malloc(nvars*sizeof(int));
int *varids = (int *) malloc(nvars*sizeof(int));
for ( varID = 0; varID < nvars; varID++ ) varids[varID] = varID;
if ( streamptr->sortname )
{
int index;
param_t **varInfo;
varInfo = (param_t **) malloc(nvars*sizeof(param_t *));
varInfo[0] = (param_t *) malloc(nvars*sizeof(param_t));
for ( index = 1; index < nvars; index++ )
for ( int index = 1; index < nvars; index++ )
varInfo[index] = varInfo[0] + index;
for ( varid = 0; varid < nvars; varid++ )
......
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