Commit 639a44d0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

vtime2timeval: check validity of month

parent 3845489a
......@@ -3,6 +3,10 @@
* Version 1.6.0 released
* using CGRIBEX library version 1.6.0
2013-03-08 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vtime2timeval: check validity of month
2013-03-07 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfDefGrid: bug fix for generic grids with nx or ny > 0
......
......@@ -1015,8 +1015,6 @@ double vtime2timeval(int vdate, int vtime, taxis_t *taxis)
{
int nmonth, dpm;
dpm = days_per_month(calendar, year, month);
value = (year-ryear)*12 - rmonth + month;
nmonth = (int) value;
......@@ -1025,6 +1023,8 @@ double vtime2timeval(int vdate, int vtime, taxis_t *taxis)
while ( month > 12 ) { month -= 12; year++; }
while ( month < 1 ) { month += 12; year--; }
dpm = days_per_month(calendar, year, month);
encode_caldaysec(calendar, year, month, day, hour, minute, second, &julday2, &secofday2);
julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
......
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