Commit 22a94218 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Seasstat.test: added tests with missing values.

parent dfb9ba66
......@@ -185,11 +185,7 @@ Seasstat(void *process)
if (field.nmiss || !rsamp1.empty())
{
if (rsamp1.empty())
{
rsamp1.resize(fieldsize);
for (size_t i = 0; i < fieldsize; i++) rsamp1.vec[i] = nsets;
}
if (rsamp1.empty()) rsamp1.resize(fieldsize, nsets);
for (size_t i = 0; i < fieldsize; i++)
if (!DBL_IS_EQUAL(field.vec[i], rvars1.missval)) rsamp1.vec[i]++;
......@@ -219,7 +215,6 @@ Seasstat(void *process)
const int varID = recList[recID].varID;
const int levelID = recList[recID].levelID;
vfarmoq(vars2[varID][levelID], vars1[varID][levelID]);
}
......
......@@ -166,7 +166,6 @@ Timstat(void *argument)
int varID, levelID;
int streamID3 = -1;
int vlistID3, taxisID3 = -1;
size_t nmiss;
bool lvfrac = false;
char indate1[DATE_LEN + 1], indate2[DATE_LEN + 1];
double vfrac = 1;
......@@ -315,12 +314,12 @@ Timstat(void *argument)
cdoReadRecord(streamID1, rvars1.vec.data(), &rvars1.nmiss);
if (lrange)
{
vars2[varID][levelID].nmiss = nmiss;
for (size_t i = 0; i < fieldsize; i++) vars2[varID][levelID].vec[i] = rvars1.vec[i];
vars2[varID][levelID].nmiss = rvars1.nmiss;
vars2[varID][levelID].vec = rvars1.vec;
}
else if (lminidx || lmaxidx)
{
vars2[varID][levelID].nmiss = nmiss;
vars2[varID][levelID].nmiss = rvars1.nmiss;
vars2[varID][levelID].vec = rvars1.vec;
for (size_t i = 0; i < fieldsize; i++) rvars1.vec[i] = 0;
}
......@@ -334,7 +333,7 @@ Timstat(void *argument)
else
{
if (Options::CDO_Memtype == MEMTYPE_FLOAT)
cdoReadRecordF(streamID1, field.vecf.data(), &nmiss);
cdoReadRecordF(streamID1, field.vecf.data(), &field.nmiss);
else
cdoReadRecord(streamID1, field.vec.data(), &field.nmiss);
field.size = fieldsize;
......@@ -342,11 +341,7 @@ Timstat(void *argument)
field.missval = rvars1.missval;
if (field.nmiss || !rsamp1.empty())
{
if (rsamp1.empty())
{
rsamp1.resize(fieldsize);
for (size_t i = 0; i < fieldsize; i++) rsamp1.vec[i] = nsets;
}
if (rsamp1.empty()) rsamp1.resize(fieldsize, nsets);
if (Options::CDO_Memtype == MEMTYPE_FLOAT)
{
......
#! @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 Seasstat_${STAT}_${FM}.debug
......@@ -45,6 +52,7 @@ for STAT in $STATS; do
let NTEST+=1
rm -f $OFILE
done
done
#
rm -f $CDOOUT $CDOERR
......
......@@ -13,6 +13,7 @@ YDAYSTAT = ydaymin_ref ydaymax_ref ydaysum_ref ydayavg_ref ydaymean_ref yday
YMONSTAT = ymonmin_ref ymonmax_ref ymonsum_ref ymonavg_ref ymonmean_ref ymonstd_ref ymonstd1_ref ymonvar_ref ymonvar1_ref ymonrange_ref ymonskew_ref ymonkurt_ref
YSEASSTAT = yseasmin_ref yseasmax_ref yseassum_ref yseasavg_ref yseasmean_ref yseasstd_ref yseasstd1_ref yseasvar_ref yseasvar1_ref yseasrange_ref
SEASSTAT = seasmin_ref seasmax_ref seassum_ref seasavg_ref seasmean_ref seasstd_ref seasstd1_ref seasvar_ref seasvar1_ref seasrange_ref
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
RUNPCTL = runpctl1_ref runpctl20_ref runpctl25_ref runpctl33_ref runpctl50_ref runpctl66_ref runpctl75_ref runpctl80_ref runpctl99_ref runpctl100_ref
......@@ -75,7 +76,7 @@ SMOOTH = smooth1_ref smooth2_ref smooth3_ref
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) $(TIMPCTL) \
EXTRA_DIST = $(INPUTDATA) $(FILE) $(GRIB) $(NETCDF) $(EOF) $(COMP) $(YDRUNSTAT) $(YDAYSTAT) $(YMONSTAT) $(YSEASSTAT) $(SEASSTAT) $(SEASMSTAT) $(TIMPCTL) \
$(RUNSTAT) $(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) \
......
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