What happened?
eccodes sets scaledValueOf*FixedSurface to be unsigned[4]. See https://github.com/ecmwf/eccodes/blob/develop/definitions/grib2/templates/template.4.horizontal.def#L12 . This is generally fine, but it does not cover all use cases. Potential vorticity levels in the southern hemisphere are negative. If you try to do grib_set -s typeOfFirstFixedSurface=109,scaledValueOfFirstFixedSurface=-2 file, it will fail because the level value is negative.
Could you please allow negative values for the scaledValueOf*FixedSurface metadata items as it is quite reasonable to have negative levels.
What are the steps to reproduce the bug?
grib_set -s typeOfFirstFixedSurface=109,scaledValueOfFirstFixedSurface=-2 file
Version
All
Platform (OS and architecture)
Linux
Relevant log output
$ grib_set -s typeOfFirstFixedSurface=109,scaledValueOfFirstFixedSurface=-2 z.54.grb2 z.54.grb22
ECCODES ERROR : Key "scaledValueOfFirstFixedSurface": Trying to encode a negative value of -2 for key of type unsigned
ECCODES ERROR : grib_set_values[1] scaledValueOfFirstFixedSurface (type=long) failed: Encoding invalid (message 1)
Accompanying data
No response
Organisation
Bureau of Meteorology
What happened?
eccodes sets scaledValueOf*FixedSurface to be
unsigned[4]. See https://github.com/ecmwf/eccodes/blob/develop/definitions/grib2/templates/template.4.horizontal.def#L12 . This is generally fine, but it does not cover all use cases. Potential vorticity levels in the southern hemisphere are negative. If you try to dogrib_set -s typeOfFirstFixedSurface=109,scaledValueOfFirstFixedSurface=-2 file, it will fail because the level value is negative.Could you please allow negative values for the scaledValueOf*FixedSurface metadata items as it is quite reasonable to have negative levels.
What are the steps to reproduce the bug?
grib_set -s typeOfFirstFixedSurface=109,scaledValueOfFirstFixedSurface=-2 file
Version
All
Platform (OS and architecture)
Linux
Relevant log output
Accompanying data
No response
Organisation
Bureau of Meteorology