Commit d35ac9b0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

use GRIB ltype to define GENERIC zaxis

parent 8971a299
2007-02-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using GRIB library version 1.0.5
* use GRIB ltype to define GENERIC zaxis
* taxisCopyTimestep: copy rdate and rtime [report: Harald Anlauf]
* grbDefGrid: write absolute value of y-inc [report: Paul Dando]
* grbDefTime: change to absolute time axis if value < 0 [report: Frank Toussaint]
* grbDefGrid: change generic grid to lonlat grid
......
......@@ -32,7 +32,7 @@ int DefaultDataType = CDI_UNDEFID;
static void version(void)
{
fprintf(stderr, "CDI version 1.6.0\n");
fprintf(stderr, "CDI version 1.6.1\n");
cdiPrintVersion();
fprintf(stderr, "\n");
/*
......@@ -47,6 +47,7 @@ static void version(void)
1.5.0 22 Nov 2005 : IEG support
1.5.1 21 Feb 2006 : add option -s for short info
1.6.0 1 Aug 2006 : add option -z szip for SZIP compression of GRIB records
1.6.1 27 Feb 2007 : short info with ltype for GENERIC zaxis
*/
}
......@@ -251,6 +252,7 @@ static void printShortinfo(int streamID, int vlistID, int vardis)
int varID;
int gridsize = 0;
int gridID, zaxisID, code;
int zaxistype, ltype;
int vdate, vtime;
int nrecs, nvars, ngrids, nzaxis, ntsteps;
int levelID, levelsize;
......@@ -467,13 +469,18 @@ static void printShortinfo(int streamID, int vlistID, int vardis)
for ( index = 0; index < nzaxis; index++)
{
zaxisID = vlistZaxis(vlistID, index);
zaxistype = zaxisInqType(zaxisID);
ltype = zaxisInqLtype(zaxisID);
levelsize = zaxisInqSize(zaxisID);
/* zaxisInqLongname(zaxisID, longname); */
zaxisName(zaxisInqType(zaxisID), longname);
longname[16] = 0;
zaxisInqUnits(zaxisID, units);
units[12] = 0;
nbyte0 = fprintf(stdout, " %4d : %-16s %5s : ", zaxisID+1, longname, units);
if ( zaxistype == ZAXIS_GENERIC && ltype != 0 )
nbyte0 = fprintf(stdout, " %4d : %-10s (ltype=%3d) : ", zaxisID+1, longname, ltype);
else
nbyte0 = fprintf(stdout, " %4d : %-16s %5s : ", zaxisID+1, longname, units);
nbyte = nbyte0;
for ( levelID = 0; levelID < levelsize; levelID++ )
{
......
......@@ -523,7 +523,7 @@ int gridToCurvilinear(int gridID);
void zaxisName(int zaxistype, char *gridname);
/* zaxisCreate: Create a vertical Z-axis */
int zaxisCreate(int leveltype, int size);
int zaxisCreate(int zaxistype, int size);
/* zaxisDestroy: Destroy a vertical Z-axis */
void zaxisDestroy(int zaxisID);
......@@ -573,8 +573,11 @@ void zaxisInqLongname(int zaxisID, char *longname);
void zaxisInqUnits(int zaxisID, char *units);
void zaxisDefPrec(int zaxisID, int prec);
int zaxisInqPrec(int zaxisID);
void zaxisDefLtype(int zaxisID, int ltype);
int zaxisInqLtype(int zaxisID);
const double *zaxisInqLevelsPtr(int zaxisID);
void zaxisDefVct(int zaxisID, int size, const double *vct);
int zaxisInqVctSize(int zaxisID);
......@@ -587,7 +590,7 @@ double zaxisInqUbound(int zaxisID, int index);
void zaxisDefLbounds(int zaxisID, double *lbounds);
void zaxisDefUbounds(int zaxisID, double *ubounds);
void zaxisDefWeights(int zaxisID, double *weights);
void zaxisChangeType(int zaxisID, int leveltype);
void zaxisChangeType(int zaxisID, int zaxistype);
/* TAXIS routines */
......
......@@ -4483,7 +4483,7 @@ int cdfInqContents(int streamID)
}
ncvars[ncvarid].zaxisID = varDefZaxis(vlistID, zaxisType, (int) zsize, zvar, 0, NULL, NULL,
vctsize, vct, pname, plongname, punits, zprec, 1);
vctsize, vct, pname, plongname, punits, zprec, 1, 0);
free(zvar);
zaxisindex = vlistZaxisIndex(vlistID, ncvars[ncvarid].zaxisID);
......
......@@ -293,7 +293,7 @@ void extAddRecord(int streamID, int code, int level, int xysize,
datatype = extInqDatatype(prec);
varAddRecord(recID, code, gridID, leveltype, 0, level, 0,
datatype, &varID, &levelID, 0, 0);
datatype, &varID, &levelID, 0, 0, 0);
(*record).varID = varID;
(*record).levelID = levelID;
......
......@@ -325,76 +325,76 @@ int grbReadRecord(int streamID, double *data, int *nmiss)
}
int gribGetZaxisType(int grbleveltype)
int gribGetZaxisType(int grb_ltype)
{
int leveltype = 0;
int zaxistype = 0;
switch ( grbleveltype )
switch ( grb_ltype )
{
case LTYPE_SURFACE:
{
leveltype = ZAXIS_SURFACE;
zaxistype = ZAXIS_SURFACE;
break;
}
case LTYPE_99:
case LTYPE_ISOBARIC:
{
leveltype = ZAXIS_PRESSURE;
zaxistype = ZAXIS_PRESSURE;
break;
}
case LTYPE_HEIGHT:
{
leveltype = ZAXIS_HEIGHT;
zaxistype = ZAXIS_HEIGHT;
break;
}
case LTYPE_ALTITUDE:
{
leveltype = ZAXIS_ALTITUDE;
zaxistype = ZAXIS_ALTITUDE;
break;
}
case LTYPE_SIGMA:
{
leveltype = ZAXIS_SIGMA;
zaxistype = ZAXIS_SIGMA;
break;
}
case LTYPE_HYBRID:
case LTYPE_HYBRID_LAYER:
{
leveltype = ZAXIS_HYBRID;
zaxistype = ZAXIS_HYBRID;
break;
}
case LTYPE_LANDDEPTH:
case LTYPE_LANDDEPTH_LAYER:
{
leveltype = ZAXIS_DEPTH_BELOW_LAND;
zaxistype = ZAXIS_DEPTH_BELOW_LAND;
break;
}
case LTYPE_ISENTROPIC:
{
leveltype = ZAXIS_ISENTROPIC;
zaxistype = ZAXIS_ISENTROPIC;
break;
}
case LTYPE_SEADEPTH:
{
leveltype = ZAXIS_DEPTH_BELOW_SEA;
zaxistype = ZAXIS_DEPTH_BELOW_SEA;
break;
}
default:
{
leveltype = ZAXIS_GENERIC;
zaxistype = ZAXIS_GENERIC;
break;
}
}
return (leveltype);
return (zaxistype);
}
int gribGetZaxisHasBounds(int grbleveltype)
int gribGetZaxisHasBounds(int grb_ltype)
{
int lbounds = 0;
switch (grbleveltype)
switch (grb_ltype)
{
case LTYPE_HYBRID_LAYER:
case LTYPE_LANDDEPTH_LAYER:
......@@ -695,7 +695,7 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
{
static char func[] = "grbAddRecord";
int gridtype;
int leveltype;
int zaxistype;
int gridID = UNDEFID, varID;
int levelID = 0;
int tsID, recID;
......@@ -720,7 +720,7 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
if ( ISEC1_LevelType == 100 ) level1 *= 100;
level2 = ISEC1_Level2;
/* fprintf(stderr, "code %d %d %d\n", code, level1, level2); */
/* fprintf(stderr, "code %d %d %d %d\n", code, level1, level2, ISEC1_LevelType); */
(*record).size = recsize;
(*record).position = position;
......@@ -876,9 +876,9 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
gridID = varDefGrid(vlistID, grid, 0);
leveltype = gribGetZaxisType(ISEC1_LevelType);
zaxistype = gribGetZaxisType(ISEC1_LevelType);
if ( leveltype == ZAXIS_HYBRID )
if ( zaxistype == ZAXIS_HYBRID )
{
int vctsize = ISEC2_NumVCP;
double *vctptr = &fsec2[10];
......@@ -891,8 +891,8 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
if ( prec > 32 ) prec = DATATYPE_PACK32;
if ( prec < 0 ) prec = DATATYPE_PACK;
varAddRecord(recID, code, gridID, leveltype, lbounds, level1, level2,
prec, &varID, &levelID, numavg, ISEC1_CodeTable);
varAddRecord(recID, code, gridID, zaxistype, lbounds, level1, level2,
prec, &varID, &levelID, numavg, ISEC1_CodeTable, ISEC1_LevelType);
(*record).varID = varID;
(*record).levelID = levelID;
......@@ -932,8 +932,8 @@ void grbAddRecord(int streamID, int code, int *isec1, int *isec2, double *fsec2,
streamptr->nrecs++;
if ( CDI_Debug )
Message(func, "varID = %d code = %d leveltype = %d gridID = %d levelID = %d",
varID, code, leveltype, gridID, levelID);
Message(func, "varID = %d code = %d zaxistype = %d gridID = %d levelID = %d",
varID, code, zaxistype, gridID, levelID);
}
......@@ -1820,21 +1820,22 @@ void grbDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID
{
static char func[] = "grbDefLevel";
double level;
int ilevel, leveltype;
int ilevel, zaxistype, ltype;
static int warning = 1;
static int vct_warning = 1;
leveltype = zaxisInqType(zaxisID);
zaxistype = zaxisInqType(zaxisID);
ltype = zaxisInqLtype(zaxisID);
if ( leveltype == ZAXIS_GENERIC )
if ( zaxistype == ZAXIS_GENERIC && ltype == 0 )
{
leveltype = ZAXIS_PRESSURE;
zaxisChangeType(zaxisID, leveltype);
zaxistype = ZAXIS_PRESSURE;
zaxisChangeType(zaxisID, zaxistype);
}
ISEC2_NumVCP = 0;
switch (leveltype)
switch (zaxistype)
{
case ZAXIS_SURFACE:
{
......@@ -1984,11 +1985,22 @@ void grbDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID
ISEC1_Level1 = ilevel;
ISEC1_Level2 = 0;
break;
}
case ZAXIS_GENERIC:
{
level = zaxisInqLevel(zaxisID, levelID);
ilevel = (int) level;
ISEC1_LevelType = ltype;
ISEC1_Level1 = ilevel;
ISEC1_Level2 = 0;
break;
}
default:
{
Error(func, "leveltype >%s< unsupported", zaxisNamePtr(leveltype));
Error(func, "zaxistype >%s< unsupported", zaxisNamePtr(zaxistype));
break;
}
}
......
......@@ -697,7 +697,7 @@ void iegAddRecord(int streamID, int code, int *pdb, int *gdb, double *vct,
datatype = iegInqDatatype(prec);
varAddRecord(recID, code, gridID, leveltype, lbounds, level1, level2,
datatype, &varID, &levelID, 0, 0);
datatype, &varID, &levelID, 0, 0, 0);
(*record).varID = varID;
(*record).levelID = levelID;
......
......@@ -306,7 +306,7 @@ void srvAddRecord(int streamID, int code, int level, int xsize, int ysize,
datatype = srvInqDatatype(prec);
varAddRecord(recID, code, gridID, leveltype, 0, level, 0,
datatype, &varID, &levelID, 0, 0);
datatype, &varID, &levelID, 0, 0, 0);
(*record).varID = varID;
(*record).levelID = levelID;
......
......@@ -599,6 +599,9 @@ void taxisCopyTimestep(int taxisID2, int taxisID1)
taxis_check_ptr(func, taxisptr1);
taxis_check_ptr(func, taxisptr2);
taxisptr2->rdate = taxisptr1->rdate;
taxisptr2->rtime = taxisptr1->rtime;
taxisptr2->vdate = taxisptr1->vdate;
taxisptr2->vtime = taxisptr1->vtime;
......
......@@ -32,7 +32,8 @@ typedef struct
int prec;
int average;
int gridID;
int leveltype;
int zaxistype;
int ltype; /* GRIB level type */
int lbounds;
int zaxisID;
int nlevels;
......@@ -58,6 +59,9 @@ static void codeInitEntry(int varID, int code)
vartable[varID].code = code;
vartable[varID].prec = 0;
vartable[varID].average = 0;
vartable[varID].gridID = UNDEFID;
vartable[varID].zaxistype = 0;
vartable[varID].ltype = 0;
vartable[varID].levelTable = NULL;
vartable[varID].levelTableSize = 0;
vartable[varID].nlevels = 0;
......@@ -68,14 +72,15 @@ static void codeInitEntry(int varID, int code)
}
static int varGetEntry(int code, int leveltype, int codetable)
static int varGetEntry(int code, int zaxistype, int codetable, int ltype)
{
int varID;
for ( varID = 0; varID < varTablesize; varID++ )
{
if ( vartable[varID].code == code &&
vartable[varID].leveltype == leveltype &&
vartable[varID].zaxistype == zaxistype &&
vartable[varID].ltype == ltype &&
vartable[varID].codetable == codetable )
return (varID);
}
......@@ -237,16 +242,16 @@ int codeNewEntry (int code)
}
void varAddRecord(int recID, int code, int gridID, int leveltype, int lbounds,
void varAddRecord(int recID, int code, int gridID, int zaxistype, int lbounds,
int level1, int level2, int prec, int *pvarID, int *plevelID,
int numavg, int codetable)
int numavg, int codetable, int ltype)
{
static char func[] = "varAddRecord";
int varID = UNDEFID;
int levelID = -1;
if ( ! (cdiSplitLtype105 == 1 && leveltype == ZAXIS_HEIGHT) )
varID = varGetEntry(code, leveltype, codetable);
if ( ! (cdiSplitLtype105 == 1 && zaxistype == ZAXIS_HEIGHT) )
varID = varGetEntry(code, zaxistype, codetable, ltype);
if ( varID == UNDEFID )
{
......@@ -254,7 +259,8 @@ void varAddRecord(int recID, int code, int gridID, int leveltype, int lbounds,
varID = codeNewEntry(code);
if ( prec > vartable[varID].prec ) vartable[varID].prec = prec;
vartable[varID].gridID = gridID;
vartable[varID].leveltype = leveltype;
vartable[varID].zaxistype = zaxistype;
vartable[varID].ltype = ltype;
vartable[varID].lbounds = lbounds;
if ( numavg ) vartable[varID].average = 1;
vartable[varID].codetable = codetable;
......@@ -266,10 +272,10 @@ void varAddRecord(int recID, int code, int gridID, int leveltype, int lbounds,
Message(func, "code = %d gridID = %d", code, gridID);
Error(func, "horizontal grid must not change for same code");
}
if ( vartable[varID].leveltype != leveltype )
if ( vartable[varID].zaxistype != zaxistype )
{
Message(func, "code = %d leveltype = %d", code, leveltype);
Error(func, "leveltype must not change for same code");
Message(func, "code = %d zaxistype = %d", code, zaxistype);
Error(func, "zaxistype must not change for same code");
}
}
......@@ -315,7 +321,7 @@ void cdiGenVars(int streamID)
static char func[] = "cdiGenVars";
int varID, gridID, zaxisID, levelID;
int instID, modelID, tableID;
int code, nlevels, leveltype, lindex;
int code, nlevels, zaxistype, lindex, ltype;
int prec;
int average;
int lbounds;
......@@ -336,9 +342,10 @@ void cdiGenVars(int streamID)
gridID = vartable[varID].gridID;
code = vartable[varID].code;
nlevels = vartable[varID].nlevels;
leveltype = vartable[varID].leveltype;
if ( leveltype == ZAXIS_GENERIC && cdiDefaultLeveltype != -1 )
leveltype = cdiDefaultLeveltype;
ltype = vartable[varID].ltype;
zaxistype = vartable[varID].zaxistype;
if ( ltype == 0 && zaxistype == ZAXIS_GENERIC && cdiDefaultLeveltype != -1 )
zaxistype = cdiDefaultLeveltype;
lbounds = vartable[varID].lbounds;
prec = vartable[varID].prec;
instID = vartable[varID].instID;
......@@ -349,12 +356,12 @@ void cdiGenVars(int streamID)
zaxisID = UNDEFID;
if ( leveltype == ZAXIS_GENERIC && nlevels == 1 && ! (fabs(vartable[varID].levelTable[0].level1)>0) )
leveltype = ZAXIS_SURFACE;
if ( ltype == 0 && zaxistype == ZAXIS_GENERIC && nlevels == 1 && ! (fabs(vartable[varID].levelTable[0].level1)>0) )
zaxistype = ZAXIS_SURFACE;
dlevels = (double *) malloc(nlevels*sizeof(double));
if ( lbounds && leveltype != ZAXIS_HYBRID && leveltype != ZAXIS_HYBRID_HALF )
if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
for ( levelID = 0; levelID < nlevels; levelID++ )
dlevels[levelID] = (vartable[varID].levelTable[levelID].level1 +
vartable[varID].levelTable[levelID].level2)/2;
......@@ -380,8 +387,8 @@ void cdiGenVars(int streamID)
if ( levelID == nlevels ) ldec = TRUE;
if ( ldec == FALSE ||
leveltype == ZAXIS_HYBRID ||
leveltype == ZAXIS_DEPTH_BELOW_LAND )
zaxistype == ZAXIS_HYBRID ||
zaxistype == ZAXIS_DEPTH_BELOW_LAND )
{
/*
qsort(dlevels, nlevels, sizeof(double), dblcmp);
......@@ -389,7 +396,7 @@ void cdiGenVars(int streamID)
qsort(vartable[varID].levelTable, nlevels,
sizeof(LEVELTABLE), cmpLevelTable);
if ( lbounds && leveltype != ZAXIS_HYBRID && leveltype != ZAXIS_HYBRID_HALF )
if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
for ( levelID = 0; levelID < nlevels; levelID++ )
dlevels[levelID] = (vartable[varID].levelTable[levelID].level1 +
vartable[varID].levelTable[levelID].level2)/2.;
......@@ -410,8 +417,8 @@ void cdiGenVars(int streamID)
dlevels2[levelID] = vartable[varID].levelTable[levelID].level2;
}
zaxisID = varDefZaxis(vlistID, leveltype, nlevels, dlevels, lbounds, dlevels1, dlevels2,
Vctsize, Vct, NULL, NULL, NULL, 0, 0);
zaxisID = varDefZaxis(vlistID, zaxistype, nlevels, dlevels, lbounds, dlevels1, dlevels2,
Vctsize, Vct, NULL, NULL, NULL, 0, 0, ltype);
if ( lbounds ) free(dlevels1);
if ( lbounds ) free(dlevels2);
......@@ -567,13 +574,13 @@ int varDefGrid(int vlistID, GRID grid, int mode)
}
int zaxisCompare(int zaxisID, int leveltype, int nlevels, int lbounds, double *levels, char *longname, char *units)
int zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, double *levels, char *longname, char *units, int ltype)
{
int differ = 1;
int levelID;
int zlbounds = 0;
if ( leveltype == zaxisInqType(zaxisID) || leveltype == ZAXIS_GENERIC )
if ( ltype == zaxisInqLtype(zaxisID) && (zaxistype == zaxisInqType(zaxisID) || zaxistype == ZAXIS_GENERIC) )
{
if ( zaxisInqLbounds(zaxisID, NULL) > 0 ) zlbounds = 1;
if ( nlevels == zaxisInqSize(zaxisID) && zlbounds == lbounds )
......@@ -611,8 +618,9 @@ int zaxisCompare(int zaxisID, int leveltype, int nlevels, int lbounds, double *l
}
int varDefZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbounds, double *levels1, double *levels2,
int vctsize, double *vct, char *name, char *longname, char *units, int prec, int mode)
int varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbounds,
double *levels1, double *levels2, int vctsize, double *vct, char *name,
char *longname, char *units, int prec, int mode, int ltype)
{
/*
mode: 0 search in vlist and zaxis table
......@@ -636,7 +644,7 @@ int varDefZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbo
{
zaxisID = vlistptr->zaxisIDs[index];
if ( zaxisCompare(zaxisID, leveltype, nlevels, lbounds, levels, longname, units) == 0 )
if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, longname, units, ltype) == 0 )
{
zaxisdefined = 1;
break;
......@@ -647,7 +655,7 @@ int varDefZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbo
{
nzaxis = zaxisSize();
for ( zaxisID = 0; zaxisID < nzaxis; zaxisID++ )
if ( zaxisCompare(zaxisID, leveltype, nlevels, lbounds, levels, longname, units) == 0 )
if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, longname, units, ltype) == 0 )
{
zaxisglobdefined = 1;
break;
......@@ -667,7 +675,7 @@ int varDefZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbo
{
if ( ! zaxisglobdefined )
{
zaxisID = zaxisCreate(leveltype, nlevels);
zaxisID = zaxisCreate(zaxistype, nlevels);
zaxisDefLevels(zaxisID, levels);
if ( lbounds )
{
......@@ -675,7 +683,7 @@ int varDefZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbo
zaxisDefUbounds(zaxisID, levels2);
}
if ( leveltype == ZAXIS_HYBRID )
if ( zaxistype == ZAXIS_HYBRID )
{
/* if ( vctsize > 0 && vctsize >= 2*(nlevels+1)) */
if ( vctsize > 0 && vctsize >= 2*(nlevels))
......@@ -688,6 +696,7 @@ int varDefZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbo
zaxisDefLongname(zaxisID, longname);
zaxisDefUnits(zaxisID, units);
zaxisDefPrec(zaxisID, prec);
zaxisDefLtype(zaxisID, ltype);
}
nzaxis = vlistptr->nzaxis;
......
......@@ -6,15 +6,16 @@
#endif
void varAddRecord(int recID, int code, int gridID, int leveltype, int lbounds,
void varAddRecord(int recID, int code, int gridID, int zaxistype, int lbounds,
int level1, int level2, int prec, int *pvarID, int *plevelID,
int numavg, int codetable);
int numavg, int codetable, int ltype);
void varDefVCT(size_t vctsize, double *vctptr);
int varDefGrid(int vlistID, GRID grid, int mode);
int varDefZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbounds, double *levels1, double *levels2,
int vctsize, double *vct, char *name, char *longname, char *units, int prec, int mode);
int varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbounds,
double *levels1, double *levels2, int vctsize, double *vct, char *name,
char *longname, char *units, int prec, int mode, int ltype);
void varDefSzip(int varID, int szip);
void varDefInst(int varID, int instID);
......@@ -24,6 +25,6 @@ int varInqModel(int varID);
void varDefTable(int varID, int tableID);
int varInqTable(int varID);
int zaxisCompare(int zaxisID, int leveltype, int nlevels, int lbounds, double *levels, char *longname, char *units);
int zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, double *levels, char *longname, char *units, int ltype);
#endif
......@@ -496,7 +496,7 @@ void vlistClearFlag(int vlistID)
}
int vlistInqZaxis(int vlistID, int leveltype, int nlevels, double *levels, int lbounds, double *levels2,
int vlistInqZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbounds, double *levels2,
int vctsize, const double *vct)
{
static char func[] = "vlistInqZaxis";
......@@ -518,7 +518,7 @@ int vlistInqZaxis(int vlistID, int leveltype, int nlevels, double *levels, int l
{
zaxisID = vlistptr->zaxisIDs[index];
if ( zaxisCompare(zaxisID, leveltype, nlevels, lbounds, levels, NULL, NULL) == 0 )
if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, NULL, NULL, 0) == 0 )
{
zaxisdefined = 1;
break;
......@@ -529,7 +529,7 @@ int vlistInqZaxis(int vlistID, int leveltype, int nlevels, double *levels, int l
{
nzaxis = zaxisSize();
for ( zaxisID = 0; zaxisID < nzaxis; zaxisID++ )
if ( zaxisCompare(zaxisID, leveltype, nlevels, lbounds, levels, NULL, NULL) == 0 )
if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, NULL, NULL, 0) == 0 )
{
zaxisglobdefined = 1;
break;
......@@ -540,7 +540,7 @@ int vlistInqZaxis(int vlistID, int leveltype, int nlevels, double *levels, int l
{
if ( ! zaxisglobdefined )
{
zaxisID = zaxisCreate(leveltype, nlevels);
zaxisID = zaxisCreate(zaxistype, nlevels);
zaxisDefLevels(zaxisID, levels);
if ( lbounds )
{
......@@ -548,7 +548,7 @@ int vlistInqZaxis(int vlistID, int leveltype, int nlevels, double *levels, int l
zaxisDefUbounds(zaxisID, levels2);
}
if ( leveltype == ZAXIS_HYBRID )
if ( zaxistype == ZAXIS_HYBRID )
{
if ( vctsize > 0 )
zaxisDefVct(zaxisID, vctsize, vct);
......