Commit 12841779 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexlib update

parent c6755c6f
......@@ -16,7 +16,7 @@ case "${HOSTNAME}" in
./configure --prefix=$HOME/local \
--with-netcdf=/opt/local \
--with-hdf5=/opt/local \
--with-szlib=/opt/local \
--with-szlib=$HOME/local \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2 -Df2cFortran"
;;
# ia64-nec-linux
......
/* Automatically generated by m214003 at 2010-09-09, do not edit */
/* Automatically generated by m214003 at 2010-09-10, do not edit */
/* CGRIBEXLIB_VERSION="1.4.6" */
......@@ -3630,7 +3630,7 @@ int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *ise
*datstart = bds_head + bds_ext;
nbpv = numBits = ISEC4_NumBits;
numBits = ISEC4_NumBits;
if ( lspherc && lcomplex )
{
......@@ -3665,14 +3665,14 @@ int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *ise
if ( GRB_Const && !lspherc )
{
if ( IS_EQUAL(fmin, fmax) ) nbpv = 0;
if ( IS_EQUAL(fmin, fmax) ) numBits = 0;
}
blockLength = (*datstart) + (nbpv*(datasize - PackStart) + 7)/8;
blockLength = (*datstart) + (numBits*(datasize - PackStart) + 7)/8;
if ( (blockLength%2) == 1 ) blockLength++;
unused_bits = blockLength*8 - (*datstart)*8 - nbpv*(datasize - PackStart);
unused_bits = blockLength*8 - (*datstart)*8 - numBits*(datasize - PackStart);
Flag += unused_bits;
......@@ -3681,6 +3681,7 @@ int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *ise
Adjust number of bits per value if full integer length to
avoid hitting most significant bit (sign bit).
*/
nbpv = numBits;
/* if( nbpv == ibits ) nbpv = nbpv - 1; */
/*
Calculate the binary scaling factor to spread the range of
......@@ -3793,9 +3794,9 @@ int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *ise
}
}
*datsize = ((datasize-PackStart)*nbpv + 7)/8;
*datsize = ((datasize-PackStart)*numBits + 7)/8;
encode_double_array(nbpv, PackStart, datasize, lGrib,
encode_double_array(numBits, PackStart, datasize, lGrib,
data, zref, factor, &z);
if ( unused_bits >= 8 )
......@@ -5107,7 +5108,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
if ( ISEC4_NumNonMissValues != j )
{
if ( dfunc != 'J' )
if ( dfunc != 'J' && ISEC4_NumBits != 0 )
Warning(func, "Bitmap (%d) and data (%d) section differ, using bitmap section!",
j, ISEC4_NumNonMissValues);
......@@ -8674,10 +8675,10 @@ int gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufs
if ( bds_nbits != 8 && bds_nbits != 16 && bds_nbits != 24 && bds_nbits != 32 )
{
static int linfo = 1;
if ( linfo )
if ( linfo && bds_nbits != 0 )
{
linfo = 0;
fprintf(stderr, "GRIB zip is only available for 8, 16, 24 and 32 bit data!\n");
fprintf(stderr, "GRIB szip only supports 8, 16, 24 and 32 bit data!\n");
}
return (rec_len);
}
......@@ -9117,7 +9118,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.4.6" " of ""Sep 9 2010"" ""13:13:52";
static const char grb_libvers[] = "1.4.6" " of ""Sep 10 2010"" ""10:53:41";
const char *
cgribexLibraryVersion(void)
{
......
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