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

stream_gribapi: check stepType

parent 391c529d
......@@ -171,23 +171,27 @@ int gribapiGetTsteptype(grib_handle *gh)
if ( gribapiTimeIsFC(gh) )
{
GRIB_CHECK(grib_get_long(gh, "stepType", &lpar), 0);
timerange = (int) lpar;
int status;
status = grib_get_long(gh, "stepType", &lpar);
if ( status == 0 )
{
timerange = (int) lpar;
// printf("timerange %d\n", timerange);
// printf("timerange %d\n", timerange);
switch ( timerange )
{
case 0: tsteptype = TSTEP_AVG; break;
case 1: tsteptype = TSTEP_ACCUM; break;
case 2: tsteptype = TSTEP_MIN; break;
case 3: tsteptype = TSTEP_MAX; break;
case 4: tsteptype = TSTEP_DIFF; break;
default:
if ( lprint )
switch ( timerange )
{
Message("Time range %d unsupported", timerange);
lprint = FALSE;
case 0: tsteptype = TSTEP_AVG; break;
case 1: tsteptype = TSTEP_ACCUM; break;
case 2: tsteptype = TSTEP_MIN; break;
case 3: tsteptype = TSTEP_MAX; break;
case 4: tsteptype = TSTEP_DIFF; break;
default:
if ( lprint )
{
Message("Time range %d unsupported", timerange);
lprint = FALSE;
}
}
}
}
......
Supports Markdown
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