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