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

expr: added function cday(), cmonth(), cyear(), csecond(), cminute(), chour().

parent a2f50a16
......@@ -3,6 +3,10 @@
* Using CDI library version 1.9.3
* Version 1.9.3 release
2018-01-22 Uwe Schulzweida
*expr: added function cday(), cmonth(), cyear(), csecond(), cminute(), chour()
2018-01-18 Uwe Schulzweida
* expr: added function ctimestep(), cdate(), ctime(), cdeltat()
......
CDO NEWS
--------
Version 1.9.3 (23 February 2018):
New features:
* expr: added time coordinate function cdate(), ctime(), cdeltat(), ctimestep() ...
New operators:
* not - logical NOT (1, if x equal 0; else 0)
Fixed bugs:
* uvDestag: target grid undefined in output
* runpctl: fails since release 1.8.0
* read of reduced Gaussian grid description file failed [Bug #8146]
Version 1.9.2 (23 November 2017):
Fixed bugs:
......
......@@ -601,6 +601,18 @@ void *Expr(void *argument)
params[vartsID].data[CTIME] = vtime;
params[vartsID].data[CDELTAT] = jdelta;
int year, mon, day;
int hour, minute, second;
cdiDecodeDate(vdate, &year, &mon, &day);
cdiDecodeTime(vtime, &hour, &minute, &second);
params[vartsID].data[CDAY] = day;
params[vartsID].data[CMONTH] = mon;
params[vartsID].data[CYEAR] = year;
params[vartsID].data[CSECOND] = second;
params[vartsID].data[CMINUTE] = minute;
params[vartsID].data[CHOUR] = hour;
taxisCopyTimestep(taxisID2, taxisID1);
pstreamDefTimestep(streamID2, tsID);
......
......@@ -73,6 +73,12 @@ static double ts_ctimestep(double *data) { return lround(data[CTIMESTEP]); }
static double ts_cdate(double *data) { return lround(data[CDATE]); }
static double ts_ctime(double *data) { return lround(data[CTIME]); }
static double ts_cdeltat(double *data) { return data[CDELTAT]; }
static double ts_cday(double *data) { return data[CDAY]; }
static double ts_cmonth(double *data) { return data[CMONTH]; }
static double ts_cyear(double *data) { return data[CYEAR]; }
static double ts_csecond(double *data) { return data[CSECOND]; }
static double ts_cminute(double *data) { return data[CMINUTE]; }
static double ts_chour(double *data) { return data[CHOUR]; }
typedef struct {
int type;
......@@ -152,6 +158,12 @@ static func_t fun_sym_tbl[] =
{FT_0, 0, "cdate", (double (*)()) ts_cdate},
{FT_0, 0, "ctime", (double (*)()) ts_ctime},
{FT_0, 0, "cdeltat", (double (*)()) ts_cdeltat},
{FT_0, 0, "cday", (double (*)()) ts_cday},
{FT_0, 0, "cmonth", (double (*)()) ts_cmonth},
{FT_0, 0, "cyear", (double (*)()) ts_cyear},
{FT_0, 0, "csecond", (double (*)()) ts_csecond},
{FT_0, 0, "cminute", (double (*)()) ts_cminute},
{FT_0, 0, "chour", (double (*)()) ts_chour},
{FT_1C, 0, "sellevel", NULL},
{FT_1C, 0, "sellevidx", NULL},
......
......@@ -24,7 +24,7 @@ int fileno(FILE *stream);
extern int CDO_parser_errorno;
enum {CTIMESTEP, CDATE, CTIME, CDELTAT, CLEN};
enum {CTIMESTEP, CDATE, CTIME, CDELTAT, CDAY, CMONTH, CYEAR, CSECOND, CMINUTE, CHOUR, CLEN};
typedef enum { typeCon, typeVar, typeFun, typeFun1c, typeOpr, typeCom } nodeEnum;
......
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