Commit 015170ec authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

inttime: extention for months and years

parent bafa8785
2006-11-?? Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using CDI library version 1.0.3
* inttime: extention for months and years
* remaplib.sort_add: don't sort if num_links <= 1
* remaplib.remap_bi?: check that src_add is valid
* Remap: use REMAP_NON_GLOBAL only for gridsize > 1
......
No preview for this file type
......@@ -146,7 +146,7 @@
\end{picture}
\begin{flushright}
\large\bf{Climate Data Operators \\ Version 1.0.2 \\ September 2006}
\large\bf{Climate Data Operators \\ Version 1.0.3 \\ October 2006}
\end{flushright}
\vfill
......
......@@ -10,7 +10,7 @@
\put(0,0.0){\line(1,0){3.95}}
\end{picture}
\begin{flushright}
{\small{Climate Data Operators \\ Version 1.0.2 \\ September 2006}}
{\small{Climate Data Operators \\ Version 1.0.3 \\ October 2006}}
\end{flushright}
\vspace*{0mm}
......
......@@ -23,7 +23,7 @@ STRING Start date (format YYYY-MM-DD)
@Item = time
STRING Start time (format hh:mm)
@Item = inc
STRING Optional increment (minutes, hours or days) [default: 0hour]
STRING Optional increment (minutes, hours, days, months, years) [default: 0hour]
@EndParameter
@EndOperator
......
......@@ -122,13 +122,13 @@ INTEGER Value of the new month
@Item = year
INTEGER Value of the new year
@Item = units
STRING Base units of the time axis (minutes, hours, days, months, years).
STRING Base units of the time axis (minutes, hours, days, months, years)
@Item = date
STRING Date (format YYYY-MM-DD)
@Item = time
STRING Time (format HH:MM)
@Item = inc
STRING Optional increment (e.g. 12hour) [default: 0hour]
STRING Optional increment (minutes, hours, days, months, years) [default: 0hour]
@Item = calendar
STRING Calendar (standard, 360days, 365days, 366days)
@Item = sval
......
......@@ -96,10 +96,8 @@ void *Inttime(void *argument)
if ( strncmp(unit, "minutes", len) == 0 ) incunit = 60;
else if ( strncmp(unit, "hours", len) == 0 ) incunit = 3600;
else if ( strncmp(unit, "days", len) == 0 ) incunit = 86400;
/*
else if ( strncmp(unit, "months", len) == 0 ) incunit = 1;
else if ( strncmp(unit, "years", len) == 0 ) incunit = 12;
*/
else cdoAbort("unsupported time unit >%s<", unit);
}
}
......@@ -265,8 +263,28 @@ void *Inttime(void *argument)
streamWriteRecord(streamID2, array, nmiss3);
}
}
if ( ijulinc == 0 ) break;
julval += ijulinc;
if ( incunit == 1 || incunit == 12 )
{
decode_julval(dpy, julval, &vdate, &vtime);
decode_date(vdate, &year, &month, &day);
month += ijulinc;
while ( month > 12 ) { month -= 12; year++; }
while ( month < 1 ) { month += 12; year--; }
vdate = year*10000 + month*100 + day;
julval = encode_julval(dpy, vdate, vtime);
}
else
{
julval += ijulinc;
}
}
julval1 = julval2;
......
......@@ -293,9 +293,7 @@ void *Settime(void *argument)
}
else
{
year = vdate/10000;
month = (vdate - year*10000) / 100;
day = vdate - year*10000 - month*100;
decode_date(vdate, &year, &month, &day);
month += ijulinc;
......@@ -322,17 +320,8 @@ void *Settime(void *argument)
month += ijulinc;
while ( month > 12 )
{
month -= 12;
year++;
}
while ( month < 1 )
{
month += 12;
year--;
}
while ( month > 12 ) { month -= 12; year++; }
while ( month < 1 ) { month += 12; year--; }
vdate = year*10000 + month*100 + day;
}
......
Supports Markdown
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