Commit 7716e2e6 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

remove CDI_UNDEFPARAM

parent f25298a3
......@@ -220,7 +220,7 @@ void printShortinfo(int streamID, int vlistID, int vardis)
{
int varID;
int gridsize = 0;
int gridID, zaxisID, code, tabnum, param;
int gridID, zaxisID, param;
int zaxistype, ltype;
int vdate, vtime;
int nrecs, nvars, nzaxis, ntsteps;
......@@ -254,12 +254,9 @@ void printShortinfo(int streamID, int vlistID, int vardis)
for ( varID = 0; varID < nvars; varID++ )
{
param = vlistInqVarParam(vlistID, varID);
code = vlistInqVarCode(vlistID, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID, varID));
gridID = vlistInqVarGrid(vlistID, varID);
zaxisID = vlistInqVarZaxis(vlistID, varID);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
cdiParamToString(param, paramstr, sizeof(paramstr));
if ( vardis ) vlistInqVarName(vlistID, varID, varname);
......@@ -772,7 +769,7 @@ int main(int argc, char *argv[])
int streamID2 = CDI_UNDEFID;
int filetype;
int gridID, zaxisID;
int code, tabnum, param;
int param;
int vdate, vtime;
int nrecs, nvars;
int levelID, levelsize;
......@@ -890,10 +887,7 @@ int main(int argc, char *argv[])
gridID = vlistInqVarGrid(vlistID1, varID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
param = vlistInqVarParam(vlistID1, varID);
code = vlistInqVarCode(vlistID1, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID1, varID));
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
cdiParamToString(param, paramstr, sizeof(paramstr));
if ( Vardis ) vlistInqVarName(vlistID1, varID, varname);
......@@ -930,10 +924,7 @@ int main(int argc, char *argv[])
gridID = vlistInqVarGrid(vlistID1, varID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
param = vlistInqVarParam(vlistID1, varID);
code = vlistInqVarCode(vlistID1, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID1, varID));
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
cdiParamToString(param, paramstr, sizeof(paramstr));
if ( Vardis ) vlistInqVarName(vlistID1, varID, varname);
......
......@@ -9,7 +9,6 @@ extern "C" {
#define CDI_UNDEFID -1
#define CDI_GLOBAL -1 /* Global var ID for vlist */
#define CDI_UNDEFPARAM 2147483647
/* Byte order */
......
......@@ -1443,7 +1443,7 @@ void cgribexDefModel(int *isec1, int vlistID, int varID)
}
static
void cgribexDefParam(int *isec1, int param, int tabnum)
void cgribexDefParam(int *isec1, int param)
{
static char func[] = "cgribexDefParam";
int pdis, pcat, pnum;
......@@ -1461,8 +1461,6 @@ void cgribexDefParam(int *isec1, int param, int tabnum)
if ( pnum < 0 ) pnum = -pnum;
if ( pcat == 255 ) pcat = tabnum;
ISEC1_CodeTable = pcat;
ISEC1_Parameter = pnum;
}
......@@ -2033,7 +2031,6 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
int isec0[2], isec1[4096], isec2[4096], isec3[2], isec4[512];
double fsec2[512], fsec3[2];
int datatype;
int code, tabnum;
int param;
memset(isec1, 0, 32*sizeof(int));
......@@ -2041,10 +2038,6 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
gribsize = gribbuffersize / sizeof(int);
param = vlistInqVarParam(vlistID, varID);
code = vlistInqVarCode(vlistID, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID, varID));
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
cgribexDefaultSec0(isec0);
cgribexDefaultSec1(isec1);
......@@ -2055,7 +2048,7 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
datatype = vlistInqVarDatatype(vlistID, varID);
cgribexDefParam(isec1, param, tabnum);
cgribexDefParam(isec1, param);
cgribexDefTime(isec1, date, time, numavg, vlistInqTaxis(vlistID));
cgribexDefGrid(isec1, isec2, gridID);
cgribexDefLevel(isec1, isec2, fsec2, zaxisID, levelID);
......
......@@ -2080,18 +2080,14 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
void *dummy = NULL;
long edition = 2;
int datatype;
int code, tabnum;
int param;
long bitsPerValue;
grib_handle *gh = NULL;
// extern unsigned char _grib_template_GRIB2[];
param = vlistInqVarParam(vlistID, varID);
code = vlistInqVarCode(vlistID, varID);
tabnum = tableInqNum(vlistInqVarTable(vlistID, varID));
datatype = vlistInqVarDatatype(vlistID, varID);
if ( param == CDI_UNDEFPARAM ) param = cdiEncodeParam(code, tabnum, 255);
#if defined(GRIBAPIENCODETEST)
gh = (grib_handle *) gribHandleNew();
#else
......
......@@ -21,7 +21,7 @@ void recordInitEntry(record_t *record)
{
(*record).position = CDI_UNDEFID;
(*record).size = 0;
(*record).param = CDI_UNDEFPARAM;
(*record).param = 0;
(*record).ilevel = CDI_UNDEFID;
(*record).used = FALSE;
(*record).varID = CDI_UNDEFID;
......@@ -111,7 +111,7 @@ void cdiInitRecord(int streamID)
streamptr->record->used = 0;
streamptr->record->nrec = 0;
streamptr->record->dataread = 1;
streamptr->record->param = CDI_UNDEFPARAM;
streamptr->record->param = 0;
streamptr->record->level = 0;
streamptr->record->date = 0;
streamptr->record->time = 0;
......
......@@ -19,7 +19,7 @@ static void vlistvarInitEntry(int vlistID, int varID)
vlistptr->vars[varID].fvarID = varID;
vlistptr->vars[varID].mvarID = varID;
vlistptr->vars[varID].flag = 0;
vlistptr->vars[varID].param = CDI_UNDEFPARAM;
vlistptr->vars[varID].param = 0;
vlistptr->vars[varID].timeID = CDI_UNDEFID;
vlistptr->vars[varID].datatype = CDI_UNDEFID;
vlistptr->vars[varID].timave = 0;
......
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