Commit 85b41ffb authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexlib update

parent 09c69651
...@@ -809,6 +809,7 @@ enable_dependency_tracking ...@@ -809,6 +809,7 @@ enable_dependency_tracking
with_gnu_ld with_gnu_ld
with_sysroot with_sysroot
enable_libtool_lock enable_libtool_lock
with_gnu_ld
enable_largefile enable_largefile
with_threads with_threads
with_zlib with_zlib
...@@ -838,16 +839,25 @@ LDFLAGS ...@@ -838,16 +839,25 @@ LDFLAGS
LIBS LIBS
CPPFLAGS CPPFLAGS
CPP CPP
CPPFLAGS
FC FC
FCFLAGS FCFLAGS
LDFLAGS
LIBS
FPP FPP
FPPFLAGS FPPFLAGS
F77 F77
FFLAGS FFLAGS
LDFLAGS
LIBS
CXX CXX
CXXFLAGS CXXFLAGS
LDFLAGS
LIBS
CPPFLAGS
CCC CCC
CXXCPP CXXCPP
CPPFLAGS
FCMODEXT' FCMODEXT'
   
   
......
/* Automatically generated by m214003 at 2011-08-25, do not edit */ /* Automatically generated by m214003 at 2011-08-27, do not edit */
/* CGRIBEXLIB_VERSION="1.5.1" */ /* CGRIBEXLIB_VERSION="1.5.1" */
...@@ -5528,57 +5528,85 @@ int gribReadSize(int fileID) ...@@ -5528,57 +5528,85 @@ int gribReadSize(int fileID)
pdssize = gribsize; pdssize = gribsize;
fileSetPos(fileID, (off_t) 3, SEEK_CUR); fileSetPos(fileID, (off_t) 3, SEEK_CUR);
if ( CGRIBEX_Debug ) if ( CGRIBEX_Debug ) Message("pdssize = %d", pdssize);
Message("pdssize = %d", pdssize);
flag = filePtrGetc(fileptr); flag = filePtrGetc(fileptr);
if ( CGRIBEX_Debug ) if ( CGRIBEX_Debug ) Message("flag = %d", flag);
Message("flag = %d", flag);
fileSetPos(fileID, (off_t) pdssize-8, SEEK_CUR); fileSetPos(fileID, (off_t) pdssize-8, SEEK_CUR);
if ( flag & 128 ) if ( flag & 128 )
{ {
b1 = filePtrGetc(fileptr); b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
b2 = filePtrGetc(fileptr);
b3 = filePtrGetc(fileptr);
gdssize = (b1 << 16) + (b2 << 8) + b3; gdssize = (b1 << 16) + (b2 << 8) + b3;
fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR); fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR);
if ( CGRIBEX_Debug ) Message("gdssize = %d", gdssize);
} }
if ( CGRIBEX_Debug )
Message("gdssize = %d", gdssize);
if ( flag & 64 ) if ( flag & 64 )
{ {
b1 = filePtrGetc(fileptr); b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
b2 = filePtrGetc(fileptr);
b3 = filePtrGetc(fileptr);
bmssize = (b1 << 16) + (b2 << 8) + b3; bmssize = (b1 << 16) + (b2 << 8) + b3;
fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR); fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR);
if ( CGRIBEX_Debug ) Message("bmssize = %d", bmssize);
} }
if ( CGRIBEX_Debug )
Message("bmssize = %d", bmssize);
b1 = filePtrGetc(fileptr); b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
b2 = filePtrGetc(fileptr);
b3 = filePtrGetc(fileptr);
bdssize = (b1 << 16) + (b2 << 8) + b3; bdssize = (b1 << 16) + (b2 << 8) + b3;
if ( CGRIBEX_Debug ) Message("bdssize = %d", bdssize);
if ( CGRIBEX_Debug )
Message("bdssize = %d", bdssize);
gribsize = issize + pdssize + gdssize + bmssize + bdssize + essize; gribsize = issize + pdssize + gdssize + bmssize + bdssize + essize;
} }
else if ( gribversion == 1 )
{
if ( gribsize > JP23SET ) /* Large GRIB record */
{
int pdssize = 0, gdssize = 0, bmssize = 0, bdssize = 0;
int issize = 4, essize = 4;
int flag;
b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
pdssize = (b1 << 16) + (b2 << 8) + b3;
if ( CGRIBEX_Debug ) Message("pdssize = %d", pdssize);
for ( int i = 0; i < 5; ++i ) flag = filePtrGetc(fileptr);
if ( CGRIBEX_Debug ) Message("flag = %d", flag);
fileSetPos(fileID, (off_t) pdssize-8, SEEK_CUR);
if ( flag & 128 )
{
b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
gdssize = (b1 << 16) + (b2 << 8) + b3;
fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR);
if ( CGRIBEX_Debug ) Message("gdssize = %d", gdssize);
}
if ( flag & 64 )
{
b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
bmssize = (b1 << 16) + (b2 << 8) + b3;
fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR);
if ( CGRIBEX_Debug ) Message("bmssize = %d", bmssize);
}
b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
bdssize = (b1 << 16) + (b2 << 8) + b3;
bdssize = correct_bdslen(bdssize, gribsize, issize+pdssize+gdssize+bmssize);
if ( CGRIBEX_Debug ) Message("bdssize = %d", bdssize);
gribsize = issize+pdssize+gdssize+bmssize+bdssize+essize;
}
}
else if ( gribversion == 2 ) else if ( gribversion == 2 )
{ {
int i; int i;
/* we set gribsize the following way because it doesn't matter then /* we set gribsize the following way because it doesn't matter then
whether int is 4 or 8 bytes long - we don't have to care if the size whether int is 4 or 8 bytes long - we don't have to care if the size
really fits: if it does not, the record can not be read at all */ really fits: if it does not, the record can not be read at all */
gribsize = 0; gribsize = 0;
for ( i = 0; i < 8; i++ ) gribsize = (gribsize << 8) | filePtrGetc(fileptr); for ( i = 0; i < 8; i++ ) gribsize = (gribsize << 8) | filePtrGetc(fileptr);
} }
else if ( gribversion != 1 ) else
{ {
gribsize = 0; gribsize = 0;
Warning("GRIB version %d unsupported!", gribversion); Warning("GRIB version %d unsupported!", gribversion);
...@@ -9142,7 +9170,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu ...@@ -9142,7 +9170,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen); return (gribLen);
} }
static const char grb_libvers[] = "1.5.1" " of ""Aug 25 2011"" ""09:32:29"; static const char grb_libvers[] = "1.5.1" " of ""Aug 27 2011"" ""08:40:40";
const char * const char *
cgribexLibraryVersion(void) 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