Commit 633d5a1a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

settaxis: set default increment to 1hour

parent b113b035
2016-02-24 Uwe Schulzweida
2016-02-25 Uwe Schulzweida
* using CDI library version 1.7.1
* Version 1.7.1 released
2016-02-22 Uwe Schulzweida
* settaxis: set default increment to 1hour
2016-02-08 Uwe Schulzweida
* expr: added support for function clon(), clat() and clev()
......
......@@ -128,7 +128,7 @@ STRING Date (format: YYYY-MM-DD)
@Item = time
STRING Time (format: hh:mm:ss)
@Item = inc
STRING Optional increment (seconds, minutes, hours, days, months, years) [default: 0hour]
STRING Optional increment (seconds, minutes, hours, days, months, years) [default: 1hour]
@Item = calendar
STRING Calendar (standard, proleptic_gregorian, 360_day, 365_day, 366_day)
@Item = sval
......
......@@ -114,7 +114,7 @@ void *Settime(void *argument)
int nmiss;
int gridsize;
int tunit = TUNIT_DAY;
int ijulinc = 0, incperiod = 0, incunit = 0;
int ijulinc = 0, incperiod = 1, incunit = 86400;
int year = 1, month = 1, day = 1, hour = 0, minute = 0, second = 0;
int day0;
int taxis_has_bounds, copy_timestep = FALSE;
......@@ -175,10 +175,13 @@ void *Settime(void *argument)
if ( operatorArgc() == 3 )
{
const char *timeunits = operatorArgv()[2];
incperiod = (int)strtol(timeunits, NULL, 10);
if ( timeunits[0] == '-' || timeunits[0] == '+' ) timeunits++;
while ( isdigit((int) *timeunits) ) timeunits++;
int ich = timeunits[0];
if ( ich == '-' || ich == '+' || isdigit(ich) )
{
incperiod = (int)strtol(timeunits, NULL, 10);
if ( ich == '-' || ich == '+' ) timeunits++;
while ( isdigit((int) *timeunits) ) timeunits++;
}
get_tunits(timeunits, &incperiod, &incunit, &tunit);
}
/* increment in seconds */
......
......@@ -956,7 +956,7 @@ static const char *SettimeHelp[] = {
" units STRING Base units of the time axis (seconds, minutes, hours, days, months, years)",
" date STRING Date (format: YYYY-MM-DD)",
" time STRING Time (format: hh:mm:ss)",
" inc STRING Optional increment (seconds, minutes, hours, days, months, years) [default: 0hour]",
" inc STRING Optional increment (seconds, minutes, hours, days, months, years) [default: 1hour]",
" calendar STRING Calendar (standard, proleptic_gregorian, 360_day, 365_day, 366_day)",
" sval STRING Shift value (e.g. -3hour)",
NULL
......
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