Project

General

Profile

Reading Seasonal Grib Data from Global Wildfire fails

Added by Chris Barnard 9 months ago

cdo infov 20170101_12.grib
ECCODES ERROR : Invalid unit: -1 (Unit not found _Map_base::at). Available units are: s,m,15m,30m,h,3h,6h,12h,D,M,Y,10Y,30Y,C
!!! failed call to grib_set_long( grib_handle* h, "stepUnits", -1) !!!
/etc/ecmwf/ssd/ssd1/tmpdirs/deploy.36546842/eci-builds/cdo-2.3.0-build-GNU8.5/cdo-2.3.0/libcdi/src/stream_gribapi.c at line 91: my_grib_set_long(gh, "stepUnits", unitsOfTime) failed: Invalid argument

The stepUnits is set in the grib file so not sure why CDO is attempting to grib_set this value?

grib_dump 20170101_12.grib | grep step # Hour (stepUnits.table)
stepUnits = 1;


Replies (2)

RE: Reading Seasonal Grib Data from Global Wildfire fails - Added by Chris Barnard 9 months ago

https://github.com/AZed/cdo/blob/214cb1461beba2dba9848e393427d34f403caec4/libcdi/src/stream_gribapi.c#L177

int gribapiGetTimeUnits(grib_handle *gh) {
int timeunits = -1;
long unitsOfTime = -1;
grib_get_long(gh, "indicatorOfUnitOfTimeRange", &unitsOfTime);
GRIB_CHECK(my_grib_set_long(gh, "stepUnits", unitsOfTime), 0);
timeunits = getTimeunits(unitsOfTime);
return (timeunits);
}

The Template used for this product does not contain indicatorOfUnitOfTimeRange as it is using a local time template.
So it retrieves -1 and -1 attempts to be set into the grib file. But it should not.

RE: Reading Seasonal Grib Data from Global Wildfire fails - Added by Uwe Schulzweida 9 months ago

Thanks for this report! We will fix the problem in the next CDO release.

    (1-2/2)