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

Fix brocken ECHAM5 modelIDs.

parent 42dc299f
2018-02-03 Uwe Schulzweida
* Fix brocken ECHAM5 modelIDs (introduced in 1.9.3)
2018-01-31 Uwe Schulzweida
* Fix GRIB_API AEC compression for unstructured grids
......
......@@ -328,10 +328,9 @@ int instituteUnpack(void *buf, int size, int *position, int originNamespace,
{
int tempbuf[institute_nints];
int instituteID;
char *name, *longname;
serializeUnpack(buf, size, position, tempbuf, institute_nints, CDI_DATATYPE_INT, context);
name = (char *) Malloc((size_t)tempbuf[3] + (size_t)tempbuf[4]);
longname = name + tempbuf[3];
char *name = (char *) Malloc((size_t)tempbuf[3] + (size_t)tempbuf[4]);
char *longname = name + tempbuf[3];
serializeUnpack(buf, size, position, name, tempbuf[3], CDI_DATATYPE_TXT, context);
serializeUnpack(buf, size, position, longname, tempbuf[4], CDI_DATATYPE_TXT, context);
int targetID = namespaceAdaptKey(tempbuf[0], originNamespace);
......
......@@ -66,9 +66,7 @@ void modelDefaultValue ( model_t *modelptr )
static model_t *
modelNewEntry(cdiResH resH, int instID, int modelgribID, const char *name)
{
model_t *modelptr;
modelptr = (model_t *) Malloc(sizeof(model_t));
model_t *modelptr = (model_t *) Malloc(sizeof(model_t));
modelDefaultValue ( modelptr );
if (resH == CDI_UNDEFID)
modelptr->self = reshPut(modelptr, &modelOps);
......@@ -87,14 +85,14 @@ modelNewEntry(cdiResH resH, int instID, int modelgribID, const char *name)
void modelDefaultEntries ( void )
{
int instID, i;
int instID;
enum { nDefModels = 10 };
cdiResH resH[nDefModels];
instID = institutInq( 0, 0, "ECMWF", NULL);
/* (void) modelDef(instID, 131, "ERA15"); */
/* (void) modelDef(instID, 199, "ERA40"); */
instID = institutInq( 0, 0, "MPIMET", NULL);
instID = institutInq( 98, 232, "MPIMET", NULL);
resH[0] = ECHAM5 = modelDef(instID, 64, "ECHAM5.4");
resH[1] = modelDef(instID, 63, "ECHAM5.3");
......@@ -117,18 +115,18 @@ void modelDefaultEntries ( void )
resH[9] = modelDef(instID, 80, "T62L28MRF");
/* pre-defined models are not synchronized */
for ( i = 0; i < nDefModels ; i++ )
for ( int i = 0; i < nDefModels ; i++ )
reshSetStatus(resH[i], &modelOps, RESH_IN_USE);
}
static
void modelInit(void)
{
static int modelInitialized = 0;
static bool modelInitialized = false;
if (modelInitialized) return;
modelInitialized = 1;
modelInitialized = true;
char *env = getenv("MODEL_DEBUG");
if ( env ) MODEL_Debug = atoi(env);
}
......
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