Commit 6a2bfc2a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Set default of tileindex to 0 (bug fix).

parent e8d41cde
......@@ -380,7 +380,7 @@ void gribGetLevel(grib_handle *gh, int* leveltype1, int* leveltype2, int* lbound
grib2GetLevel(gh, leveltype1, leveltype2, lbounds, level1, level2, level_sf, level_unit);
/* read in tiles attributes (if there are any) */
tiles->tileindex = (int)gribGetLongDefault(gh, cdiSubtypeAttributeName[SUBTYPE_ATT_TILEINDEX], -1);
tiles->tileindex = (int)gribGetLongDefault(gh, cdiSubtypeAttributeName[SUBTYPE_ATT_TILEINDEX], 0);
tiles->totalno_of_tileattr_pairs = (int)gribGetLongDefault(gh, cdiSubtypeAttributeName[SUBTYPE_ATT_TOTALNO_OF_TILEATTR_PAIRS], -1);
tiles->tileClassification = (int)gribGetLongDefault(gh, cdiSubtypeAttributeName[SUBTYPE_ATT_TILE_CLASSIFICATION], -1);
tiles->numberOfTiles = (int)gribGetLongDefault(gh, cdiSubtypeAttributeName[SUBTYPE_ATT_NUMBER_OF_TILES], -1);
......@@ -1041,11 +1041,10 @@ int gribapiScanTimestep1(stream_t * streamptr)
char paramstr[32];
cdiParamToString(param, paramstr, sizeof(paramstr));
Message("%4u %8d name=%s id=%s ltype=%d lev1=%d lev2=%d vdate=%lld vtime=%d",
nrecs, (int)recpos, varname, paramstr, leveltype1, level1, level2, vdate, vtime);
nrecs, (int)recpos, varname, paramstr, leveltype1, level1, level2, vdate, vtime);
}
var_tile_t *ptiles = NULL;
if ( memcmp(&tiles, &dummy_tiles, sizeof(var_tile_t)) != 0 ) ptiles = &tiles;
var_tile_t *ptiles = memcmp(&tiles, &dummy_tiles, sizeof(var_tile_t)) ? &tiles : NULL;
gribapiAddRecord(streamptr, param, gh, recsize, recpos, datatype, comptype, varname,
leveltype1, leveltype2, lbounds, level1, level2, level_sf, level_unit, ptiles, perturbationNumber, 1);
......
......@@ -133,8 +133,7 @@ varGetEntry(int param, int gridID, int zaxistype, int ltype1, int tsteptype, con
{
for ( unsigned varID = 0; varID < varTablesize; varID++ )
{
/* testing for "param" implicitly checks if we are beyond the
* current vartable size: */
/* testing for "param" implicitly checks if we are beyond the current vartable size: */
if ( vartable[varID].param == param )
{
int no_of_tiles = -1;
......
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