Commit 4aa56e7b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replaced vlistDefVarProductDefinitionTemplate() by cdiDefKeyInt().

parent bbec24d0
......@@ -2,6 +2,11 @@
* Version 1.9.3 released
2018-01-05 Uwe Schulzweida
* Replaced vlistDefVarProductDefinitionTemplate() by cdiDefKeyInt().
* Replaced vlistDefVarTypeOfGeneratingProcess() by cdiDefKeyInt().
2018-01-04 Uwe Schulzweida
* GRIB2: use typeOfSecondFixedSurface if present
......
......@@ -665,9 +665,6 @@ int vlistInqVarTimave(int vlistID, int varID);
void vlistDefVarTimaccu(int vlistID, int varID, int timaccu);
int vlistInqVarTimaccu(int vlistID, int varID);
void vlistDefVarProductDefinitionTemplate(int vlistID, int varID, int productDefinitionTemplate);
int vlistInqVarProductDefinitionTemplate(int vlistID, int varID);
size_t vlistInqVarSize(int vlistID, int varID);
void vlistDefIndex(int vlistID, int varID, int levID, int index);
......@@ -807,9 +804,10 @@ int gridInqYIsc(int gridID);
size_t gridInqYCvals(int gridID, char *ycvals[]);
// CDI var key values
#define CDI_KEY_TABLESVERSION 801 // GRIB2 tablesVersion
#define CDI_KEY_LOCALTABLESVERSION 802 // GRIB2 localTablesVersion
#define CDI_KEY_TYPEOFGENERATINGPROCESS 803 // GRIB2 typeOfGeneratingProcess
#define CDI_KEY_TABLESVERSION 801 // GRIB2 tablesVersion
#define CDI_KEY_LOCALTABLESVERSION 802 // GRIB2 localTablesVersion
#define CDI_KEY_TYPEOFGENERATINGPROCESS 803 // GRIB2 typeOfGeneratingProcess
#define CDI_KEY_PRODUCTDEFINITIONTEMPLATE 804 // GRIB2 productDefinitionTemplate
// cdiDefKeyInt: Define a CDI varianble integer value from a key
int cdiDefKeyInt(int cdiID, int varID, int key, int value);
......
......@@ -1259,17 +1259,6 @@
! INTEGER varID)
EXTERNAL vlistInqVarTimaccu
! vlistDefVarProductDefinitionTemplate
! (INTEGER vlistID,
! INTEGER varID,
! INTEGER productDefinitionTemplate)
EXTERNAL vlistDefVarProductDefinitionTemplate
INTEGER vlistInqVarProductDefinitionTemplate
! (INTEGER vlistID,
! INTEGER varID)
EXTERNAL vlistInqVarProductDefinitionTemplate
INTEGER vlistInqVarSize
! (INTEGER vlistID,
! INTEGER varID)
......@@ -1598,6 +1587,8 @@
PARAMETER (CDI_KEY_LOCALTABLESVERSION = 802)
INTEGER CDI_KEY_TYPEOFGENERATINGPROCESS
PARAMETER (CDI_KEY_TYPEOFGENERATINGPROCESS = 803)
INTEGER CDI_KEY_PRODUCTDEFINITIONTEMPLATE
PARAMETER (CDI_KEY_PRODUCTDEFINITIONTEMPLATE = 804)
INTEGER cdiDefKeyInt
! (INTEGER cdiID,
! INTEGER varID,
......
......@@ -362,8 +362,6 @@ FCALLSCSUB3 (vlistDefVarTimave, VLISTDEFVARTIMAVE, vlistdefvartimave, INT, INT,
FCALLSCFUN2 (INT, vlistInqVarTimave, VLISTINQVARTIMAVE, vlistinqvartimave, INT, INT)
FCALLSCSUB3 (vlistDefVarTimaccu, VLISTDEFVARTIMACCU, vlistdefvartimaccu, INT, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarTimaccu, VLISTINQVARTIMACCU, vlistinqvartimaccu, INT, INT)
FCALLSCSUB3 (vlistDefVarProductDefinitionTemplate, VLISTDEFVARPRODUCTDEFINITIONTEMPLATE, vlistdefvarproductdefinitiontemplate, INT, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarProductDefinitionTemplate, VLISTINQVARPRODUCTDEFINITIONTEMPLATE, vlistinqvarproductdefinitiontemplate, INT, INT)
static int vlistInqVarSize_fwrap(int vlistID, int varID)
{
size_t v;
......
......@@ -588,7 +588,7 @@ void gribapiAddRecord(stream_t *streamptr, int param, grib_handle *gh,
long productDefinitionTemplate = 0;
if ( grib_get_long(gh, "productDefinitionTemplateNumber", &productDefinitionTemplate) == 0 )
varDefProductDefinitionTemplate(varID, (int) productDefinitionTemplate);
varDefKeyInt(varID, CDI_KEY_PRODUCTDEFINITIONTEMPLATE, (int) productDefinitionTemplate);
if (lread_additional_keys)
{
......@@ -3001,7 +3001,8 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
int datatype = vlistInqVarDatatype(vlistID, varID);
int typeOfGeneratingProcess = 0;
cdiInqKeyInt(vlistID, varID, CDI_KEY_TYPEOFGENERATINGPROCESS, &typeOfGeneratingProcess);
int productDefinitionTemplate = vlistInqVarProductDefinitionTemplate(vlistID, varID);
int productDefinitionTemplate = 0;
cdiInqKeyInt(vlistID, varID, CDI_KEY_PRODUCTDEFINITIONTEMPLATE, &productDefinitionTemplate);
char name[256];
char stdname[256];
......
......@@ -76,7 +76,6 @@ typedef struct
char *longname;
char *units;
ensinfo_t *ensdata;
int productDefinitionTemplate;
/* meta-data for specification of tiles (currently only GRIB-API: */
subtype_t *tiles;
......@@ -122,7 +121,6 @@ void paramInitEntry(unsigned varID, int param)
vartable[varID].instID = CDI_UNDEFID;
vartable[varID].modelID = CDI_UNDEFID;
vartable[varID].tableID = CDI_UNDEFID;
vartable[varID].productDefinitionTemplate = CDI_UNDEFID;
vartable[varID].nikeys = 0;
for ( int i = 0; i < MAX_KEYS; ++i ) vartable[varID].ikeyvalues[i].value = 0;
vartable[varID].comptype = CDI_COMPRESS_NONE;
......@@ -1113,12 +1111,6 @@ void varDefEnsembleInfo(int varID, int ens_idx, int ens_count, int forecast_type
}
void varDefProductDefinitionTemplate(int varID, int productDefinitionTemplate)
{
vartable[varID].productDefinitionTemplate = productDefinitionTemplate;
}
void varDefKeyInt(int varID, int key, int value)
{
if ( vartable[varID].nikeys < MAX_KEYS )
......
......@@ -30,8 +30,6 @@ void varDefTable(int varID, int tableID);
int varInqTable(int varID);
void varDefEnsembleInfo(int varID, int ens_idx, int ens_count, int forecast_type);
void varDefProductDefinitionTemplate(int varID, int productDefinitionTemplate);
void varDefKeyInt(int varID, int key, int value);
void varDefOptGribInt(int varID, int tile_index, long lval, const char *keyword);
......
......@@ -63,7 +63,6 @@ typedef struct
int tableID;
int timave;
int timaccu;
int productDefinitionTemplate;
int chunktype;
int xyz;
bool missvalused; // true if missval is defined
......
......@@ -34,7 +34,6 @@ void vlistvarInitEntry(int vlistID, int varID)
vlistptr->vars[varID].tsteptype = TSTEP_INSTANT;
vlistptr->vars[varID].timave = 0;
vlistptr->vars[varID].timaccu = 0;
vlistptr->vars[varID].productDefinitionTemplate = -1;
vlistptr->vars[varID].chunktype = cdiChunkType;
vlistptr->vars[varID].xyz = 321;
vlistptr->vars[varID].gridID = CDI_UNDEFID;
......@@ -1282,24 +1281,6 @@ int vlistInqVarTimaccu(int vlistID, int varID)
}
void vlistDefVarProductDefinitionTemplate(int vlistID, int varID, int productDefinitionTemplate)
{
vlist_t *vlistptr = vlist_to_pointer(vlistID);
if (vlistptr->vars[varID].productDefinitionTemplate != productDefinitionTemplate)
{
vlistptr->vars[varID].productDefinitionTemplate = productDefinitionTemplate;
reshSetStatus(vlistID, &vlistOps, RESH_DESYNC_IN_USE);
}
}
int vlistInqVarProductDefinitionTemplate(int vlistID, int varID)
{
vlist_t *vlistptr = vlist_to_pointer(vlistID);
return vlistptr->vars[varID].productDefinitionTemplate;
}
void vlistDestroyVarName(int vlistID, int varID)
{
vlist_t *vlistptr = vlist_to_pointer(vlistID);
......
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