Commit 9366b03e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

setcodetab: added support for GRIB level type.

parent 4004a0b7
......@@ -3,6 +3,10 @@
* Using CDI library version 1.9.0
* Version 1.9.0 release
2017-07-01 Uwe Schulzweida
setcodetab: added support for GRIB level type
2017-06-28 Uwe Schulzweida
* expr: improve ternary operator, no brackets needed anymore.
......
......@@ -1214,8 +1214,7 @@ void after_setCodes(struct Control *globs, struct Variable *vars, int maxCodes,
vlistInqVarLongname(globs->ivlistID, varID, longname);
}
if ( !name[0] ) tableInqParName(tableID, code, name);
if ( !longname[0] ) tableInqParLongname(tableID, code, longname);
if ( !name[0] ) tableInqEntry(tableID, code, -1, name, longname, NULL);
if ( globs->Verbose )
{
......@@ -1973,18 +1972,18 @@ void after_printCodes(void)
int code = codes[i];
char name[CDI_MAX_NAME]; name[0] = 0;
char longname[CDI_MAX_NAME]; longname[0] = 0;
tableInqParName(tableID, code, name);
tableInqParLongname(tableID, code, longname);
tableInqEntry(tableID, code, -1, name, longname, NULL);
fprintf(stdout, " %4d", code);
if ( !name[0] )
fprintf(stdout, " var%d", code);
else
if ( name[0] )
{
fprintf(stdout, " %-16s", name);
if ( longname[0] )
fprintf(stdout, " %s", longname);
}
else
fprintf(stdout, " var%d", code);
fprintf(stdout, "\n");
}
......
......@@ -398,15 +398,16 @@ void *Setpartab(void *argument)
if ( pdis == 255 )
{
int code = pnum;
if ( tableInqParName(tableID, code, name) == 0 )
int ltype = zaxisInqLtype(vlistInqVarZaxis(vlistID2, varID));
name[0] = 0;
longname[0] = 0;
units[0] = 0;
tableInqEntry(tableID, code, ltype, name, longname, units);
if ( name[0] )
{
vlistDefVarName(vlistID2, varID, name);
longname[0] = 0;
tableInqParLongname(tableID, code, longname);
vlistDefVarLongname(vlistID2, varID, longname);
units[0] = 0;
tableInqParUnits(tableID, code, units);
vlistDefVarUnits(vlistID2, varID, units);
if ( longname[0] ) vlistDefVarLongname(vlistID2, varID, longname);
if ( units[0] ) vlistDefVarUnits(vlistID2, varID, units);
}
}
vlistDefVarTable(vlistID2, varID, tableID);
......
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