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
46e0775d
Commit
46e0775d
authored
Aug 22, 2012
by
Uwe Schulzweida
Browse files
CGRIBEX lib update
parent
82499bbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
46e0775d
...
...
@@ -2,6 +2,7 @@
* Version 1.5.7 released
* Merge of branch cdo-pio into trunk cdi
* using CGRIBEX library version 1.5.4
* using EXSE library version 1.3.1
2012-07-23 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
src/cgribex.h
View file @
46e0775d
...
...
@@ -8,7 +8,7 @@
/* GRIB1 Level Types */
#define GRIB1_LTYPE_SURFACE 1
#define GRIB1_LTYPE_TOA 8
#define GRIB1_LTYPE_TOA
8
#define GRIB1_LTYPE_SEA_BOTTOM 9
#define GRIB1_LTYPE_ATMOSPHERE 10
#define GRIB1_LTYPE_99 99
...
...
src/cgribexlib.c
View file @
46e0775d
/* Automatically generated by m214003 at 2012-0
6-14
, do not edit */
/* Automatically generated by m214003 at 2012-0
8-22
, do not edit */
/* CGRIBEXLIB_VERSION="1.5.
3
" */
/* CGRIBEXLIB_VERSION="1.5.
4
" */
#ifdef _ARCH_PWR6
#pragma options nostrict
...
...
@@ -128,7 +128,7 @@
#endif
#else
#ifndef DBL_IS_NAN
#if defined (HAVE_ISNAN)
#if defined (HAVE_
DECL_
ISNAN)
# define DBL_IS_NAN(x) (isnan(x))
#elif defined (FP_NAN)
# define DBL_IS_NAN(x) (fpclassify(x) == FP_NAN)
...
...
@@ -4235,7 +4235,9 @@ void encodeBMS(GRIBPACK *lGrib, long *gribLen, double *fsec3, int *isec4, double
long
bmsLen
,
bmsUnusedBits
;
long
fsec4size
;
long
z
=
*
gribLen
;
#if defined (VECTORCODE)
unsigned
int
*
imask
;
#endif
static
int
lmissvalinfo
=
1
;
/* unsigned int c, imask; */
...
...
@@ -4604,7 +4606,7 @@ void gribEncode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
int
bmsIncluded
;
size_t
len
;
GRIBPACK
*
lGrib
;
long
datstart
,
datsize
,
bdsstart
,
bdsend
;
long
datstart
,
datsize
,
bdsstart
;
int
status
=
0
;
grsdef
();
...
...
@@ -4676,7 +4678,6 @@ void gribEncode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
return
;
}
bdsend
=
gribLen
;
encodeES
(
lGrib
,
&
gribLen
,
bdsstart
);
if
(
(
size_t
)
gribLen
>
kleng
*
sizeof
(
int
)
)
...
...
@@ -4985,7 +4986,7 @@ int decodePDS(unsigned char *pds, int *isec0, int *isec1)
static
int
decodeGDS
(
unsigned
char
*
gds
,
int
*
isec0
,
int
*
isec2
,
double
*
fsec2
,
int
*
numGridVals
,
int
dfunc
)
{
int
imisng
;
/*
int imisng
= 0; */
int
ReducedGrid
=
FALSE
,
VertCoorTab
=
FALSE
;
int
locnv
=
0
,
locnl
;
int
jlenl
;
...
...
@@ -5001,8 +5002,6 @@ int decodeGDS(unsigned char *gds, int *isec0, int *isec2, double *fsec2, int *n
*
numGridVals
=
0
;
imisng
=
0
;
memset
(
isec2
,
0
,
22
*
sizeof
(
int
));
gdsLen
=
GDS_Len
;
...
...
@@ -5262,15 +5261,13 @@ void decode_double_array_common2(unsigned char *igrib, long jlend, int NumBits,
{
/* code from wgrib routine BDS_unpack */
unsigned
char
*
bits
=
igrib
;
unsigned
int
map_mask
;
long
i
;
int
n_bits
=
NumBits
;
int
c_bits
,
j_bits
;
double
jj
;
/* older unoptimized code, not often used */
c_bits
=
8
;
map_mask
=
128
;
for
(
i
=
0
;
i
<
jlend
;
i
++
)
{
jj
=
0
.
0
;
...
...
@@ -8924,9 +8921,9 @@ void grib2PrintALL(int nrec, long offset, long recpos, long recsize, unsigned ch
unsigned
char
*
is
=
NULL
,
*
pds
=
NULL
,
*
gds
=
NULL
,
*
bms
=
NULL
,
*
bds
=
NULL
;
unsigned
char
*
ids
=
NULL
,
*
lus
=
NULL
,
*
drs
=
NULL
;
long
ids_len
=
0
,
lus_len
=
0
,
gds_len
=
0
,
pds_len
=
0
,
drs_len
=
0
,
bms_len
=
0
,
bds_len
=
0
;
int
gridtype
,
paramnum
,
level1type
,
level2type
;
int
level1
,
level1sf
;
int
level2
,
level2sf
;
int
gridtype
,
paramnum
,
level1type
/*
, level2type
*/
;
int
level1
/*
, level1sf
*/
;
/*
int level2, level2sf;
*/
double
cr
=
1
;
if
(
header
)
...
...
@@ -8966,11 +8963,11 @@ void grib2PrintALL(int nrec, long offset, long recpos, long recsize, unsigned ch
gridtype
=
GET_UINT2
(
gds
[
12
],
gds
[
13
]);
paramnum
=
GET_UINT1
(
pds
[
10
]);
level1type
=
GET_UINT1
(
pds
[
22
]);
level1sf
=
GET_UINT1
(
pds
[
23
]);
/*
level1sf = GET_UINT1(pds[23]);
*/
level1
=
GET_UINT4
(
pds
[
24
],
pds
[
25
],
pds
[
26
],
pds
[
27
]);
level2type
=
GET_UINT1
(
pds
[
28
]);
level2sf
=
GET_UINT1
(
pds
[
29
]);
level2
=
GET_UINT4
(
pds
[
30
],
pds
[
31
],
pds
[
32
],
pds
[
33
]);
/*
level2type = GET_UINT1(pds[28]);
*/
/*
level2sf = GET_UINT1(pds[29]);
*/
/*
level2 = GET_UINT4(pds[30],pds[31],pds[32],pds[33]);
*/
/*
printf("level %d %d %d %d %d %d %d\n", level1type, level1sf, level1, level1*level1sf, level2sf, level2, level2*level2sf);
*/
...
...
@@ -9318,14 +9315,14 @@ void repair1(unsigned char *gbuf, long gbufsize)
long
i
;
int
nerr
;
unsigned
char
*
pds
=
NULL
,
*
gds
=
NULL
,
*
bms
=
NULL
,
*
bds
=
NULL
;
int
recLen
;
/*
int recLen;
*/
unsigned
char
*
source
;
size_t
sourceLen
;
int
bds_len
,
bds_nbits
,
bds_flag
,
lspherc
,
lcomplex
,
lcompress
;
int
bds_len
,
bds_nbits
,
bds_flag
,
lspherc
,
lcomplex
/*
, lcompress
*/
;
int
bds_head
=
11
;
int
bds_ext
=
0
,
bds_ubits
;
int
datstart
=
0
;
int
llarge
=
FALSE
;
/*
int llarge = FALSE;
*/
nerr
=
grib1Sections
(
gbuf
,
gbufsize
,
&
pds
,
&
gds
,
&
bms
,
&
bds
);
if
(
nerr
)
...
...
@@ -9333,8 +9330,8 @@ void repair1(unsigned char *gbuf, long gbufsize)
fprintf
(
stdout
,
"grib1Sections error
\n
"
);
}
recLen
=
gribrec_len
(
gbuf
[
4
],
gbuf
[
5
],
gbuf
[
6
]);
if
(
recLen
>
JP23SET
)
llarge
=
TRUE
;
/*
recLen = gribrec_len(gbuf[4], gbuf[5], gbuf[6]);
*/
/*
if ( recLen > JP23SET ) llarge = TRUE;
*/
bds_len
=
BDS_Len
;
bds_nbits
=
BDS_NumBits
;
...
...
@@ -9342,7 +9339,7 @@ void repair1(unsigned char *gbuf, long gbufsize)
bds_ubits
=
bds_flag
&
15
;
lspherc
=
bds_flag
>>
7
;
lcomplex
=
(
bds_flag
>>
6
)
&
1
;
lcompress
=
(
bds_flag
>>
4
)
&
1
;
/*
lcompress = (bds_flag >> 4)&1;
*/
if
(
lspherc
)
{
...
...
@@ -9445,7 +9442,8 @@ int gribGetZip(long recsize, unsigned char *gribbuffer, long *urecsize)
/* urecsize : uncompressed record size */
int
compress
=
0
;
int
nerr
;
int
bds_len
,
bds_nbits
,
bds_flag
,
lcompress
,
lspherc
,
lcomplex
;
/* int bds_len, bds_nbits, lspherc, lcomplex; */
int
bds_flag
,
lcompress
;
long
gribsize
=
0
;
unsigned
char
*
pds
=
NULL
,
*
gds
=
NULL
,
*
bms
=
NULL
,
*
bds
=
NULL
;
int
gribversion
;
...
...
@@ -9461,11 +9459,11 @@ int gribGetZip(long recsize, unsigned char *gribbuffer, long *urecsize)
return
(
compress
);
}
bds_len
=
BDS_Len
;
bds_nbits
=
BDS_NumBits
;
/*
bds_len = BDS_Len;
*/
/*
bds_nbits = BDS_NumBits;
*/
bds_flag
=
BDS_Flag
;
lspherc
=
bds_flag
>>
7
;
lcomplex
=
(
bds_flag
>>
6
)
&
1
;
/*
lspherc = bds_flag >> 7;
*/
/*
lcomplex = (bds_flag >> 6)&1;
*/
lcompress
=
(
bds_flag
>>
4
)
&
1
;
*
urecsize
=
0
;
...
...
@@ -9518,7 +9516,7 @@ int gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufs
SZ_com_t
sz_param
;
/* szip parameter block */
unsigned
char
*
dest
,
*
source
;
size_t
destLen
,
sourceLen
;
int
bds_len
,
bds_nbits
,
bds_flag
,
lspherc
,
lcomplex
,
lcompress
,
bds_ubits
;
int
bds_len
,
bds_nbits
,
bds_flag
,
lspherc
,
lcomplex
,
/*
lcompress,
*/
bds_ubits
;
int
bds_head
=
11
;
int
bds_ext
=
0
;
int
bds_zoffset
=
12
;
...
...
@@ -9533,7 +9531,7 @@ int gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufs
bds_ubits
=
bds_flag
&
15
;
lspherc
=
bds_flag
>>
7
;
lcomplex
=
(
bds_flag
>>
6
)
&
1
;
lcompress
=
(
bds_flag
>>
4
)
&
1
;
/*
lcompress = (bds_flag >> 4)&1;
*/
if
(
bds_nbits
!=
8
&&
bds_nbits
!=
16
&&
bds_nbits
!=
24
&&
bds_nbits
!=
32
)
{
...
...
@@ -9768,13 +9766,12 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
#if ! defined (HAVE_LIBSZ)
static
int
libszwarn
=
1
;
#endif
long
i
;
int
nerr
;
unsigned
char
*
pds
=
NULL
,
*
gds
=
NULL
,
*
bms
=
NULL
,
*
bds
=
NULL
;
int
bdsLen
,
recLen
,
gribLen
=
0
;
char
*
dest
,
*
source
;
size_t
destLen
,
sourceLen
;
int
bds_len
,
bds_nbits
,
bds_flag
,
lspherc
,
lcomplex
,
lcompress
;
int
/*
bds_len,
*/
bds_nbits
,
bds_flag
,
lspherc
,
lcomplex
/*
, lcompress
*/
;
int
bds_head
=
11
;
int
bds_ext
=
0
;
int
bds_zoffset
=
12
;
...
...
@@ -9793,12 +9790,12 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
if
(
llarge
)
bds_zoffset
=
14
;
bds_len
=
BDS_Len
;
/*
bds_len = BDS_Len;
*/
bds_nbits
=
BDS_NumBits
;
bds_flag
=
BDS_Flag
;
lspherc
=
bds_flag
>>
7
;
lcomplex
=
(
bds_flag
>>
6
)
&
1
;
lcompress
=
(
bds_flag
>>
4
)
&
1
;
/*
lcompress = (bds_flag >> 4)&1;
*/
if
(
lspherc
)
{
...
...
@@ -9843,6 +9840,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
#if defined (HAVE_LIBSZ)
{
int
status
;
long
i
;
size_t
tmpLen
;
int
bds_ubits
;
SZ_com_t
sz_param
;
/* szip parameter block */
...
...
@@ -9980,7 +9978,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return
(
gribLen
);
}
static
const
char
grb_libvers
[]
=
"1.5.
3
"
" of ""
Jun 14
2012"" ""1
3
:22:4
5
"
;
static
const
char
grb_libvers
[]
=
"1.5.
4
"
" of ""
Aug 22
2012"" ""1
4
:22:4
4
"
;
const
char
*
cgribexLibraryVersion
(
void
)
{
...
...
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