Commit 50e7bc9a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgriblib update

parent e2359159
......@@ -299,7 +299,8 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
#define BDS_RefValue decfp2((int)bds[ 6], GET_UINT3(bds[ 7], bds[ 8], bds[ 9]))
#define BDS_NumBits ((int) bds[10])
#define BDS_RealCoef decfp2((int)bds[zoff+11], GET_UINT3(bds[zoff+12], bds[zoff+13], bds[zoff+14]))
#define BDS_Power GET_INT2(bds[13], bds[14])
#define BDS_PackData ((int) ((bds[zoff+11]<<8) + bds[zoff+12]))
#define BDS_Power GET_INT2(bds[zoff+13], bds[zoff+14])
#define BDS_Z (bds[13])
/* GRIB1 Section 5: End Section (ES) */
......@@ -4645,6 +4646,7 @@ int decodeBDS(int decscale, unsigned char *bds, int *isec2, int *isec4,
}
else /* complex packed spherical harmonics */
{
isec4[15] = BDS_PackData;
/* scaling factor */
isec4[16] = BDS_Power;
......@@ -8851,7 +8853,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.4.3" " of ""Feb 15 2010"" ""11:31:39";
static const char grb_libvers[] = "1.4.3" " of ""Feb 15 2010"" ""13:50:31";
const char *
cgribexLibraryVersion(void)
{
......
......@@ -1553,7 +1553,7 @@ int cgribexDefTimerange(int tsteptype, int factor, int calendar,
*pip1 = ip1;
*pip2 = ip2;
// printf("timerange %d %d %d\n", timerange, ip1, ip2);
return (timerange);
}
......@@ -1831,10 +1831,15 @@ void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
ISEC2_PentaK = ISEC2_PentaJ;
ISEC2_PentaM = ISEC2_PentaJ;
ISEC2_RepType = 1;
isec4[2] = 128;
if ( gridInqComplexPacking(gridID) )
{
ISEC2_RepMode = 2;
isec4[3] = 64;
isec4[16] = 0;
isec4[17] = 20;
isec4[18] = 20;
isec4[19] = 20;
}
else
{
......@@ -2141,6 +2146,10 @@ size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
ISEC1_Sec2Or3Flag |= 64;
}
if ( isec4[2] == 128 && isec4[3] == 64 )
isec4[16] = (int) (1000*calculate_pfactor(data, ISEC2_PentaJ, isec4[17]));
//printf("isec4[16] %d\n", isec4[16]);
gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, (double*) data,
datasize, (int *) gribbuffer, gribsize, &iword, "C", &iret);
......
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