Commit 8a38c8b1 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gribapiDefGrid: set numberOfValues, needed for ccsds compression (bug fix).

parent 2ce360b2
2017-11-05 Uwe Schulzweida 2017-11-23 Uwe Schulzweida
* Version 1.9.2 released * Version 1.9.2 released
2017-11-10 Uwe Schulzweida
* gribapiDefGrid: set numberOfValues, needed for ccsds compression (bug fix)
2017-11-01 Uwe Schulzweida 2017-11-01 Uwe Schulzweida
* Check chunk size limit of 2GB * Check chunk size limit of 2GB
......
...@@ -1981,6 +1981,8 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype ...@@ -1981,6 +1981,8 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
if ( gcinit ) return; if ( gcinit ) return;
if ( editionNumber == 2 ) GRIB_CHECK(my_grib_set_long(gh, "numberOfValues", (long)gridsize), 0);
switch (gridtype) switch (gridtype)
{ {
case GRID_LONLAT: case GRID_LONLAT:
...@@ -2187,14 +2189,12 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype ...@@ -2187,14 +2189,12 @@ void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int comptype
if ( lieee ) if ( lieee )
{ {
printf("spectral_ieee\n"); printf("spectral_ieee\n");
if ( editionNumber == 2 ) GRIB_CHECK(my_grib_set_long(gh, "numberOfValues", (long)gridsize, 0);
static const char mesg[] = "spectral_ieee"; static const char mesg[] = "spectral_ieee";
size_t len = sizeof (mesg) -1; size_t len = sizeof (mesg) -1;
GRIB_CHECK(my_grib_set_string(gh, "packingType", mesg, &len), 0); GRIB_CHECK(my_grib_set_string(gh, "packingType", mesg, &len), 0);
} }
else */ if ( gridInqComplexPacking(gridID) ) else */ if ( gridInqComplexPacking(gridID) )
{ {
if ( editionNumber == 2 ) GRIB_CHECK(my_grib_set_long(gh, "numberOfValues", (long)gridsize), 0);
static const char mesg[] = "spectral_complex"; static const char mesg[] = "spectral_complex";
size_t len = sizeof (mesg) -1; size_t len = sizeof (mesg) -1;
GRIB_CHECK(my_grib_set_string(gh, "packingType", mesg, &len), 0); GRIB_CHECK(my_grib_set_string(gh, "packingType", mesg, &len), 0);
......
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