Commit 2355b0d6 authored by Uwe Schulzweida's avatar Uwe Schulzweida

Erroneous behaviour setting GRIB2 bitsPerValue (bug fix).

parent 15e9399c
2020-05-15 Uwe Schulzweida
* Erroneous behaviour setting GRIB2 bitsPerValue (bug fix) [report: Florian Prill]
2020-04-21 Uwe Schulzweida
* NetCDF4: added support for reading complex numbers (status: experimental)
......
......@@ -2251,9 +2251,6 @@ void gribapiDefPackingType(grib_handle *gh, bool lieee, bool lspectral, bool lco
static
void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype, int datatype, int uvRelativeToGrid)
{
// bitsPerValue have to be defined first (complex packing)
GRIB_CHECK(my_grib_set_long(gh, "bitsPerValue", (long)grbBitsPerValue(datatype)), 0);
const size_t gridsize = gridInqSize(gridID);
bool gridIsRotated = false;
bool gridIsCurvilinear = false;
......@@ -3165,6 +3162,9 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
}
}
// bitsPerValue have to be defined first (complex packing)
GRIB_CHECK(my_grib_set_long(gh, "bitsPerValue", (long)grbBitsPerValue(datatype)), 0);
if ( ! gc->init ) gribapiDefGrid((int)editionNumber, gh, gridID, comptype, datatype, uvRelativeToGrid);
gribapiDefLevel((int)editionNumber, gh, zaxisID, levelID, gc->init, productDefinitionTemplate);
......
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