Commit b095a2bc authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

Merge branch 'develop' of git.mpimet.mpg.de:cdo into develop

parents 59bcc14f e305b290
......@@ -3,6 +3,20 @@
* Using CDI library version 1.9.0
* Version 1.9.0 release
2017-06-02 Uwe Schulzweida
* New operator ensrange: Ensemble range (ensmax-ensmin)
* New operator vertrange: Vertical range (vertmax-vertmin)
* New operator merrange: Meridional range (mermax-mermin)
* New operator gridboxrange: Gridbox range (gribboxmax-gridboxmin)
2017-06-01 Uwe Schulzweida
* New operator yhourrange: Multi-year hourly range (yhourmax-yhourmin)
* New operator ydayrange: Multi-year daily range (ydaymax-ydaymin)
* New operator ymonrange: Multi-year monthly range (ymonmax-ymonmin)
* New operator yseasrange: Multi-year seasonal range (yseasmax-yseasmin)
2017-05-30 Uwe Schulzweida
* New operator seasrange: seasonal range (seasmax-seasmin)
......
......@@ -243,6 +243,7 @@ Operator catalog:
Consecstat consects Consecutive Timesteps
Ensstat ensmin Ensemble minimum
Ensstat ensmax Ensemble maximum
Ensstat ensrange Ensemble range
Ensstat enssum Ensemble sum
Ensstat ensmean Ensemble mean
Ensstat ensavg Ensemble average
......@@ -280,6 +281,7 @@ Operator catalog:
Zonstat zonpctl Zonal percentiles
Merstat mermin Meridional minimum
Merstat mermax Meridional maximum
Merstat merrange Meridional range
Merstat mersum Meridional sum
Merstat mermean Meridional mean
Merstat meravg Meridional average
......@@ -290,6 +292,7 @@ Operator catalog:
Merstat merpctl Meridional percentiles
Gridboxstat gridboxmin Gridbox minimum
Gridboxstat gridboxmax Gridbox maximum
Gridboxstat gridboxrange Gridbox range
Gridboxstat gridboxsum Gridbox sum
Gridboxstat gridboxmean Gridbox mean
Gridboxstat gridboxavg Gridbox average
......@@ -299,6 +302,7 @@ Operator catalog:
Gridboxstat gridboxvar1 Gridbox variance (n-1)
Vertstat vertmin Vertical minimum
Vertstat vertmax Vertical maximum
Vertstat vertrange Vertical range
Vertstat vertsum Vertical sum
Vertstat vertmean Vertical mean
Vertstat vertavg Vertical average
......@@ -397,6 +401,7 @@ Operator catalog:
Seaspctl seaspctl Seasonal percentiles
Yhourstat yhourmin Multi-year hourly minimum
Yhourstat yhourmax Multi-year hourly maximum
Yhourstat yhourrange Multi-year hourly range
Yhourstat yhoursum Multi-year hourly sum
Yhourstat yhourmean Multi-year hourly mean
Yhourstat yhouravg Multi-year hourly average
......@@ -406,6 +411,7 @@ Operator catalog:
Yhourstat yhourvar1 Multi-year hourly variance (n-1)
Ydaystat ydaymin Multi-year daily minimum
Ydaystat ydaymax Multi-year daily maximum
Ydaystat ydayrange Multi-year daily range
Ydaystat ydaysum Multi-year daily sum
Ydaystat ydaymean Multi-year daily mean
Ydaystat ydayavg Multi-year daily average
......@@ -416,6 +422,7 @@ Operator catalog:
Ydaypctl ydaypctl Multi-year daily percentiles
Ymonstat ymonmin Multi-year monthly minimum
Ymonstat ymonmax Multi-year monthly maximum
Ymonstat ymonrange Multi-year monthly range
Ymonstat ymonsum Multi-year monthly sum
Ymonstat ymonmean Multi-year monthly mean
Ymonstat ymonavg Multi-year monthly average
......@@ -426,6 +433,7 @@ Operator catalog:
Ymonpctl ymonpctl Multi-year monthly percentiles
Yseasstat yseasmin Multi-year seasonal minimum
Yseasstat yseasmax Multi-year seasonal maximum
Yseasstat yseasrange Multi-year seasonal range
Yseasstat yseassum Multi-year seasonal sum
Yseasstat yseasmean Multi-year seasonal mean
Yseasstat yseasavg Multi-year seasonal average
......
......@@ -288,6 +288,7 @@ while (<MOFILE>) {
# print TRCARD "\\makebox[0.65in][c]{\$<\\!stat\\!>\$} \\\\ \\hline\n";
print TRCARD "minimum & \\textbf{min} \\\\ \n";
print TRCARD "maximum & \\textbf{max} \\\\ \n";
print TRCARD "range & \\textbf{range} \\\\ \n";
print TRCARD "sum & \\textbf{sum} \\\\ \n";
print TRCARD "mean & \\textbf{mean} \\\\ \n";
print TRCARD "average & \\textbf{avg} \\\\ \n";
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infiles outfile
@Operators = ensmin ensmax enssum ensmean ensavg ensstd ensstd1 ensvar ensvar1 enspctl
@Operators = ensmin ensmax ensrange enssum ensmean ensavg ensstd ensstd1 ensvar ensvar1 enspctl
@BeginDescription
This module computes statistical values over an ensemble of input files.
Depending on the chosen operator the minimum, maximum, sum, average, variance,
Depending on the chosen operator the minimum, maximum, range, sum, average, variance,
standard deviation or a certain percentile over all input files is written
to @file{outfile}.
All input files need to have the same structure with the same variables.
......@@ -33,6 +33,7 @@ o(t,x) = \mbox{\textbf{min}}\{i_1(t,x), i_2(t,x), \cdots, i_n(t,x)\}
@EndDescription
@EndOperator
@BeginOperator_ensmax
@Title = Ensemble maximum
......@@ -49,6 +50,22 @@ o(t,x) = \mbox{\textbf{max}}\{i_1(t,x), i_2(t,x), \cdots, i_n(t,x)\}
@EndOperator
@BeginOperator_ensrange
@Title = Ensemble range
@BeginDescription
@IfMan
o(t,x) = range{i1(t,x), i2(t,x), ..., in(t,x)}
@EndifMan
@IfDoc
@BeginMath
o(t,x) = \mbox{\textbf{range}}\{i_1(t,x), i_2(t,x), \cdots, i_n(t,x)\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator
@BeginOperator_enssum
@Title = Ensemble sum
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infile outfile
@Operators = gridboxmin gridboxmax gridboxsum gridboxmean gridboxavg gridboxstd gridboxstd1 gridboxvar gridboxvar1
@Operators = gridboxmin gridboxmax gridboxrange gridboxsum gridboxmean gridboxavg gridboxstd gridboxstd1 gridboxvar gridboxvar1
@BeginDescription
This module computes statistical values over surrounding grid boxes.
According to the chosen operator the minimum, maximum, sum, average,
According to the chosen operator the minimum, maximum, range, sum, average,
variance, or standard deviation of the neighboring grid boxes is written to @file{outfile}.
All gridbox operators only works on quadrilateral curvilinear grids.
@EndDescription
......@@ -36,6 +36,16 @@ Maximum value of the selected grid boxes.
@EndOperator
@BeginOperator_gridboxrange
@Title = Gridbox range
@Parameter = nx ny
@BeginDescription
Range (max-min value) of the selected grid boxes.
@EndDescription
@EndOperator
@BeginOperator_gridboxsum
@Title = Gridbox sum
@Parameter = nx ny
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infile outfile
@Operators = mermin mermax mersum mermean meravg merstd merstd1 mervar mervar1 merpctl
@Operators = mermin mermax merrange mersum mermean meravg merstd merstd1 mervar mervar1 merpctl
@BeginDescription
This module computes meridional statistical values of the input fields.
According to the chosen operator the meridional minimum, maximum, sum, average,
According to the chosen operator the meridional minimum, maximum, range, sum, average,
variance, standard deviation or a certain percentile is written to @file{outfile}.
This operator requires all variables on the same regular lon/lat grid.
@EndDescription
......@@ -34,6 +34,15 @@ For every longitude the maximum over all latitudes is computed.
@EndOperator
@BeginOperator_merrange
@Title = Meridional range
@BeginDescription
For every longitude the range over all latitudes is computed.
@EndDescription
@EndOperator
@BeginOperator_mersum
@Title = Meridional sum
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infile outfile
@Operators = vertmin vertmax vertsum vertmean vertavg vertstd vertstd1 vertvar vertvar1
@Operators = vertmin vertmax vertrange vertsum vertmean vertavg vertstd vertstd1 vertvar vertvar1
@BeginDescription
This module computes statistical values over all levels of the input variables.
According to chosen operator the vertical minimum, maximum, sum, average, variance
According to chosen operator the vertical minimum, maximum, range, sum, average, variance
or standard deviation is written to @file{outfile}.
@EndDescription
@EndModule
......@@ -33,6 +33,15 @@ For every gridpoint the maximum over all levels is computed.
@EndOperator
@BeginOperator_vertrange
@Title = Vertical range
@BeginDescription
For every gridpoint the range over all levels is computed.
@EndDescription
@EndOperator
@BeginOperator_vertsum
@Title = Vertical sum
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infile outfile
@Operators = ydaymin ydaymax ydaysum ydaymean ydayavg ydaystd ydaystd1 ydayvar ydayvar1
@Operators = ydaymin ydaymax ydayrange ydaysum ydaymean ydayavg ydaystd ydaystd1 ydayvar ydayvar1
@BeginDescription
This module computes statistical values of each day of year.
Depending on the chosen operator the minimum, maximum, sum, average, variance
Depending on the chosen operator the minimum, maximum, range, sum, average, variance
or standard deviation of each day of year in @file{infile} is written to @file{outfile}.
The date information in an output field is the date of the last contributing input field.
@EndModule
......@@ -59,6 +59,28 @@ o(\mbox{366},x) = \mbox{\textbf{max}}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \
@EndOperator
@BeginOperator_ydayrange
@Title = Multi-year daily range
@BeginDescription
@IfMan
o(001,x) = range{i(t,x), day(i(t)) = 001}
...
o(366,x) = range{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator
@BeginOperator_ydaysum
@Title = Multi-year daily sum
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infile outfile
@Operators = yhourmin yhourmax yhoursum yhourmean yhouravg yhourstd yhourstd1 yhourvar yhourvar1
@Operators = yhourmin yhourmax yhourrange yhoursum yhourmean yhouravg yhourstd yhourstd1 yhourvar yhourvar1
@BeginDescription
This module computes statistical values of each hour and day of year.
Depending on the chosen operator the minimum, maximum, sum, average, variance
Depending on the chosen operator the minimum, maximum, range, sum, average, variance
or standard deviation of each hour and day of year in @file{infile} is written to @file{outfile}.
The date information in an output field is the date of the last contributing input field.
@EndModule
......@@ -59,6 +59,28 @@ o(\mbox{8784},x) = \mbox{\textbf{max}}\{i(t,x), \mbox{day}(i(t)) = \mbox{8784}\}
@EndOperator
@BeginOperator_yhourrange
@Title = Multi-year hourly range
@BeginDescription
@IfMan
o(0001,x) = range{i(t,x), day(i(t)) = 0001}
...
o(8784,x) = range{i(t,x), day(i(t)) = 8784}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{0001},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{day}(i(t)) = \mbox{0001}\} \\
\vdots \\
o(\mbox{8784},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{day}(i(t)) = \mbox{8784}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator
@BeginOperator_yhoursum
@Title = Multi-year hourly sum
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infile outfile
@Operators = ymonmin ymonmax ymonsum ymonmean ymonavg ymonstd ymonstd1 ymonvar ymonvar1
@Operators = ymonmin ymonmax ymonrange ymonsum ymonmean ymonavg ymonstd ymonstd1 ymonvar ymonvar1
@BeginDescription
This module computes statistical values of each month of year.
Depending on the chosen operator the minimum, maximum, sum, average, variance
Depending on the chosen operator the minimum, maximum, range, sum, average, variance
or standard deviation of each month of year in @file{infile} is written to @file{outfile}.
The date information in an output field is the date of the last contributing input field.
@EndDescription
......@@ -60,6 +60,28 @@ o(\mbox{12},x) = \mbox{\textbf{max}}\{i(t,x), \mbox{month}(i(t)) = \mbox{12}\} \
@EndOperator
@BeginOperator_ymonrange
@Title = Multi-year monthly range
@BeginDescription
@IfMan
o(01,x) = range{i(t,x), month(i(t)) = 01}
...
o(12,x) = range{i(t,x), month(i(t)) = 12}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{01},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{month}(i(t)) = \mbox{01}\} \\
\vdots \\
o(\mbox{12},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{month}(i(t)) = \mbox{12}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator
@BeginOperator_ymonsum
@Title = Multi-year monthly sum
......
@BeginModule
@NewPage
@Name = Yseaspctl
@Title = Multi-year seasonal percentile values
@Section = Statistical values
......
......@@ -5,11 +5,11 @@
@Section = Statistical values
@Class = Statistic
@Arguments = infile outfile
@Operators = yseasmin yseasmax yseassum yseasmean yseasavg yseasstd yseasstd1 yseasvar yseasvar1
@Operators = yseasmin yseasmax yseasrange yseassum yseasmean yseasavg yseasstd yseasstd1 yseasvar yseasvar1
@BeginDescription
This module computes statistical values of each season.
Depending on the chosen operator the minimum, maximum, sum, average, variance
Depending on the chosen operator the minimum, maximum, range, sum, average, variance
or standard deviation of each season in @file{infile} is written to @file{outfile}.
The date information in an output field is the date of the last contributing input field.
@EndDescription
......@@ -64,6 +64,30 @@ o(\mbox{4},x) = \mbox{\textbf{max}}\{i(t,x), \mbox{month}(i(t)) = \mbox{09, 10,
@EndOperator
@BeginOperator_yseasrange
@Title = Multi-year seasonal range
@BeginDescription
@IfMan
o(1,x) = range{i(t,x), month(i(t)) = 12, 01, 02}
o(2,x) = range{i(t,x), month(i(t)) = 03, 04, 05}
o(3,x) = range{i(t,x), month(i(t)) = 06, 07, 08}
o(4,x) = range{i(t,x), month(i(t)) = 09, 10, 11}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{1},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{month}(i(t)) = \mbox{12, 01, 02}\} \\
o(\mbox{2},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{month}(i(t)) = \mbox{03, 04, 05}\} \\
o(\mbox{3},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{month}(i(t)) = \mbox{06, 07, 08}\} \\
o(\mbox{4},x) = \mbox{\textbf{range}}\{i(t,x), \mbox{month}(i(t)) = \mbox{09, 10, 11}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator
@BeginOperator_yseassum
@Title = Multi-year seasonal sum
......
......@@ -18,6 +18,7 @@
/*
This module contains the following operators:
Ensstat ensrange Ensemble range
Ensstat ensmin Ensemble minimum
Ensstat ensmax Ensemble maximum
Ensstat enssum Ensemble sum
......@@ -141,16 +142,17 @@ void *Ensstat(void *argument)
cdoInitialize(argument);
cdoOperatorAdd("ensmin", func_min, 0, NULL);
cdoOperatorAdd("ensmax", func_max, 0, NULL);
cdoOperatorAdd("enssum", func_sum, 0, NULL);
cdoOperatorAdd("ensmean", func_mean, 0, NULL);
cdoOperatorAdd("ensavg", func_avg, 0, NULL);
cdoOperatorAdd("ensstd", func_std, 0, NULL);
cdoOperatorAdd("ensstd1", func_std1, 0, NULL);
cdoOperatorAdd("ensvar", func_var, 0, NULL);
cdoOperatorAdd("ensvar1", func_var1, 0, NULL);
cdoOperatorAdd("enspctl", func_pctl, 0, NULL);
cdoOperatorAdd("ensrange", func_range, 0, NULL);
cdoOperatorAdd("ensmin", func_min, 0, NULL);
cdoOperatorAdd("ensmax", func_max, 0, NULL);
cdoOperatorAdd("enssum", func_sum, 0, NULL);
cdoOperatorAdd("ensmean", func_mean, 0, NULL);
cdoOperatorAdd("ensavg", func_avg, 0, NULL);
cdoOperatorAdd("ensstd", func_std, 0, NULL);
cdoOperatorAdd("ensstd1", func_std1, 0, NULL);
cdoOperatorAdd("ensvar", func_var, 0, NULL);
cdoOperatorAdd("ensvar1", func_var1, 0, NULL);
cdoOperatorAdd("enspctl", func_pctl, 0, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
......@@ -370,16 +372,17 @@ void *Ensstat(void *argument)
cdoInitialize(argument);
cdoOperatorAdd("ensmin", func_min, 0, NULL);
cdoOperatorAdd("ensmax", func_max, 0, NULL);
cdoOperatorAdd("enssum", func_sum, 0, NULL);
cdoOperatorAdd("ensmean", func_mean, 0, NULL);
cdoOperatorAdd("ensavg", func_avg, 0, NULL);
cdoOperatorAdd("ensstd", func_std, 0, NULL);
cdoOperatorAdd("ensstd1", func_std1, 0, NULL);
cdoOperatorAdd("ensvar", func_var, 0, NULL);
cdoOperatorAdd("ensvar1", func_var1, 0, NULL);
cdoOperatorAdd("enspctl", func_pctl, 0, NULL);
cdoOperatorAdd("ensrange", func_range, 0, NULL);
cdoOperatorAdd("ensmin", func_min, 0, NULL);
cdoOperatorAdd("ensmax", func_max, 0, NULL);
cdoOperatorAdd("enssum", func_sum, 0, NULL);
cdoOperatorAdd("ensmean", func_mean, 0, NULL);
cdoOperatorAdd("ensavg", func_avg, 0, NULL);
cdoOperatorAdd("ensstd", func_std, 0, NULL);
cdoOperatorAdd("ensstd1", func_std1, 0, NULL);
cdoOperatorAdd("ensvar", func_var, 0, NULL);
cdoOperatorAdd("ensvar1", func_var1, 0, NULL);
cdoOperatorAdd("enspctl", func_pctl, 0, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
......
......@@ -18,6 +18,7 @@
/*
This module contains the following operators:
Gridboxstat gridboxrange Gridbox range
Gridboxstat gridboxmin Gridbox minimum
Gridboxstat gridboxmax Gridbox maximum
Gridboxstat gridboxsum Gridbox sum
......@@ -551,15 +552,16 @@ void *Gridboxstat(void *argument)
int xinc = parameter2int(operatorArgv()[0]);
int yinc = parameter2int(operatorArgv()[1]);
cdoOperatorAdd("gridboxmin", func_min, 0, NULL);
cdoOperatorAdd("gridboxmax", func_max, 0, NULL);
cdoOperatorAdd("gridboxsum", func_sum, 0, NULL);
cdoOperatorAdd("gridboxmean", func_meanw, 1, NULL);
cdoOperatorAdd("gridboxavg", func_avgw, 1, NULL);
cdoOperatorAdd("gridboxvar", func_varw, 1, NULL);
cdoOperatorAdd("gridboxvar1", func_var1w, 1, NULL);
cdoOperatorAdd("gridboxstd", func_stdw, 1, NULL);
cdoOperatorAdd("gridboxstd1", func_std1w, 1, NULL);
cdoOperatorAdd("gridboxrange", func_range, 0, NULL);
cdoOperatorAdd("gridboxmin", func_min, 0, NULL);
cdoOperatorAdd("gridboxmax", func_max, 0, NULL);
cdoOperatorAdd("gridboxsum", func_sum, 0, NULL);
cdoOperatorAdd("gridboxmean", func_meanw, 1, NULL);
cdoOperatorAdd("gridboxavg", func_avgw, 1, NULL);
cdoOperatorAdd("gridboxvar", func_varw, 1, NULL);
cdoOperatorAdd("gridboxvar1", func_var1w, 1, NULL);
cdoOperatorAdd("gridboxstd", func_stdw, 1, NULL);
cdoOperatorAdd("gridboxstd1", func_std1w, 1, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
......
......@@ -18,6 +18,7 @@
/*
This module contains the following operators:
Merstat merrange Meridional range
Merstat mermin Meridional minimum
Merstat mermax Meridional maximum
Merstat mersum Meridional sum
......@@ -50,16 +51,17 @@ void *Merstat(void *argument)
cdoInitialize(argument);
cdoOperatorAdd("mermin", func_min, 0, NULL);
cdoOperatorAdd("mermax", func_max, 0, NULL);
cdoOperatorAdd("mersum", func_sum, 0, NULL);
cdoOperatorAdd("mermean", func_meanw, 1, NULL);
cdoOperatorAdd("meravg", func_avgw, 1, NULL);
cdoOperatorAdd("mervar", func_varw, 1, NULL);
cdoOperatorAdd("mervar1", func_var1w, 1, NULL);
cdoOperatorAdd("merstd", func_stdw, 1, NULL);
cdoOperatorAdd("merstd1", func_std1w, 1, NULL);
cdoOperatorAdd("merpctl", func_pctl, 0, NULL);
cdoOperatorAdd("merrange", func_range, 0, NULL);
cdoOperatorAdd("mermin", func_min, 0, NULL);
cdoOperatorAdd("mermax", func_max, 0, NULL);
cdoOperatorAdd("mersum", func_sum, 0, NULL);
cdoOperatorAdd("mermean", func_meanw, 1, NULL);
cdoOperatorAdd("meravg", func_avgw, 1, NULL);
cdoOperatorAdd("mervar", func_varw, 1, NULL);
cdoOperatorAdd("mervar1", func_var1w, 1, NULL);
cdoOperatorAdd("merstd", func_stdw, 1, NULL);
cdoOperatorAdd("merstd1", func_std1w, 1, NULL);
cdoOperatorAdd("merpctl", func_pctl, 0, NULL);
int operatorID = cdoOperatorID();
int operfunc = cdoOperatorF1(operatorID);
......
......@@ -148,6 +148,7 @@ void *Runstat(void *argument)
recinfo[recID].levelID = levelID;
}
field_type *psamp1 = samp1 ? &samp1[tsID][varID][levelID] : NULL;
field_type *pvars1 = &vars1[tsID][varID][levelID];
field_type *pvars2 = vars2 ? &vars2[tsID][varID][levelID] : NULL;
......@@ -162,7 +163,7 @@ void *Runstat(void *argument)
pvars2->ptr[i] = pvars1->ptr[i];
}
if ( runstat_nomiss && nmiss > 0 ) cdoAbort("Missing values supported swichted off!");
if ( runstat_nomiss && nmiss > 0 ) cdoAbort("Missing values supported was swichted off by env. RUNSTAT_NOMISS!");
if ( !runstat_nomiss )
{
......@@ -172,14 +173,14 @@ void *Runstat(void *argument)
imask[i] = !DBL_IS_EQUAL(pvars1->ptr[i], missval);
for ( int i = 0; i < gridsize; i++ )
samp1[tsID][varID][levelID].ptr[i] = (double) imask[i];
psamp1->ptr[i] = (double) imask[i];
#if defined(_OPENMP)
#pragma omp parallel for default(none) shared(tsID,gridsize,imask,samp1,varID,levelID)
#endif
for ( int inp = 0; inp < tsID; inp++ )
{
double *ptr = samp1[inp][varID][levelID].ptr;
double *ptr = samp1[inp][varID][levelID].ptr;
for ( int i = 0; i < gridsize; i++ )
if ( imask[i] ) ptr[i]++;
}
......@@ -224,53 +225,40 @@ void *Runstat(void *argument)
int otsID = 0;
while ( TRUE )
{
if ( lmean )
for ( int recID = 0; recID < maxrecs; recID++ )
{
int varID = recinfo[recID].varID;
int levelID = recinfo[recID].levelID;
field_type *pvars1 = &vars1[0][varID][levelID];
if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
if ( runstat_nomiss )
farcdiv(pvars1, (double)ndates);
else
fardiv(pvars1, samp1[0][varID][levelID]);
}
else if ( lvarstd )
for ( int recID = 0; recID < maxrecs; recID++ )
{
int varID = recinfo[recID].varID;
int levelID = recinfo[recID].levelID;
field_type *pvars1 = &vars1[0][varID][levelID];
field_type *pvars2 = &vars2[0][varID][levelID];
if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
if ( runstat_nomiss )
{
if ( lstd ) farcstd(pvars1, *pvars2, ndates, divisor);
else farcvar(pvars1, *pvars2, ndates, divisor);
}
else
{
if ( lstd ) farstd(pvars1, *pvars2, samp1[0][varID][levelID], divisor);
else farvar(pvars1, *pvars2, samp1[0][varID][levelID], divisor);
}
}
else if ( lrange )
for ( int recID = 0; recID < maxrecs; recID++ )
{
int varID = recinfo[recID].varID;
int levelID = recinfo[recID].levelID;
field_type *pvars1 = &vars1[0][varID][levelID];
field_type *pvars2 = &vars2[0][varID][levelID];
if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
farsub(pvars1, *pvars2);
}