Commit 592f6f1c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

expr: added constant _TS

parent 0fa82fc7
......@@ -14,7 +14,7 @@ respectively. The default number of histogram bins is 101. The default can be ov
the environment variable @env{CDO_PCTL_NBINS} to a different value. The files @file{ifile2} and
@file{ifile3} should be the result of corresponding @mod{seasmin} and @mod{seasmax} operations, respectively.
The time stamp in @file{ofile} is from the middle contributing timestep of @file{ifile1}.
Be careful about the first and the last output timestep , they may be incorrect values
Be careful about the first and the last output timestep, they may be incorrect values
if the seasons have incomplete timesteps.
@EndDescription
@EndModule
......
......@@ -12,7 +12,7 @@ This module computes statistical values over timesteps of the same season.
Depending on the chosen operator the minimum, maximum, sum, average, variance
or standard deviation of timesteps of the same season is written to @file{ofile}.
The time stamp in @file{ofile} is from the middle contributing timestep of @file{ifile}.
Be careful about the first and the last output timestep , they may be incorrect values
Be careful about the first and the last output timestep, they may be incorrect values
if the seasons have incomplete timesteps.
@EndDescription
@EndModule
......
......@@ -131,6 +131,30 @@ paramType *params_new(int vlistID1)
return params;
}
static
int params_add_ts(parse_param_t *parse_arg)
{
int varID = -1;
paramType *params = parse_arg->params;
if ( params )
{
varID = parse_arg->nparams;
if ( varID >= parse_arg->maxparams )
cdoAbort("Too many parameter (limit=%d)", parse_arg->maxparams);
params[varID].name = strdup("_TS");
params[varID].gridID = parse_arg->pointID;
params[varID].zaxisID = parse_arg->surfaceID;
params[varID].steptype = TIME_VARIABLE;
params[varID].ngp = 1;
params[varID].nlev = 1;
parse_arg->nparams++;
}
return varID;
}
static
void params_delete(paramType *params)
{
......@@ -205,6 +229,8 @@ void *Expr(void *argument)
for ( int varID = 0; varID < nvars1; varID++ )
parse_arg.needed[varID] = ! REPLACES_VARIABLES(operatorID);
int vartsID = params_add_ts(&parse_arg);
yy_scan_string(exprs, scanner);
yyparse(&parse_arg, scanner);
......@@ -327,6 +353,7 @@ void *Expr(void *argument)
int tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
{
params[vartsID].data[0] = tsID+1;
taxisCopyTimestep(taxisID2, taxisID1);
streamDefTimestep(streamID2, tsID);
......
......@@ -305,8 +305,9 @@ REMAP_REF = n16_bic_ref n16_bil_ref n16_con_ref n16_ycon_ref n16_laf_ref n16_nn_
SELECT_REF = select1_ref select2_ref select3_ref select4_ref select5_ref
DETREND_REF = detrend_ref
EXPR_REF = expr1_ref aexpr1_ref expr2_ref aexpr2_ref
GRADSDES_REF = pl_data.ctl pl_data.gmp
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(GRADSDES_REF)
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(EXPR_REF) $(GRADSDES_REF)
all: all-am
.SUFFIXES:
......
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