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

changed parameter order

parent 70118da1
2009-12-11 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* streamSync: check that vlist has variables to sync [report: Martin Schultz]
2009-12-09 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfDefVar: define attribute _FillValue if missval was defined (speed up)
......
......@@ -232,7 +232,7 @@ void printShortinfo(int streamID, int vlistID, int vardis)
gridID = vlistInqVarGrid(vlistID, varID);
zaxisID = vlistInqVarZaxis(vlistID, varID);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(255, tabnum, code);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
param2str(param, paramstr, sizeof(paramstr));
if ( vardis ) vlistInqVarName(vlistID, varID, varname);
......@@ -860,7 +860,7 @@ int main(int argc, char *argv[])
code = vlistInqVarCode(vlistID1, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID1, varID));
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(255, tabnum, code);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
param2str(param, paramstr, sizeof(paramstr));
if ( Vardis ) vlistInqVarName(vlistID1, varID, varname);
......@@ -899,7 +899,7 @@ int main(int argc, char *argv[])
code = vlistInqVarCode(vlistID1, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID1, varID));
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(255, tabnum, code);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
param2str(param, paramstr, sizeof(paramstr));
if ( Vardis ) vlistInqVarName(vlistID1, varID, varname);
......
......@@ -37,14 +37,14 @@ void param2str(int param, char *paramstr, int maxlen)
int dis, cat, num;
int len;
cdiDecodeParam(param, &dis, &cat, &num);
cdiDecodeParam(param, &num, &cat, &dis);
if ( dis == 255 && (cat == 255 || cat == 0 ) )
len = sprintf(paramstr, "%d", num);
else if ( dis == 255 )
len = sprintf(paramstr, "%d.%d", cat, num);
len = sprintf(paramstr, "%d.%d", num, cat);
else
len = sprintf(paramstr, "%d.%d.%d", dis, cat, num);
len = sprintf(paramstr, "%d.%d.%d", num, cat, dis);
if ( len > ( maxlen-1) )
fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", func);
......
......@@ -177,11 +177,11 @@ void cdiDefGlobal(const char *string, int val);
/* param format: DDDCCCNNN */
void cdiDecodeParam(int param, int *dis, int *cat, int *num);
int cdiEncodeParam(int dis, int cat, int num);
void cdiDecodeParam(int param, int *num, int *cat, int *dis);
int cdiEncodeParam(int num, int cat, int dis);
/* date format: YYYYMMDD */
/* time format: hhmmss */
/* time format: hhmmss */
void cdiDecodeDate(int date, int *year, int *month, int *day);
int cdiEncodeDate(int year, int month, int day);
......
void cdiDecodeParam(int param, int *pdis, int *pcat, int *pnum)
void cdiDecodeParam(int param, int *pnum, int *pcat, int *pdis)
{
int iparam;
iparam = param;
if ( param < 0 ) iparam = -iparam;
*pdis = iparam / 1000000;
iparam = iparam - *pdis*1000000;
*pdis = iparam / 1000000;
iparam = iparam - *pdis*1000000;
*pcat = iparam / 1000;
*pnum = iparam - *pcat*1000;
if ( param < 0 ) *pnum = -(*pnum);
}
int cdiEncodeParam(int pdis, int pcat, int pnum)
int cdiEncodeParam(int pnum, int pcat, int pdis)
{
int param;
int inum;
if ( pcat < 0 ) pcat = 255;
if ( pdis < 0 ) pdis = 255;
inum = pnum;
if ( pnum < 0 ) inum = -pnum;
param = pdis*1000000 + pcat*1000 + inum;
......
/* Automatically generated by m214003 at 2009-12-07, do not edit */
/* Automatically generated by m214003 at 2009-12-11, do not edit */
/* CGRIBEXLIB_VERSION="1.4.1" */
......@@ -103,22 +103,6 @@
double intpow2(int x);
/* CDI converter routines */
/* param format: DDDCCCNNN */
void cdiDecodeParam(int param, int *dis, int *cat, int *num);
int cdiEncodeParam(int dis, int cat, int num);
/* date format: YYYYMMDD */
/* time format: hhmmss */
void cdiDecodeDate(int date, int *year, int *month, int *day);
int cdiEncodeDate(int year, int month, int day);
void cdiDecodeTime(int time, int *hour, int *minute, int *second);
int cdiEncodeTime(int hour, int minute, int second);
extern FILE *grprsm;
......@@ -8905,7 +8889,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.4.1" " of ""Dec 7 2009"" ""11:57:30";
static const char grb_libvers[] = "1.4.1" " of ""Dec 11 2009"" ""15:11:13";
const char *
cgribexLibraryVersion(void)
{
......
......@@ -22,8 +22,10 @@
#endif
#if defined (HAVE_MALLOC_H)
#if ! defined (HAVE_MALLINFO)
# define HAVE_MALLINFO
#endif
#endif
#if defined (HAVE_MALLOC_H)
# include <malloc.h>
......
......@@ -1248,6 +1248,7 @@ void streamSync(int streamID)
int filetype;
int fileID;
int vlistID;
int nvars;
stream_t *streamptr;
streamptr = stream_to_pointer(streamID);
......@@ -1257,9 +1258,14 @@ void streamSync(int streamID)
fileID = streamptr->fileID;
filetype = streamptr->filetype;
vlistID = streamInqVlist(streamID);
nvars = vlistNvars(vlistID);
if ( fileID == CDI_UNDEFID )
Warning(func, "File %s not open!", streamptr->filename);
else if ( vlistID == CDI_UNDEFID )
Warning(func, "Vlist undefined for file %s!", streamptr->filename);
else if ( nvars == 0 )
Warning(func, "No variables defined!");
else
{
if ( streamptr->filemode == 'w' || streamptr->filemode == 'a' )
......@@ -1271,8 +1277,8 @@ void streamSync(int streamID)
case FILETYPE_NC2:
case FILETYPE_NC4:
{
void cdf_sync (int ncid);
cdf_sync(fileID);
void cdf_sync(int ncid);
if ( streamptr->ncmode == 2 ) cdf_sync(fileID);
break;
}
#endif
......
......@@ -5765,7 +5765,7 @@ int cdfInqContents(int streamID)
if ( ncvars[ncvarid].code != UNDEFID )
{
int param;
param = cdiEncodeParam(255, ncvars[ncvarid].tabnum, ncvars[ncvarid].code);
param = cdiEncodeParam(ncvars[ncvarid].code, ncvars[ncvarid].tabnum, 255);
vlistDefVarParam(vlistID, varID, param);
}
if ( ncvars[ncvarid].longname[0] ) vlistDefVarLongname(vlistID, varID, ncvars[ncvarid].longname);
......
......@@ -563,7 +563,7 @@ void cgribexScanTimestep1(int streamID)
gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
ipunp, (int *) gribbuffer, recsize, &iword, "J", &iret);
param = cdiEncodeParam(255, ISEC1_CodeTable, ISEC1_Parameter);
param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
if ( ISEC1_LevelType == 99 ) ISEC1_LevelType = 100;
level1 = ISEC1_Level1;
......@@ -818,7 +818,7 @@ int cgribexScanTimestep2(int streamID)
gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
ipunp, (int *) gribbuffer, recsize, &iword, "J", &iret);
param = cdiEncodeParam(255, ISEC1_CodeTable, ISEC1_Parameter);
param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
if ( ISEC1_LevelType == 99 ) ISEC1_LevelType = 100;
level1 = ISEC1_Level1;
......@@ -1087,7 +1087,7 @@ int cgribexScanTimestep(int streamID)
gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
ipunp, (int *) gribbuffer, recsize, &iword, "J", &iret);
param = cdiEncodeParam(255, ISEC1_CodeTable, ISEC1_Parameter);
param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
if ( ISEC1_LevelType == 99 ) ISEC1_LevelType = 100;
level1 = ISEC1_Level1;
......@@ -1370,7 +1370,7 @@ void cgribexDefParam(int *isec1, int param)
int pdis, pcat, pnum;
static int lwarn = TRUE;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
if ( pdis != 255 && lwarn )
{
......@@ -1961,7 +1961,7 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
code = vlistInqVarCode(vlistID, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID, varID));
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(255, tabnum, code);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
cgribexDefaultSec0(isec0);
cgribexDefaultSec1(isec1);
......
......@@ -214,7 +214,7 @@ int extDefRecord(int streamID)
gridID = streamptr->record->gridID;
extp = streamptr->record->extp;
cdiDecodeParam(streamptr->record->param, &pdis, &pcat, &pnum);
cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
header[0] = streamptr->record->date;
header[1] = pnum;
header[2] = streamptr->record->level;
......@@ -399,7 +399,7 @@ void extScanTimestep1(int streamID)
rlevel = header[2];
rxysize = header[3];
param = cdiEncodeParam(255, 255, rcode);
param = cdiEncodeParam(rcode, 255, 255);
if ( nrecs == 0 )
{
......@@ -558,7 +558,7 @@ int extScanTimestep2(int streamID)
rlevel = header[2];
rxysize = header[3];
param = cdiEncodeParam(255, 255, rcode);
param = cdiEncodeParam(rcode, 255, 255);
if ( rindex == 0 )
{
......@@ -745,7 +745,7 @@ int extScanTimestep(int streamID)
rlevel = header[2];
rxysize = header[3];
param = cdiEncodeParam(255, 255, rcode);
param = cdiEncodeParam(rcode, 255, 255);
if ( rindex == nrecs ) break;
recID = streamptr->tsteps[tsID].recIDs[rindex];
......@@ -975,7 +975,7 @@ void extWriteVarDP(int streamID, int varID, const double *data)
if ( CDI_Debug )
Message(func, "nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pdis, &pcat, &pnum);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
header[0] = streamptr->tsteps[tsID].taxis.vdate;
header[1] = pnum;
......@@ -1025,7 +1025,7 @@ void extWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
if ( CDI_Debug )
Message(func, "gridID = %d zaxisID = %d", gridID, zaxisID);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pdis, &pcat, &pnum);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
header[0] = streamptr->tsteps[tsID].taxis.vdate;
header[1] = pnum;
......
......@@ -527,7 +527,7 @@ void gribapiAddRecord(int streamID, int param, grib_handle *gh,
{
int pdis, pcat, pnum;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
if ( pdis == 255 )
{
......@@ -648,7 +648,7 @@ void gribapiScanTimestep1(int streamID)
GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
rcode = (int) lpar;
param = cdiEncodeParam(255, rtabnum, rcode);
param = cdiEncodeParam(rcode, rtabnum, 255);
status = grib_get_long(gh, "indicatorOfTypeOfLevel", &lpar);
if ( status == 0 )
......@@ -681,7 +681,7 @@ void gribapiScanTimestep1(int streamID)
GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
pnum = (int) lpar;
param = cdiEncodeParam(pdis, pcat, pnum);
param = cdiEncodeParam(pnum, pcat, pdis);
status = grib_get_long(gh, "typeOfFirstFixedSurface", &lpar);
if ( status == 0 )
......@@ -975,7 +975,7 @@ int gribapiScanTimestep2(int streamID)
GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
rcode = (int) lpar;
param = cdiEncodeParam(255, rtabnum, rcode);
param = cdiEncodeParam(rcode, rtabnum, 255);
status = grib_get_long(gh, "indicatorOfTypeOfLevel", &lpar);
if ( status == 0 )
......@@ -1002,7 +1002,7 @@ int gribapiScanTimestep2(int streamID)
GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
pnum = (int) lpar;
param = cdiEncodeParam(pdis, pcat, pnum);
param = cdiEncodeParam(pnum, pcat, pdis);
status = grib_get_long(gh, "typeOfFirstFixedSurface", &lpar);
if ( status == 0 )
......@@ -1302,7 +1302,7 @@ int gribapiScanTimestep(int streamID)
GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
rcode = (int) lpar;
param = cdiEncodeParam(255, rtabnum, rcode);
param = cdiEncodeParam(rcode, rtabnum, 255);
status = grib_get_long(gh, "indicatorOfTypeOfLevel", &lpar);
if ( status == 0 )
......@@ -1329,7 +1329,7 @@ int gribapiScanTimestep(int streamID)
GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
pnum = (int) lpar;
param = cdiEncodeParam(pdis, pcat, pnum);
param = cdiEncodeParam(pnum, pcat, pdis);
status = grib_get_long(gh, "typeOfFirstFixedSurface", &lpar);
if ( status == 0 )
......@@ -1618,7 +1618,7 @@ void gribapiDefParam(grib_handle *gh, int param)
{
int pdis, pcat, pnum;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
//ISEC1_CodeTable = codetable;
if ( pnum < 0 ) pnum = -pnum;
......@@ -2051,7 +2051,7 @@ void gribHandleDelete(void *gh)
#endif
}
//#define GRIBAPIENCODETEST 1
/* #define GRIBAPIENCODETEST 1 */
size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID, int date, int time, int numavg,
long datasize, const double *data, int nmiss, unsigned char *gribbuffer, size_t gribbuffersize,
......@@ -2075,7 +2075,7 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
tabnum = tableInqNum(vlistInqVarTable(vlistID, varID));
datatype = vlistInqVarDatatype(vlistID, varID);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(255, tabnum, code);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
#if defined(GRIBAPIENCODETEST)
gh = (grib_handle *) gribHandleNew();
#else
......
......@@ -569,7 +569,7 @@ int iegDefRecord(int streamID)
iegp->byteswap = getByteswap(byteorder);
param = vlistInqVarParam(vlistID, varID);
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
IEG_P_Parameter(iegp->ipdb) = pnum;
if ( pdis == 255 ) IEG_P_CodeTable(iegp->ipdb) = pcat;
date = streamptr->tsteps[tsID].taxis.vdate;
......@@ -879,7 +879,7 @@ void iegScanTimestep1(int streamID)
prec = iegp->dprec;
rcode = IEG_P_Parameter(iegp->ipdb);
tabnum = IEG_P_CodeTable(iegp->ipdb);
param = cdiEncodeParam(255, tabnum, rcode);
param = cdiEncodeParam(rcode, tabnum, 255);
if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
rlevel = IEG_P_Level1(iegp->ipdb);
......@@ -1040,7 +1040,7 @@ int iegScanTimestep2(int streamID)
rcode = IEG_P_Parameter(iegp->ipdb);
tabnum = IEG_P_CodeTable(iegp->ipdb);
param = cdiEncodeParam(255, tabnum, rcode);
param = cdiEncodeParam(rcode, tabnum, 255);
if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
rlevel = IEG_P_Level1(iegp->ipdb);
......@@ -1229,7 +1229,7 @@ int iegScanTimestep(int streamID)
rcode = IEG_P_Parameter(iegp->ipdb);
tabnum = IEG_P_CodeTable(iegp->ipdb);
param = cdiEncodeParam(255, tabnum, rcode);
param = cdiEncodeParam(rcode, tabnum, 255);
if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
rlevel = IEG_P_Level1(iegp->ipdb);
......@@ -1469,7 +1469,7 @@ void iegWriteVarDP(int streamID, int varID, const double *data)
Message(func, "nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
param = vlistInqVarParam(vlistID, varID);
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
IEG_P_Parameter(iegp->ipdb) = pnum;
if ( pdis == 255 ) IEG_P_CodeTable(iegp->ipdb) = pcat;
date = streamptr->tsteps[tsID].taxis.vdate;
......
......@@ -215,7 +215,7 @@ int srvDefRecord(int streamID)
gridID = streamptr->record->gridID;
srvp = streamptr->record->srvp;
cdiDecodeParam(streamptr->record->param, &pdis, &pcat, &pnum);
cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
header[0] = pnum;
header[1] = streamptr->record->level;
header[2] = streamptr->record->date;
......@@ -418,7 +418,7 @@ void srvScanTimestep1(int streamID)
rxsize = header[4];
rysize = header[5];
param = cdiEncodeParam(255, 255, rcode);
param = cdiEncodeParam(rcode, 255, 255);
if ( nrecs == 0 )
{
......@@ -575,7 +575,7 @@ int srvScanTimestep2(int streamID)
vdate = header[2];
vtime = header[3];
param = cdiEncodeParam(255, 255, rcode);
param = cdiEncodeParam(rcode, 255, 255);
if ( rindex == 0 )
{
......@@ -763,7 +763,7 @@ int srvScanTimestep(int streamID)
rxsize = header[4];
rysize = header[5];
param = cdiEncodeParam(255, 255, rcode);
param = cdiEncodeParam(rcode, 255, 255);
if ( rindex == nrecs ) break;
recID = streamptr->tsteps[tsID].recIDs[rindex];
......@@ -994,7 +994,7 @@ void srvWriteVarDP(int streamID, int varID, const double *data)
if ( CDI_Debug )
Message(func, "nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pdis, &pcat, &pnum);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
header[0] = pnum;
header[2] = streamptr->tsteps[tsID].taxis.vdate;
......@@ -1061,7 +1061,7 @@ void srvWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
if ( CDI_Debug )
Message(func, "gridID = %d zaxisID = %d", gridID, zaxisID);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pdis, &pcat, &pnum);
cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
header[0] = pnum;
header[1] = (int) level;
......
......@@ -459,7 +459,7 @@ void cdiGenVars(int streamID)
if ( cdiDefaultTableID != UNDEFID )
{
int pdis, pcat, pnum;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
if ( tableInqParNamePtr(cdiDefaultTableID, pnum) )
{
if ( tableID != UNDEFID )
......
......@@ -234,7 +234,7 @@ int vlistDefVar(int vlistID, int gridID, int zaxisID, int timeID)
vlistptr->nzaxis++;
}
vlistptr->vars[varID].param = cdiEncodeParam(255, 255, -(varID + 1));
vlistptr->vars[varID].param = cdiEncodeParam(-(varID + 1), 255, 255);
return (varID);
}
......@@ -292,7 +292,7 @@ void vlistDefVarCode(int vlistID, int varID, int code)
vlistCheckVarID(func, vlistID, varID);
vlistptr->vars[varID].param = cdiEncodeParam(255, 255, code);
vlistptr->vars[varID].param = cdiEncodeParam(code, 255, 255);
}
......@@ -447,7 +447,7 @@ int vlistInqVarCode(int vlistID, int varID)
vlistCheckVarID(func, vlistID, varID);
param = vlistptr->vars[varID].param;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
code = pnum;
if ( code < 0 && vlistptr->vars[varID].tableID != -1 && vlistptr->vars[varID].name != NULL )
......@@ -541,7 +541,7 @@ void vlistInqVarName(int vlistID, int varID, char *name)
if ( vlistptr->vars[varID].name == NULL )
{
param = vlistptr->vars[varID].param;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
code = pnum;
tableID = vlistptr->vars[varID].tableID;
if ( tableInqParName(tableID, code, name) != 0 )
......@@ -587,7 +587,7 @@ void vlistInqVarLongname(int vlistID, int varID, char *longname)
if ( vlistptr->vars[varID].longname == NULL )
{
param = vlistptr->vars[varID].param;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
code = pnum;
tableID = vlistptr->vars[varID].tableID;
if ( tableInqParLongname(tableID, code, longname) != 0 )
......@@ -671,7 +671,7 @@ void vlistInqVarUnits(int vlistID, int varID, char *units)
if ( vlistptr->vars[varID].units == NULL )
{
param = vlistptr->vars[varID].param;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
code = pnum;
tableID = vlistptr->vars[varID].tableID;
if ( tableInqParUnits(tableID, code, units) != 0 )
......@@ -695,7 +695,7 @@ int vlistInqVarID(int vlistID, int code)
for ( varID = 0; varID < vlistptr->nvars; varID++ )
{
param = vlistptr->vars[varID].param;
cdiDecodeParam(param, &pdis, &pcat, &pnum);
cdiDecodeParam(param, &pnum, &pcat, &pdis);
if ( pnum == code ) break;
}
......
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