Commit a63da19b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

change default calendar to CALENDAR_PROLEPTIC

parent b05a6613
......@@ -2,6 +2,7 @@
* add support for NaN in DBL_IS_EQUAL
* add support for GRID type LCC2 (LCC PROJ.4 version)
* grbDefTime: define tunit also for absolute time [report: Pruek Pongprueksa]
* change default calendar to CALENDAR_PROLEPTIC
* streamOpenAppen: set ncmode to 2 (bug fix)
* Version 1.3.0 released
......
/* Generated automatically from m214003 on Tue Feb 17 15:08:43 CET 2009 */
/* Generated automatically from m214003 on Wed Feb 25 14:24:51 CET 2009 */
/* GRIBLIB_VERSION="1.2.2" */
......@@ -1022,7 +1022,7 @@ void gribDateTime(int *isec1, int *date, int *time)
static char func[] = "gribDateTime";
static int lprint = TRUE;
int ryear, rmonth, rday, rhour, rminute;
int time_period;
int time_period = 0;
int julday, secofday, addsec;
int century;
......@@ -1059,33 +1059,32 @@ void gribDateTime(int *isec1, int *date, int *time)
if ( ISEC1_TimeRange == 10 )
time_period = (ISEC1_TimePeriod1<<8) + ISEC1_TimePeriod2;
else
else if ( ISEC1_TimeRange >=2 && ISEC1_TimeRange <= 5 )
time_period = ISEC1_TimePeriod2;
else if ( ISEC1_TimeRange == 0 )
time_period = ISEC1_TimePeriod1;
if ( time_period > 0 && rday > 0 )
{
if ( ISEC1_TimeRange == 0 || ISEC1_TimeRange == 10 )
{
encode_juldaysec(0, ryear, rmonth, rday, rhour, rminute, &julday, &secofday);
encode_juldaysec(0, ryear, rmonth, rday, rhour, rminute, &julday, &secofday);
addsec = 0;
switch ( ISEC1_TimeUnit )
addsec = 0;
switch ( ISEC1_TimeUnit )
{
case ISEC1_TABLE4_MINUTE: addsec = 60 * time_period; break;
case ISEC1_TABLE4_HOUR: addsec = 3600 * time_period; break;
case ISEC1_TABLE4_DAY: addsec = 86400 * time_period; break;
default:
if ( lprint )
{
case ISEC1_TABLE4_MINUTE: addsec = 60 * time_period; break;
case ISEC1_TABLE4_HOUR: addsec = 3600 * time_period; break;
case ISEC1_TABLE4_DAY: addsec = 86400 * time_period; break;
default:
if ( lprint )
{
gprintf(func, "Time unit %d unsupported", ISEC1_TimeUnit);
lprint = FALSE;
}
gprintf(func, "Time unit %d unsupported", ISEC1_TimeUnit);
lprint = FALSE;
}
}
julday_add_seconds(addsec, &julday, &secofday);
julday_add_seconds(addsec, &julday, &secofday);
decode_juldaysec(0, julday, secofday, &ryear, &rmonth, &rday, &rhour, &rminute);
}
decode_juldaysec(0, julday, secofday, &ryear, &rmonth, &rday, &rhour, &rminute);
}
/*
printf("new %d/%d/%d %d:%d\n", ryear, rmonth, rday, rhour, rminute);
......@@ -8379,7 +8378,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.2.2" " of ""Feb 17 2009"" ""15:08:43";
static const char grb_libvers[] = "1.2.2" " of ""Feb 25 2009"" ""14:24:52";
const char *
gribLibraryVersion(void)
{
......
......@@ -5494,16 +5494,16 @@ int cdfInqContents(int streamID)
taxis->calendar = calendar;
taxisDefCalendar(taxisID, calendar);
}
else
{/*
printf("cal %d %d %d\n", calendar, streamptr->tsteps[0].taxis.type, TAXIS_RELATIVE);
printf("inq1 %d\n", taxisInqCalendar(taxisID));
*/
if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
taxisDefCalendar(taxisID, CALENDAR_STANDARD);
/*
printf("inq2 %d\n", taxisInqCalendar(taxisID));
*/
else if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
{
TAXIS *taxis;
calendar = CALENDAR_STANDARD;
taxis = &streamptr->tsteps[0].taxis;
taxis->calendar = calendar;
taxisDefCalendar(taxisID, calendar);
}
vlistDefTaxis(vlistID, taxisID);
......
......@@ -1211,6 +1211,7 @@ void grbScanTimestep1(int streamID)
{
taxisID = taxisCreate(TAXIS_ABSOLUTE);
taxis->type = TAXIS_ABSOLUTE;
taxis->unit = tunit;
}
taxis->vdate = datetime0.date;
......@@ -1804,7 +1805,13 @@ void grbDefTime(int *isec1, int date, int time, int numavg, int timeID)
ISEC1_Hour = hour;
ISEC1_Minute = minute;
ISEC1_TimeUnit = 0;
/* ISEC1_TimeUnit = 0; */
switch (taxisInqTunit(timeID))
{
case TUNIT_MINUTE: ISEC1_TimeUnit = ISEC1_TABLE4_MINUTE; break;
case TUNIT_HOUR: ISEC1_TimeUnit = ISEC1_TABLE4_HOUR; break;
case TUNIT_DAY: ISEC1_TimeUnit = ISEC1_TABLE4_DAY; break;
}
if ( numavg > 0 )
ISEC1_TimeRange = 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