Commit 0bdaf611 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

stream_gribapi: make bitsPerValue optional

parent 3934ce00
......@@ -17,6 +17,8 @@ case "${HOSTNAME}" in
--with-netcdf=/opt/local \
--with-hdf5=/opt/local \
--with-szlib=$HOME/local \
--with-jasper=$HOME/local \
--with-grib_api=$HOME/local/gribapi-1.9.5 \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2 -Df2cFortran"
;;
# ia64-nec-linux
......
......@@ -5420,7 +5420,7 @@ int cdfInqContents(int streamID)
init_ncdims(ndims, ncdims);
init_ncvars(nvars, ncvars);
/* read global attributtes*/
/* read global attributtes */
for ( iatt = 0; iatt < ngatts; iatt++ )
{
cdf_inq_attname(fileID, NC_GLOBAL, iatt, attname);
......
......@@ -847,12 +847,14 @@ void gribapiScanTimestep1(int streamID)
printf("%d %d %d.%d.%d\n", vdate, vtime, pnum, pcat, pdis);
*/
GRIB_CHECK(grib_get_long(gh,"bitsPerValue", &lpar),0);
bitsPerValue = (int) lpar;
if ( bitsPerValue > 0 && bitsPerValue <= 32 )
prec = bitsPerValue;
else
prec = DATATYPE_PACK;
prec = DATATYPE_PACK;
status = grib_get_long(gh,"bitsPerValue", &lpar);
if ( status == 0 )
{
bitsPerValue = (int) lpar;
if ( bitsPerValue > 0 && bitsPerValue <= 32 )
prec = bitsPerValue;
}
if ( nrecs == 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