Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
c6755c6f
Commit
c6755c6f
authored
Sep 09, 2010
by
Uwe Schulzweida
Browse files
GRIB1: use packing only for non constant fields
parent
e7ba0b0a
Changes
4
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
c6755c6f
2010-09-1
3
Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
2010-09-1
0
Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using CGRIBEX library version 1.4.6
* Version 1.4.6 released
2010-09-09 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* GRIB1: use packing only for non constant fields [request: Luis Kornblueh]
* varDefZtype: bug fix [report: Stephanie Legutke]
2010-09-07 Ralf Mueller <ralf.mueller@zmaw.de>
...
...
NEWS
View file @
c6755c6f
CDI NEWS
--------
Version 1.4.6 (
29 April
2010):
Version 1.4.6 (
10 September
2010):
New features:
* GRIB1: use packing only for non constant fields
* Added support for attribute type int16 and float32
* use libtool 2.2.10 for compiling + linking
Version 1.4.5.1 (29 April 2010):
New features:
* Added support for grid mask
* GRIB1 decode: Correct ZeroShiftError of simple packed spherical harmonics
...
...
src/cgribexlib.c
View file @
c6755c6f
...
...
@@ -3630,7 +3630,7 @@ int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *ise
*
datstart
=
bds_head
+
bds_ext
;
numBits
=
ISEC4_NumBits
;
nbpv
=
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
)
)
n
umBits
=
0
;
if
(
IS_EQUAL
(
fmin
,
fmax
)
)
n
bpv
=
0
;
}
blockLength
=
(
*
datstart
)
+
(
n
umBits
*
(
datasize
-
PackStart
)
+
7
)
/
8
;
blockLength
=
(
*
datstart
)
+
(
n
bpv
*
(
datasize
-
PackStart
)
+
7
)
/
8
;
if
(
(
blockLength
%
2
)
==
1
)
blockLength
++
;
unused_bits
=
blockLength
*
8
-
(
*
datstart
)
*
8
-
n
umBits
*
(
datasize
-
PackStart
);
unused_bits
=
blockLength
*
8
-
(
*
datstart
)
*
8
-
n
bpv
*
(
datasize
-
PackStart
);
Flag
+=
unused_bits
;
...
...
@@ -3681,7 +3681,6 @@ 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
...
...
@@ -3794,9 +3793,9 @@ int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *ise
}
}
*
datsize
=
((
datasize
-
PackStart
)
*
n
umBits
+
7
)
/
8
;
*
datsize
=
((
datasize
-
PackStart
)
*
n
bpv
+
7
)
/
8
;
encode_double_array
(
n
umBits
,
PackStart
,
datasize
,
lGrib
,
encode_double_array
(
n
bpv
,
PackStart
,
datasize
,
lGrib
,
data
,
zref
,
factor
,
&
z
);
if
(
unused_bits
>=
8
)
...
...
@@ -9118,7 +9117,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"" ""1
0:26:38
"
;
static
const
char
grb_libvers
[]
=
"1.4.6"
" of ""Sep 9 2010"" ""1
3:13:52
"
;
const
char
*
cgribexLibraryVersion
(
void
)
{
...
...
src/stream_int.c
View file @
c6755c6f
...
...
@@ -114,7 +114,8 @@ void cdiInitialize(void)
Init_CDI
=
TRUE
;
#if defined (HAVE_LIBCGRIBEX)
gribFixZSE
(
1
);
/* Fix ZeroShiftError of simple packed spherical harmonics */
gribFixZSE
(
1
);
/* 1: Fix ZeroShiftError of simple packed spherical harmonics */
gribSetConst
(
1
);
/* 1: Don't pack constant fields on regular grids */
#endif
value
=
cdiGetenvInt
(
"CD_REGULARGRID"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment