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

Added support gpt GRIB2 key typeOfTimeIncrement.

parent 51b038e6
2019-11-01 Uwe Schulzweida
* Added support gpt GRIB2 key typeOfTimeIncrement
2019-10-29 Uwe Schulzweida
* using CGRIBEX library version 1.9.4
......@@ -9,7 +13,7 @@
2019-10-11 Uwe Schulzweida
* gribapi: use forecast reference time
* gribapi: use forecast reference time
* gribapi: added support for seconds
2019-09-09 Uwe Schulzweida
......
......@@ -804,6 +804,7 @@ size_t gridInqYCvals(int gridID, char *ycvals[]);
#define CDI_KEY_SECTION2PADDING 820 // GRIB2 section2Padding
#define CDI_KEY_UVRELATIVETOGRID 821 // GRIB uvRelativeToGrid
#define CDI_KEY_CONSTITUENTTYPE 822 // GRIB2 constituentType
#define CDI_KEY_TYPEOFTIMEINCREMENT 823 // GRIB2 typeOfTimeIncrement
// cdiDefKeyInt: Define an integer value from a key of a CDI variable
int cdiDefKeyInt(int cdiID, int varID, int key, int value);
......
......@@ -481,6 +481,10 @@ void gribapiGetKeys(grib_handle *gh, int varID)
long backgroundProcess = 0;
if ( grib_get_long(gh, "backgroundProcess", &backgroundProcess) == 0 )
varDefKeyInt(varID, CDI_KEY_BACKGROUNDPROCESS, (int) backgroundProcess);
long typeOfTimeIncrement = 0;
if ( grib_get_long(gh, "typeOfTimeIncrement", &typeOfTimeIncrement) == 0 )
varDefKeyInt(varID, CDI_KEY_TYPEOFTIMEINCREMENT, (int) typeOfTimeIncrement);
/*
long constituentType = 0;
if ( grib_get_long(gh, "constituentType", &constituentType) == 0 )
......@@ -3081,6 +3085,12 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
gribapiDefTime((int)editionNumber, productDefinitionTemplate, typeOfGeneratingProcess,
gh, vdate, vtime, tsteptype, numavg, vlistInqTaxis(vlistID), gc->init);
{
int typeOfTimeIncrement = 0;
int status = cdiInqKeyInt(vlistID, varID, CDI_KEY_TYPEOFTIMEINCREMENT, &typeOfTimeIncrement);
if ( status == 0 ) GRIB_CHECK(my_grib_set_long(gh, "typeOfTimeIncrement", (long)typeOfTimeIncrement), 0);
}
{
int status, perturbationNumber, numberOfForecastsInEnsemble, typeOfEnsembleForecast;
status = cdiInqKeyInt(vlistID, varID, CDI_KEY_TYPEOFENSEMBLEFORECAST, &typeOfEnsembleForecast);
......
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