Commit 08a3c7af authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

update cgribexlib

parent 42c0e7df
2012-07-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.5.6 released
* using CGRIBEX library version 1.5.3
2012-06-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added support for grib_api key stepType [request: Drte Liermann]
......
/* Automatically generated by m214003 at 2012-05-11, do not edit */
/* Automatically generated by m214003 at 2012-06-08, do not edit */
/* CGRIBEXLIB_VERSION="1.5.2" */
/* CGRIBEXLIB_VERSION="1.5.3" */
#ifdef _ARCH_PWR6
#pragma options nostrict
......@@ -1215,7 +1215,7 @@ void encode_double_array_unrolled(int numBits, long packStart, long datasize,
{
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = ((data[i] - zref) * factor + 0.5);
dval[j] = ((data[i+j] - zref) * factor + 0.5);
}
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
......@@ -2876,6 +2876,18 @@ void gribPrintSec1(int *isec0, int *isec1)
{
/* CALL KWPRS1 (iSEC0,iSEC1)*/
}
/*
-----------------------------------------------------------------
Section 4 . Print local MPIM information.
-----------------------------------------------------------------
*/
if (isec1[ 1] == 252 && isec1[36] == 1)
{
fprintf(grprsm, " MPIM local usage identifier. %9d\n", isec1[36]);
fprintf(grprsm, " Type of ensemble forecast %9d\n", isec1[37]);
fprintf(grprsm, " Individual ensemble member %9d\n", isec1[38]);
fprintf(grprsm, " Number of forecasts in ensemble %9d\n", isec1[39]);
}
}
void printQuasi(int *isec2)
......@@ -3678,6 +3690,7 @@ void encodeES(GRIBPACK *lGrib, long *gribLen, long bdsstart)
#define DWD_extension_254_len 26
#define ECMWF_extension_1_len 24
#define MCH_extension_254_len 19
#define MPIM_extension_1_len 18
static
long getLocalExtLen(int *isec1)
......@@ -3699,6 +3712,10 @@ long getLocalExtLen(int *isec1)
{
if ( isec1[36] == 254 ) extlen = MCH_extension_254_len;
}
else if ( ISEC1_CenterID == 252 )
{
if ( isec1[36] == 1 ) extlen = MPIM_extension_1_len;
}
}
return (extlen);
......@@ -3772,7 +3789,7 @@ void encodePDS_ECMWF_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1)
{
Put1Byte(isec1[24+i]);
}
/* 12 bytes explicitly encoded below: */
/* 12 bytes explicitly encoded below: */
Put1Byte(isec1[36]); /* ECMWF local GRIB use definition identifier */
/* 1=MARS labelling or ensemble fcst. data */
Put1Byte(isec1[37]); /* Class */
......@@ -3792,6 +3809,27 @@ void encodePDS_ECMWF_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1)
*zs = z;
}
static
void encodePDS_MPIM_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1)
{
// int isvn;
long localextlen, i;
long z = *zs;
localextlen = getLocalExtLen(isec1);
for ( i = 0; i < localextlen-6; i++ )
{
Put1Byte(isec1[24+i]);
}
/* 6 bytes explicitly encoded below: */
Put1Byte(isec1[36]); /* MPIM local GRIB use definition identifier */
/* (extension identifier) */
Put1Byte(isec1[37]); /* type of ensemble forecast */
Put2Byte(isec1[38]); /* individual ensemble member */
Put2Byte(isec1[39]); /* number of forecasts in ensemble */
*zs = z;
}
/* GRIB BLOCK 1 - PRODUCT DESCRIPTION SECTION */
static
......@@ -3898,6 +3936,13 @@ void encodePDS(GRIBPACK *lpds, long pdsLen, int *isec1)
encodePDS_ECMWF_local_Extension_1(lGrib, &z, isec1);
}
}
else if ( ISEC1_CenterID == 252 )
{
if ( isec1[36] == 1 )
{
encodePDS_MPIM_local_Extension_1(lGrib, &z, isec1);
}
}
else
{
long i, localextlen;
......@@ -4656,6 +4701,15 @@ void decodePDS_DWD_local_Extension_253(unsigned char *pds, int *isec1)
}
static
void decodePDS_MPIM_local_Extension_1(unsigned char *pds, int *isec1)
{
isec1[36] = GET_UINT1(pds[40]); /* extension identifier */
isec1[37] = GET_UINT1(pds[41]); /* type of ensemble forecast */
isec1[38] = GET_UINT2(pds[42],pds[43]); /* individual ensemble member */
isec1[39] = GET_UINT2(pds[44],pds[45]); /* number of forecasts in ensemble */
}
static
int decodePDS(unsigned char *pds, int *isec0, int *isec1)
{
......@@ -4771,6 +4825,11 @@ int decodePDS(unsigned char *pds, int *isec0, int *isec1)
if ( pds[40] == 1 )
decodePDS_ECMWF_local_Extension_1(pds, isec1);
}
else if ( ISEC1_CenterID == 252 && ISEC1_LocalFLag == 1 )
{
if ( pds[40] == 1 )
decodePDS_MPIM_local_Extension_1(pds, isec1);
}
else
{
long i;
......@@ -8543,7 +8602,7 @@ int grib2Sections(unsigned char *gribbuffer, long bufsize, unsigned char **idsp,
if ( sec_num < 1 || sec_num > 7 ) break;
if ( sec_num == 7 )
fprintf(stderr, "Skip unsupported multi GRIB section %d!\n", ++msec);
fprintf(stderr, "Skipped unsupported multi GRIB section %d!\n", ++msec);
if ( (grib_len + sec_len) > gribsize ) break;
......@@ -9783,7 +9842,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.5.2" " of ""May 11 2012"" ""14:32:49";
static const char grb_libvers[] = "1.5.3" " of ""Jun 8 2012"" ""10:20:01";
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