Commit 32c3de98 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Runstat.test: added tests with missing values.

parent 22a94218
......@@ -43,7 +43,6 @@ Runstat(void *process)
TimeStat timestat_date = TimeStat::MEAN;
int varID;
int levelID;
size_t nmiss;
bool runstat_nomiss = false;
cdoInitialize(process);
......@@ -152,7 +151,7 @@ Runstat(void *process)
if (lrange)
{
vars2[tsID][varID][levelID].nmiss = rvars1.nmiss;
for (size_t i = 0; i < fieldsize; i++) vars2[tsID][varID][levelID].vec[i] = rvars1.vec[i];
vars2[tsID][varID][levelID].vec = rvars1.vec;
}
if (runstat_nomiss && rvars1.nmiss) cdoAbort("Missing values supported was swichted off by env. RUNSTAT_NOMISS!");
......@@ -298,15 +297,14 @@ Runstat(void *process)
const size_t fieldsize = rvars1.size;
cdoReadRecord(streamID1, rvars1.vec.data(), &nmiss);
rvars1.nmiss = nmiss;
cdoReadRecord(streamID1, rvars1.vec.data(), &rvars1.nmiss);
if (lrange)
{
vars2[ndates - 1][varID][levelID].nmiss = rvars1.nmiss;
for (size_t i = 0; i < fieldsize; i++) vars2[ndates - 1][varID][levelID].vec[i] = rvars1.vec[i];
}
if (runstat_nomiss && nmiss) cdoAbort("Missing values supported swichted off!");
if (runstat_nomiss && rvars1.nmiss) cdoAbort("Missing values supported swichted off!");
if (!runstat_nomiss)
{
......
......@@ -339,6 +339,7 @@ Timstat(void *argument)
field.size = fieldsize;
field.grid = rvars1.grid;
field.missval = rvars1.missval;
if (field.nmiss || !rsamp1.empty())
{
if (rsamp1.empty()) rsamp1.resize(fieldsize, nsets);
......
#! @BASH@
echo 1..10 # Number of tests to be executed.
echo 1..20 # Number of tests to be executed.
#
test -n "$CDO" || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
......@@ -14,14 +14,21 @@ FMS="srv grb"
if [ "${HAS_NETCDF}" = yes ] ; then FMS="$FMS nc"; fi
NTEST=1
#
IFILE=$DATAPATH/ts_mm_5years
#
for STAT in $STATS; do
RSTAT=0
RFILE=$DATAPATH/${TYPE}${STAT}_ref
OFILE=${TYPE}${STAT}_res
for RUN in 1 2; do
IFILE=$DATAPATH/ts_mm_5years
if [ $RUN = 2 ] ; then IFILE=${IFILE}_m ; fi
CDOTEST="${TYPE}$STAT"
for STAT in $STATS; do
RSTAT=0
if [ $RUN = 2 ] ; then
RFILE=$DATAPATH/${TYPE}m${STAT}_ref
OFILE=${TYPE}m${STAT}_res
CDOTEST="${TYPE}$STAT with missing values"
else
RFILE=$DATAPATH/${TYPE}${STAT}_ref
OFILE=${TYPE}${STAT}_res
CDOTEST="${TYPE}$STAT"
fi
for FM in $FMS; do
rm -f Runstat_${STAT}_${FM}.debug
......@@ -45,6 +52,7 @@ for STAT in $STATS; do
let NTEST+=1
rm -f $OFILE
done
done
#
rm -f $CDOOUT $CDOERR
......
......@@ -16,6 +16,7 @@ SEASSTAT = seasmin_ref seasmax_ref seassum_ref seasavg_ref seasmean_ref seas
SEASMSTAT = seasmmin_ref seasmmax_ref seasmsum_ref seasmavg_ref seasmmean_ref seasmstd_ref seasmstd1_ref seasmvar_ref seasmvar1_ref seasmrange_ref
TIMPCTL = seaspctl50_ref timpctl50_ref yearpctl50_ref monpctl50_ref daypctl50_ref yseaspctl50_ref ymonpctl50_ref ydaypctl50_ref
RUNSTAT = runmin_ref runmax_ref runsum_ref runavg_ref runmean_ref runstd_ref runstd1_ref runvar_ref runvar1_ref runrange_ref
RUNMSTAT = runmmin_ref runmmax_ref runmsum_ref runmavg_ref runmmean_ref runmstd_ref runmstd1_ref runmvar_ref runmvar1_ref runmrange_ref
RUNPCTL = runpctl1_ref runpctl20_ref runpctl25_ref runpctl33_ref runpctl50_ref runpctl66_ref runpctl75_ref runpctl80_ref runpctl99_ref runpctl100_ref
YEARMONSTAT = yearmonmean_ref yearmonavg_ref
TIMSTAT2 = timcor_ref timcovar_ref
......@@ -77,7 +78,7 @@ SETMISS = setmisstoc_ref setmisstonn_ref setmisstodis_ref
FILTER = lowpass_ref highpass_ref bandpass_ref
EXTRA_DIST = $(INPUTDATA) $(FILE) $(GRIB) $(NETCDF) $(EOF) $(COMP) $(YDRUNSTAT) $(YDAYSTAT) $(YMONSTAT) $(YSEASSTAT) $(SEASSTAT) $(SEASMSTAT) $(TIMPCTL) \
$(RUNSTAT) $(RUNPCTL) $(TIMSTAT2) $(YEARMONSTAT) $(VERTSTAT) $(VARSSTAT) $(FLDSTAT) $(FLDPSTAT) \
$(RUNSTAT) $(RUNMSTAT) $(RUNPCTL) $(TIMSTAT2) $(YEARMONSTAT) $(VERTSTAT) $(VARSSTAT) $(FLDSTAT) $(FLDPSTAT) \
$(TIMSTAT) $(YEARSTAT) $(MONSTAT) $(DAYSTAT) $(TIMMSTAT) $(YEARMSTAT) $(MONMSTAT) $(DAYMSTAT) \
$(MERSTAT) $(ZONSTAT) $(ENSPSTAT) $(SPECTRAL) $(INTTIME) $(VERTINT) $(REMAPGRID) $(REMAP) $(REMAP2) $(REMAP3) $(SELECT) $(DETREND) \
$(THREAD) $(EXPR) $(GRADSDES) $(ARITH) $(MONARITH) $(YMONARITH) $(MAPREDUCE) $(MERGETIME) $(REMAPETA) $(SMOOTH) $(SETMISS) $(FILTER)
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