Commit 13dbf909 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

splitBasetime: convert timeunit string to lower case

parent 55fd3444
2006-12-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de> 2006-11-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using GRIB library version 1.0.4
* splitBasetime: convert timeunit string to lower case
* new function: streamNvals * new function: streamNvals
* Version 1.0.4 released * Version 1.0.4 released
......
/* Generated automatically from m214003 on Fri Nov 3 13:30:05 CET 2006 */ /* Generated automatically from m214003 on Thu Nov 16 14:21:31 CET 2006 */
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include "config.h" # include "config.h"
...@@ -4260,10 +4260,15 @@ static int decodeBDS(int decscale, unsigned char *bds, int *isec2, int *isec4, d ...@@ -4260,10 +4260,15 @@ static int decodeBDS(int decscale, unsigned char *bds, int *isec2, int *isec4, d
if ( bds_aflag ) if ( bds_aflag )
{ {
/*
if ( irep == 0 ) if ( irep == 0 )
ISEC4_NumValues = ISEC2_NumLon*ISEC2_NumLat; ISEC4_NumValues = ISEC2_NumLon*ISEC2_NumLat;
else else
ISEC4_NumValues = (ISEC2_PentaJ+1)*(ISEC2_PentaJ+2); ISEC4_NumValues = (ISEC2_PentaJ+1)*(ISEC2_PentaJ+2);
*/
ISEC4_NumValues = GET_UINT3(bds[17],bds[18],bds[19])*8/ISEC4_NumBits;
if ( irep == 1 ) ISEC4_NumValues++;
} }
if ( dfunc == 'J' ) return (bdsLen); if ( dfunc == 'J' ) return (bdsLen);
...@@ -7995,7 +8000,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu ...@@ -7995,7 +8000,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen); return (gribLen);
} }
static const char grb_libvers[] = "1.0.3" " of ""Nov 3 2006"" ""13:30:06"; static const char grb_libvers[] = "1.0.4" " of ""Nov 16 2006"" ""14:21:31";
......
...@@ -96,7 +96,7 @@ NCVAR; ...@@ -96,7 +96,7 @@ NCVAR;
static int splitBasetime(char *timeunits, TAXIS *taxis) static int splitBasetime(char *timeunits, TAXIS *taxis)
{ {
static char func[] = "splitBasetime"; static char func[] = "splitBasetime";
int len; int len, i;
char *ptu; char *ptu;
int year, month, day; int year, month, day;
int hour = 0, minute = 0, second = 0; int hour = 0, minute = 0, second = 0;
...@@ -107,6 +107,8 @@ static int splitBasetime(char *timeunits, TAXIS *taxis) ...@@ -107,6 +107,8 @@ static int splitBasetime(char *timeunits, TAXIS *taxis)
ptu = timeunits; ptu = timeunits;
len = (int) strlen(timeunits); len = (int) strlen(timeunits);
for ( i = 0; i < len; i++ ) ptu[i] = tolower((int) ptu[i]);
(*taxis).type = timetype; (*taxis).type = timetype;
if ( strncmp(ptu, "sec", 3) == 0 ) timeunit = TUNIT_SECOND; if ( strncmp(ptu, "sec", 3) == 0 ) timeunit = TUNIT_SECOND;
...@@ -118,7 +120,7 @@ static int splitBasetime(char *timeunits, TAXIS *taxis) ...@@ -118,7 +120,7 @@ static int splitBasetime(char *timeunits, TAXIS *taxis)
else if ( strncmp(ptu, "year", 4) == 0 ) timeunit = TUNIT_YEAR; else if ( strncmp(ptu, "year", 4) == 0 ) timeunit = TUNIT_YEAR;
else else
{ {
Message(func, "Unsupported TIMEUNIT %s!", ptu); Message(func, "Unsupported TIMEUNIT: %s!", ptu);
return (1); return (1);
} }
......
...@@ -1327,8 +1327,8 @@ int grbScanTimestep2(int streamID) ...@@ -1327,8 +1327,8 @@ int grbScanTimestep2(int streamID)
gridID = vlistInqVarGrid(vlistID, varID); gridID = vlistInqVarGrid(vlistID, varID);
if ( gridInqSize(gridID) == 1 && gridInqType(gridID) == GRID_LONLAT ) if ( gridInqSize(gridID) == 1 && gridInqType(gridID) == GRID_LONLAT )
{ {
if ( gridInqXval(gridID, 0) != ISEC2_FirstLon*0.001 || if ( !DBL_IS_EQUAL(gridInqXval(gridID, 0),ISEC2_FirstLon*0.001) ||
gridInqYval(gridID, 0) != ISEC2_FirstLat*0.001 ) !DBL_IS_EQUAL(gridInqYval(gridID, 0),ISEC2_FirstLat*0.001) )
gridChangeType(gridID, GRID_TRAJECTORY); gridChangeType(gridID, GRID_TRAJECTORY);
} }
} }
......
...@@ -627,7 +627,7 @@ void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime) ...@@ -627,7 +627,7 @@ void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime)
double value, factor = 1; double value, factor = 1;
int timeunit; int timeunit;
int calendar, dpy = 0; int calendar, dpy = 0;
double second; double second = 0;
static int lwarn = TRUE; static int lwarn = TRUE;
*vdate = 0; *vdate = 0;
...@@ -688,7 +688,7 @@ void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime) ...@@ -688,7 +688,7 @@ void timeval2vtime(double timevalue, TAXIS *taxis, int *vdate, int *vtime)
} }
*vdate = year*10000 + month*100 + day; *vdate = year*10000 + month*100 + day;
*vtime = hour*100 + minute; *vtime = hour*100 + minute /* + (int) (second/60+0.5)*/;
} }
......
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