Commit 9df36ae3 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexDefTime: bug fix for timerange=3

parent 83d127db
2010-03-31 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cgribexDefTime: bug fix for timerange=3
* using CGRIBEX library version 1.4.4
2010-03-30 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de> 2010-03-30 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vlistCat: correct temporary parameter numbers * vlistCat: correct temporary parameter numbers
......
/* Automatically generated by m214003 at 2010-03-24, do not edit */ /* Automatically generated by m214003 at 2010-03-31, do not edit */
/* CGRIBEXLIB_VERSION="1.4.4" */ /* CGRIBEXLIB_VERSION="1.4.4" */
...@@ -3029,46 +3029,36 @@ void encodePDS(GRIBPACK *lpds, long pdsLen, int *isec1) ...@@ -3029,46 +3029,36 @@ void encodePDS(GRIBPACK *lpds, long pdsLen, int *isec1)
Put1Byte(ISEC1_Day); /* 14 Day */ Put1Byte(ISEC1_Day); /* 14 Day */
Put1Byte(ISEC1_Hour); /* 15 Hour */ Put1Byte(ISEC1_Hour); /* 15 Hour */
Put1Byte(ISEC1_Minute); /* 16 Minute */ Put1Byte(ISEC1_Minute); /* 16 Minute */
if ( ISEC1_AvgNum > 0 )
Put1Byte(ISEC1_TimeUnit); /* 17 Time unit */
if ( ISEC1_TimeRange == 10 )
{
Put1Byte(ISEC1_TimePeriod1);
Put1Byte(ISEC1_TimePeriod2);
}
else if ( ISEC1_TimeRange == 113 || ISEC1_TimeRange == 0 )
{ {
Put1Byte(2); /* 17 Time unit */ Put1Byte(ISEC1_TimePeriod1);
Put1Byte(0); /* 18 Time 1 */ Put1Byte(0);
Put1Byte(0); /* 19 Time 2 */ }
Put1Byte(3); /* 20 Timerange flag */ else if ( ISEC1_TimeRange == 5 || ISEC1_TimeRange == 4 ||
Put2Byte(ISEC1_AvgNum); /* 21 Average */ ISEC1_TimeRange == 3 || ISEC1_TimeRange == 2 )
{
Put1Byte(0);
Put1Byte(ISEC1_TimePeriod2);
} }
else else
{ {
Put1Byte(ISEC1_TimeUnit); /* 17 Time unit */ Put1Byte(0);
if ( ISEC1_TimeRange == 10 ) Put1Byte(0);
{
Put1Byte(ISEC1_TimePeriod1);
Put1Byte(ISEC1_TimePeriod2);
}
else if ( ISEC1_TimeRange == 113 || ISEC1_TimeRange == 0 )
{
Put1Byte(ISEC1_TimePeriod1);
Put1Byte(0);
}
else if ( ISEC1_TimeRange == 5 || ISEC1_TimeRange == 4 ||
ISEC1_TimeRange == 3 || ISEC1_TimeRange == 2 )
{
Put1Byte(0);
Put1Byte(ISEC1_TimePeriod2);
}
else
{
Put1Byte(0);
Put1Byte(0);
}
Put1Byte(ISEC1_TimeRange); /* 20 Timerange flag */
Put2Byte(ISEC1_AvgNum); /* 21 Average */
} }
Put1Byte(ISEC1_TimeRange); /* 20 Timerange flag */
Put2Byte(ISEC1_AvgNum); /* 21 Average */
Put1Byte(ISEC1_AvgMiss); /* 23 Missing from averages */ Put1Byte(ISEC1_AvgMiss); /* 23 Missing from averages */
Put1Byte(century); /* 24 Century */ Put1Byte(century); /* 24 Century */
Put1Byte(ISEC1_SubCenterID); /* 25 Subcenter */ Put1Byte(ISEC1_SubCenterID); /* 25 Subcenter */
Put2Byte(ISEC1_DecScaleFactor); /* 26 Decimal scale factor */ Put2Byte(ISEC1_DecScaleFactor); /* 26 Decimal scale factor */
if ( ISEC1_LocalFLag ) if ( ISEC1_LocalFLag )
{ {
...@@ -8853,7 +8843,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu ...@@ -8853,7 +8843,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen); return (gribLen);
} }
static const char grb_libvers[] = "1.4.4" " of ""Mar 24 2010"" ""15:35:19"; static const char grb_libvers[] = "1.4.4" " of ""Mar 31 2010"" ""09:12:03";
const char * const char *
cgribexLibraryVersion(void) cgribexLibraryVersion(void)
{ {
......
...@@ -1632,11 +1632,11 @@ void cgribexDefTime(int *isec1, int vdate, int vtime, int tsteptype, int numavg, ...@@ -1632,11 +1632,11 @@ void cgribexDefTime(int *isec1, int vdate, int vtime, int tsteptype, int numavg,
timerange = cgribexDefTimerange(tsteptype, factor, calendar, timerange = cgribexDefTimerange(tsteptype, factor, calendar,
rdate, rtime, vdate, vtime, &ip1, &ip2); rdate, rtime, vdate, vtime, &ip1, &ip2);
if ( timerange == -1 ) if ( timerange == -1 || timerange == 3 )
{ {
timetype = TAXIS_ABSOLUTE; timetype = TAXIS_ABSOLUTE;
} }
if ( timerange == 10 ) else if ( timerange == 10 )
{ {
if ( ip1 < 0 || ip1 > 0xFFFF ) timetype = TAXIS_ABSOLUTE; if ( ip1 < 0 || ip1 > 0xFFFF ) timetype = TAXIS_ABSOLUTE;
if ( ip2 < 0 || ip2 > 0xFFFF ) timetype = TAXIS_ABSOLUTE; if ( ip2 < 0 || ip2 > 0xFFFF ) timetype = TAXIS_ABSOLUTE;
...@@ -1661,7 +1661,9 @@ void cgribexDefTime(int *isec1, int vdate, int vtime, int tsteptype, int numavg, ...@@ -1661,7 +1661,9 @@ void cgribexDefTime(int *isec1, int vdate, int vtime, int tsteptype, int numavg,
ISEC1_TimeRange = 0; ISEC1_TimeRange = 0;
else else
*/ */
ISEC1_TimeRange = 10; if ( ISEC1_TimeRange != 3 )
ISEC1_TimeRange = 10;
ISEC1_TimePeriod1 = 0; ISEC1_TimePeriod1 = 0;
ISEC1_TimePeriod2 = 0; ISEC1_TimePeriod2 = 0;
} }
......
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