Commit 41e93545 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

griblib update

parent b01f7499
/* Automatically generated by m214003 at 2009-06-17, do not edit */
/* Automatically generated by m214003 at 2009-07-03, do not edit */
/* GRIBLIB_VERSION="1.3.1" */
/* GRIBLIB_VERSION="1.4.0" */
#if defined (HAVE_CONFIG_H)
# include "config.h"
......@@ -148,13 +148,17 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define GET_UINT2(a,b) ((int) ((a << 8) + (b)))
#define GET_UINT1(a) ((int) (a))
#define BUDG_START(s) (s[0]=='B' && s[1]=='U' && s[2]=='D' && s[3]=='G')
#define TIDE_START(s) (s[0]=='T' && s[1]=='I' && s[2]=='D' && s[3]=='E')
#define GRIB_START(s) (s[0]=='G' && s[1]=='R' && s[2]=='I' && s[3]=='B')
#define GRIB_END(s) (s[0]=='7' && s[1]=='7' && s[2]=='7' && s[3]=='7')
/* Section 0: Indicator Section (IS) */
/* GRIB1 Section 0: Indicator Section (IS) */
#define IS_GRIB_Len GET_UINT3(is[ 4], is[ 5], is[ 6])
#define IS_GRIB_Version GET_UINT1(is[ 7])
#define GRIB1_SECLEN(s) GET_UINT3(s[ 4], s[ 5], s[ 6])
#define GRIB_EDITION(s) GET_UINT1(s[ 7])
/* Section 1: Product Definition Section (PDS) */
/* GRIB1 Section 1: Product Definition Section (PDS) */
#define PDS_Len GET_UINT3(pds[ 0], pds[ 1], pds[ 2])
#define PDS_CodeTable GET_UINT1(pds[ 3])
......@@ -187,7 +191,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define PDS_DecimalScale GET_INT2(pds[26],pds[27])
/* Section 2: Grid Description Section (GDS) */
/* GRIB1 Section 2: Grid Description Section (GDS) */
#define GDS_Len ((gds) == NULL ? 0 : GET_UINT3(gds[ 0], gds[ 1], gds[ 2]))
#define GDS_NV GET_UINT1(gds[ 3])
......@@ -197,7 +201,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define GDS_GridType GET_UINT1(gds[ 5])
/* Triangular grid of DWD */
/* GRIB1 Triangular grid of DWD */
#define GDS_GME_NI2 GET_UINT2(gds[ 6], gds[ 7])
#define GDS_GME_NI3 GET_UINT2(gds[ 8], gds[ 9])
#define GDS_GME_ND GET_UINT3(gds[10], gds[11], gds[12])
......@@ -208,14 +212,14 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define GDS_GME_LonMPL GET_INT3(gds[23], gds[24], gds[25])
#define GDS_GME_BFlag GET_UINT1(gds[27])
/* Spectral */
/* GRIB1 Spectral */
#define GDS_PentaJ GET_UINT2(gds[ 6], gds[ 7])
#define GDS_PentaK GET_UINT2(gds[ 8], gds[ 9])
#define GDS_PentaM GET_UINT2(gds[10], gds[11])
#define GDS_RepType GET_UINT1(gds[12])
#define GDS_RepMode GET_UINT1(gds[13])
/* Regular grid */
/* GRIB1 Regular grid */
#define GDS_NumLon GET_UINT2(gds[ 6], gds[ 7])
#define GDS_NumLat GET_UINT2(gds[ 8], gds[ 9])
#define GDS_FirstLat GET_INT3(gds[10], gds[11], gds[12])
......@@ -231,7 +235,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define GDS_LonSP GET_INT3(gds[35], gds[36], gds[37])
#define GDS_RotAngle GET_Real(&(gds[38]))
/* Lambert */
/* GRIB1 Lambert */
#define GDS_Lambert_Lov GET_INT3(gds[17], gds[18], gds[19])
#define GDS_Lambert_dx GET_INT3(gds[20], gds[21], gds[22])
#define GDS_Lambert_dy GET_INT3(gds[23], gds[24], gds[25])
......@@ -241,7 +245,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define GDS_Lambert_LatSP GET_INT3(gds[34], gds[35], gds[36])
#define GDS_Lambert_LonSP GET_INT3(gds[37], gds[37], gds[37])
/* Section 3: Bit Map Section (BMS) */
/* GRIB1 Section 3: Bit Map Section (BMS) */
#define BMS_Len ((bms) == NULL ? 0 : (int) (bms[0]<<16)+(bms[1]<<8)+bms[2])
#define BMS_UnusedBits (bms[3])
......@@ -249,7 +253,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define BMS_Bitmap ((bms) == NULL ? NULL : (bms)+6)
#define BMS_BitmapSize (((((bms[0]<<16)+(bms[1]<<8)+bms[2]) - 6)<<3) - bms[3])
/* Section 4: Binary Data Section (BDS) */
/* GRIB1 Section 4: Binary Data Section (BDS) */
#define BDS_Len ((int) ((bds[0]<<16)+(bds[1]<<8)+bds[2]))
#define BDS_Flag (bds[3])
......@@ -260,7 +264,12 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define BDS_Power GET_INT2(bds[13], bds[14])
#define BDS_Z (bds[13])
/* Section 5: End Section (ES) */
/* GRIB1 Section 5: End Section (ES) */
/* GRIB2 */
#define GRIB2_SECLEN(section) (GET_UINT4(section[0], section[1], section[2], section[3]))
#define GRIB2_SECNUM(section) (GET_UINT1(section[4]))
#endif /* _GRIBDECODE_H */
#ifndef _GRIBENCODE_H
......@@ -3835,7 +3844,7 @@ int gribVersion(unsigned char *is, size_t buffersize)
if ( buffersize < 8 )
Error(func, "Buffer too small (current size %d)!\n", (int) buffersize);
return (IS_GRIB_Version);
return (GRIB_EDITION(is));
}
......@@ -3867,12 +3876,12 @@ static int decodeIS(unsigned char *is, int *isec0, int *iret)
/*
Check that 'GRIB' is found where expected.
*/
if ( is[0] == 'G' && is[1] == 'R' && is[2] == 'I' && is[3] == 'B' ) lgrib = TRUE;
if ( GRIB_START(is) ) lgrib = TRUE;
/*
ECMWF pseudo-grib data uses 'BUDG' and 'TIDE'.
*/
if ( is[0] == 'B' && is[1] == 'U' && is[2] == 'D' && is[3] == 'G' ) lbudg = TRUE;
if ( is[0] == 'T' && is[1] == 'I' && is[2] == 'D' && is[3] == 'E' ) ltide = TRUE;
if ( BUDG_START(is) ) lbudg = TRUE;
if ( TIDE_START(is) ) ltide = TRUE;
/*
Data is not GRIB or pseudo-grib.
*/
......@@ -3893,12 +3902,12 @@ static int decodeIS(unsigned char *is, int *isec0, int *iret)
Octets 5 - 7 : Length of message.
One 24 bit field.
*/
ISEC0_GRIB_Len = IS_GRIB_Len;
ISEC0_GRIB_Len = GRIB1_SECLEN(is);
/*
Octet 8 : GRIB Edition Number.
One 8 bit field.
*/
ISEC0_GRIB_Version = IS_GRIB_Version;
ISEC0_GRIB_Version = GRIB_EDITION(is);
if ( ISEC0_GRIB_Version > 1 )
Error(func, "GRIB version %d unsupported!", ISEC0_GRIB_Version);
......@@ -5217,6 +5226,7 @@ int gribReadSize(int fileID)
{
static char func[] = "gribReadSize";
int gribversion, gribsize;
int b1, b2, b3;
off_t pos;
void *fileptr;
/*
......@@ -5226,8 +5236,13 @@ int gribReadSize(int fileID)
fileptr = filePtr(fileID);
pos = fileGetPos(fileID);
gribsize = (filePtrGetc(fileptr) << 16) + (filePtrGetc(fileptr) << 8) + filePtrGetc(fileptr);
/* bug: order of functions calls!
gribsize = (filePtrGetc(fileptr) << 16) + (filePtrGetc(fileptr) << 8) + filePtrGetc(fileptr);
*/
b1 = filePtrGetc(fileptr);
b2 = filePtrGetc(fileptr);
b3 = filePtrGetc(fileptr);
gribsize = (b1 << 16) + (b2 << 8) + b3;
gribversion = filePtrGetc(fileptr);
/*
......@@ -5263,7 +5278,10 @@ int gribReadSize(int fileID)
if ( flag & 128 )
{
gdssize = (filePtrGetc(fileptr) << 16) + (filePtrGetc(fileptr) << 8) + filePtrGetc(fileptr);
b1 = filePtrGetc(fileptr);
b2 = filePtrGetc(fileptr);
b3 = filePtrGetc(fileptr);
gdssize = (b1 << 16) + (b2 << 8) + b3;
fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR);
}
if ( GRB_Debug )
......@@ -5271,13 +5289,19 @@ int gribReadSize(int fileID)
if ( flag & 64 )
{
bmssize = (filePtrGetc(fileptr) << 16) + (filePtrGetc(fileptr) << 8) + filePtrGetc(fileptr);
b1 = filePtrGetc(fileptr);
b2 = filePtrGetc(fileptr);
b3 = filePtrGetc(fileptr);
bmssize = (b1 << 16) + (b2 << 8) + b3;
fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR);
}
if ( GRB_Debug )
Message(func, "bmssize = %d", bmssize);
bdssize = (filePtrGetc(fileptr) << 16) + (filePtrGetc(fileptr) << 8) + filePtrGetc(fileptr);
b1 = filePtrGetc(fileptr);
b2 = filePtrGetc(fileptr);
b3 = filePtrGetc(fileptr);
bdssize = (b1 << 16) + (b2 << 8) + b3;
if ( GRB_Debug )
Message(func, "bdssize = %d", bdssize);
......@@ -7159,24 +7183,25 @@ void ref2ibm(double *pref, int kbits)
} /* ref2ibm */
int gribSections(unsigned char *gribbuffer, long recsize, unsigned char **pdsp,
int grib1Sections(unsigned char *gribbuffer, long recsize, unsigned char **pdsp,
unsigned char **gdsp, unsigned char **bmsp, unsigned char **bdsp)
{
unsigned char *pds, *gds, *bms, *bds;
unsigned char *bufpointer, *is;
unsigned char *bufpointer, *is, *section;
int gribversion, grib1offset;
long gribsize = 0;
section = gribbuffer;
is = gribbuffer;
if ( is[0] != 'G' || is[1] != 'R' || is[2] != 'I' || is[3] != 'B' )
if ( ! GRIB_START(section) )
{
fprintf(stderr, "wrong indicator section >%c%c%c%c<\n",
is[0], is[1], is[2], is[3]);
section[0], section[1], section[2], section[3]);
return (-1);
}
gribversion = IS_GRIB_Version;
if ( IS_GRIB_Len == 24 && gribversion == 0 ) gribversion = 0;
gribversion = GRIB_EDITION(section);
if ( GRIB1_SECLEN(section) == 24 && gribversion == 0 ) gribversion = 0;
if ( gribversion == 1 )
grib1offset = 4;
......@@ -7225,8 +7250,7 @@ int gribSections(unsigned char *gribbuffer, long recsize, unsigned char **pdsp,
*bdsp = bds;
/* end section - "7777" in ascii */
if ( bufpointer[0] != 0x37 || bufpointer[1] != 0x37 ||
bufpointer[2] != 0x37 || bufpointer[3] != 0x37 )
if ( ! GRIB_END(bufpointer) )
{
fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
bufpointer[0], bufpointer[1], bufpointer[2], bufpointer[3]);
......@@ -7236,26 +7260,188 @@ int gribSections(unsigned char *gribbuffer, long recsize, unsigned char **pdsp,
}
int grib2Sections(unsigned char *gribbuffer, long recsize, unsigned char **idsp,
unsigned char **lusp, unsigned char **gdsp, unsigned char **pdsp,
unsigned char **drsp, unsigned char **bmsp, unsigned char **bdsp)
{
unsigned char *section;
long sec_len;
int sec_num;
int gribversion;
long gribsize = 0;
*idsp = NULL;
*lusp = NULL;
*gdsp = NULL;
*pdsp = NULL;
*drsp = NULL;
*bmsp = NULL;
*bdsp = NULL;
section = gribbuffer;
sec_len = 16;
if ( !GRIB_START(section) )
{
fprintf(stderr, "wrong indicator section >%c%c%c%c<\n",
section[0], section[1], section[2], section[3]);
return (-1);
}
gribversion = GRIB_EDITION(section);
if ( gribversion != 2 )
{
fprintf(stderr, "wrong GRIB version %d\n", gribversion);
return (-1);
}
gribsize += sec_len;
section += sec_len;
/* section 1 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "ids %d %ld\n", sec_num, sec_len);
if ( sec_num != 1 )
{
fprintf(stderr, "Unexpected section1 number %d\n", sec_num);
return (-1);
}
*idsp = section;
gribsize += sec_len;
section += sec_len;
/* section 2 and 3 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "lus %d %ld\n", sec_num, sec_len);
if ( sec_num == 2 )
{
*lusp = section;
gribsize += sec_len;
section += sec_len;
/* section 3 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "gds %d %ld\n", sec_num, sec_len);
*gdsp = section;
}
else if ( sec_num == 3 )
{
*gdsp = section;
}
else
{
fprintf(stderr, "Unexpected section3 number %d\n", sec_num);
return (-1);
}
gribsize += sec_len;
section += sec_len;
/* section 4 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "pds %d %ld\n", sec_num, sec_len);
if ( sec_num != 4 )
{
fprintf(stderr, "Unexpected section4 number %d\n", sec_num);
return (-1);
}
*pdsp = section;
gribsize += sec_len;
section += sec_len;
/* section 5 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "drs %d %ld\n", sec_num, sec_len);
if ( sec_num != 5 )
{
fprintf(stderr, "Unexpected section5 number %d\n", sec_num);
return (-1);
}
*drsp = section;
gribsize += sec_len;
section += sec_len;
/* section 6 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "bms %d %ld\n", sec_num, sec_len);
if ( sec_num != 6 )
{
fprintf(stderr, "Unexpected section6 number %d\n", sec_num);
return (-1);
}
*bmsp = section;
gribsize += sec_len;
section += sec_len;
/* section 7 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "bds %d %ld\n", sec_num, sec_len);
if ( sec_num != 7 )
{
fprintf(stderr, "Unexpected section7 number %d\n", sec_num);
return (-1);
}
*bdsp = section;
gribsize += sec_len;
section += sec_len;
/* end section - "7777" in ASCII */
if ( ! GRIB_END(section) )
{
fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
section[0], section[1], section[2], section[3]);
}
return (0);
}
int gribGinfo(long recpos, long recsize, unsigned char *gribbuffer,
int *intnum, float *fltnum)
{
unsigned char *pds, *gds, *bms, *bds;
unsigned char *bufpointer, *is;
unsigned char *bufpointer, *is, *section;
int gribversion, grib1offset;
long gribsize = 0;
int dpos, bpos = 0;
float bsf;
section = gribbuffer;
is = gribbuffer;
if ( is[0] != 'G' || is[1] != 'R' || is[2] != 'I' || is[3] != 'B' )
if ( ! GRIB_START(section) )
{
fprintf(stderr, "wrong indicator section >%c%c%c%c<\n",
is[0], is[1], is[2], is[3]);
section[0], section[1], section[2], section[3]);
return (-1);
}
gribversion = IS_GRIB_Version;
if ( IS_GRIB_Len == 24 && gribversion == 0 ) gribversion = 0;
gribversion = GRIB_EDITION(section);
if ( GRIB1_SECLEN(section) == 24 && gribversion == 0 ) gribversion = 0;
if ( gribversion == 1 )
grib1offset = 4;
......@@ -7305,8 +7491,7 @@ int gribGinfo(long recpos, long recsize, unsigned char *gribbuffer,
}
/* end section - "7777" in ascii */
if ( bufpointer[0] != 0x37 || bufpointer[1] != 0x37 ||
bufpointer[2] != 0x37 || bufpointer[3] != 0x37 )
if ( ! GRIB_END(bufpointer) )
{
fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
bufpointer[0], bufpointer[1], bufpointer[2], bufpointer[3]);
......@@ -7333,7 +7518,7 @@ int gribGinfo(long recpos, long recsize, unsigned char *gribbuffer,
}
void gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
void grib1PrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
{
static int header = 1;
int GridType, level, nerr;
......@@ -7350,8 +7535,7 @@ void gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned cha
is = gribbuffer;
nerr = gribSections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
if ( nerr )
{
fprintf(stdout, "%5d :%4ld %8ld %6ld : error\n", nrec, offset, recpos, recsize);
......@@ -7381,12 +7565,93 @@ void gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned cha
}
fprintf(stdout, "%5d :%4ld %8ld %6ld :%2d%4d%5d%7d%7d : %3d%7d : %5d %5d %6.4g\n",
nrec, offset, recpos, recsize, IS_GRIB_Version,
nrec, offset, recpos, recsize, GRIB_EDITION(is),
PDS_Len, GDS_Len, BMS_Len, BDS_Len,
PDS_Parameter, level, PDS_LevelType, GridType, cr);
}
void grib2PrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
{
static int header = 1;
int GridType, level, nerr;
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;
double cr = 1;
if ( header )
{
fprintf(stdout,
" Rec : Off Position Size : V IDS LUS GDS PDS DRS BMS BDS : Code Level : LType GType: CR\n");
/* ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
header = 0;
}
is = gribbuffer;
nerr = grib2Sections(gribbuffer, recsize, &ids, &lus, &gds, &pds, &drs, &bms, &bds);
if ( nerr )
{
fprintf(stdout, "%5d :%4ld %8ld %6ld : error\n", nrec, offset, recpos, recsize);
return;
}
if ( ids ) ids_len = GRIB2_SECLEN(ids);
if ( lus ) lus_len = GRIB2_SECLEN(lus);
if ( gds ) gds_len = GRIB2_SECLEN(gds);
if ( pds ) pds_len = GRIB2_SECLEN(pds);
if ( drs ) drs_len = GRIB2_SECLEN(drs);
if ( bms ) bms_len = GRIB2_SECLEN(bms);
if ( bds ) bds_len = GRIB2_SECLEN(bds);
if ( gds == NULL )
GridType = -1;
else
GridType = GDS_GridType;
if ( PDS_LevelType == 100 )
level = PDS_Level * 100;
else if ( PDS_LevelType == 99 )
level = PDS_Level;
else if ( PDS_LevelType == 109 )
level = PDS_Level;
else
level = PDS_Level1;
if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
{
int s1, s2;
s1 = ((int) ((bds[14]<<16)+(bds[15]<<8)+bds[16]));
s2 = ((int) ((gribbuffer[4]<<16)+(gribbuffer[5]<<8)+gribbuffer[6]));
cr = ((double)s1)/s2;
}
fprintf(stdout, "%5d :%4ld %8ld %6ld :%2d %3ld %3ld %3ld %3ld %4ld %6ld %6ld : %3d%7d : %5d %5d %6.4g\n",
nrec, offset, recpos, recsize, GRIB_EDITION(is),
ids_len, lus_len, gds_len, pds_len, drs_len, bms_len, bds_len,
PDS_Parameter, level, PDS_LevelType, GridType, cr);
}
void gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
{
int gribversion;
gribversion = gribVersion(gribbuffer, recsize);
if ( gribversion == 0 || gribversion == 1 )
grib1PrintALL(nrec, offset, recpos, recsize, gribbuffer);
else if ( gribversion == 2 )
grib2PrintALL(nrec, offset, recpos, recsize, gribbuffer);
else
{
fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
nrec, offset, recpos, recsize, gribversion);
}
}
void gribPrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
{
static int header = 1;
......@@ -7405,15 +7670,14 @@ void gribPrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer
is = gribbuffer;
nerr = gribSections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
if ( nerr )
{
fprintf(stdout, "%5d : error\n", nrec);
return;
}
switch(IS_GRIB_Version)
switch(GRIB_EDITION(is))
{
case 0:
year = GET_UINT1(pds[12]);
......@@ -7428,7 +7692,7 @@ void gribPrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer
decimalscale = PDS_DecimalScale;
break;
default:
fprintf(stderr, "Grib version %d not supported!", IS_GRIB_Version);
fprintf(stderr, "Grib version %d not supported!", GRIB_EDITION(is));
exit(EXIT_FAILURE);
}
......@@ -7470,8 +7734,7 @@ void gribPrintGDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer
header = 0;
}
nerr = gribSections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
if ( nerr )
{
fprintf(stdout, "%5d : error\n", nrec);
......@@ -7504,8 +7767,7 @@ void gribPrintBMS(int nrec, long recpos, long recsize, unsigned char *gribbuffer
header = 0;
}
nerr = gribSections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
if ( nerr )
{
fprintf(stdout, "%5d : error\n", nrec);
......@@ -7545,8 +7807,7 @@ void gribPrintBDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer
header = 0;
}
nerr = gribSections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
if ( nerr )
{
fprintf(stdout, "%5d : error\n", nrec);
......@@ -7629,10 +7890,10 @@ int gribGetZip(long recsize, unsigned char *gribbuffer, long *urecsize)
long gribsize = 0;
unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
nerr = gribSections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
if ( nerr )
{
fprintf(stdout, "gribSections error\n");
fprintf(stdout, "grib1Sections error\n");
return (compress);