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

Timstat.test: added tests with missing values.

parent 885d419e
#! @BASH@
echo 1..40 # Number of tests to be executed.
echo 1..80 # Number of tests to be executed.
#
test -n "$CDO" || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
......@@ -19,7 +19,8 @@ rm -rf TimstatDebugOutput
mkdir TimstatDebugOutput
#
for TYPE in $TYPES; do
for RUN in 1 2; do
for TYPE in $TYPES; do
if [ $TYPE = day ] ; then
IFILE=$DATAPATH/ts_6h_1mon
elif [ $TYPE = mon ] ; then
......@@ -27,13 +28,20 @@ for TYPE in $TYPES; do
else
IFILE=$DATAPATH/ts_mm_5years
fi
if [ $RUN = 2 ] ; then IFILE=${IFILE}_m ; fi
#
for STAT in $STATS; do
RSTAT=0
RFILE=$DATAPATH/${TYPE}${STAT}_ref
OFILE=${TYPE}${STAT}_res
CDOTEST="${TYPE}$STAT"
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
DEBUG_OUT="--seperateDebugFromLog TimstatDebugOutput/Timstat_${TYPE}_${STAT}.debug"
......@@ -57,6 +65,7 @@ for TYPE in $TYPES; do
let NTEST+=1
rm -f $OFILE
done
done
done
#
rm -f $CDOOUT $CDOERR
......
......@@ -22,6 +22,10 @@ TIMSTAT = timmin_ref timmax_ref timsum_ref timavg_ref timmean_ref timstd_re
YEARSTAT = yearmin_ref yearmax_ref yearsum_ref yearavg_ref yearmean_ref yearstd_ref yearstd1_ref yearvar_ref yearvar1_ref yearrange_ref
MONSTAT = monmin_ref monmax_ref monsum_ref monavg_ref monmean_ref monstd_ref monstd1_ref monvar_ref monvar1_ref monrange_ref
DAYSTAT = daymin_ref daymax_ref daysum_ref dayavg_ref daymean_ref daystd_ref daystd1_ref dayvar_ref dayvar1_ref dayrange_ref
TIMMSTAT = timmmin_ref timmmax_ref timmsum_ref timmavg_ref timmmean_ref timmstd_ref timmstd1_ref timmvar_ref timmvar1_ref timmrange_ref
YEARMSTAT = yearmmin_ref yearmmax_ref yearmsum_ref yearmavg_ref yearmmean_ref yearmstd_ref yearmstd1_ref yearmvar_ref yearmvar1_ref yearmrange_ref
MONMSTAT = monmmin_ref monmmax_ref monmsum_ref monmavg_ref monmmean_ref monmstd_ref monmstd1_ref monmvar_ref monmvar1_ref monmrange_ref
DAYMSTAT = daymmin_ref daymmax_ref daymsum_ref daymavg_ref daymmean_ref daymstd_ref daymstd1_ref daymvar_ref daymvar1_ref daymrange_ref
VERTSTAT = vertmin_ref vertmax_ref vertsum_ref vertavg_ref vertmean_ref vertstd_ref vertstd1_ref vertvar_ref vertvar1_ref vertint_ref vertrange_ref vertcum_ref
VARSSTAT = varsmin_ref varsmax_ref varssum_ref varsavg_ref varsmean_ref varsstd_ref varsstd1_ref varsvar_ref varsvar1_ref varsrange_ref
FLDSTAT = fldmin_ref fldmax_ref fldsum_ref fldavg_ref fldmean_ref fldstd_ref fldstd1_ref fldvar_ref fldvar1_ref fldrange_ref
......@@ -72,6 +76,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) $(TIMPCTL) \
$(RUNSTAT) $(RUNPCTL) $(TIMSTAT2) $(TIMSTAT) $(YEARMONSTAT) $(YEARSTAT) $(MONSTAT) $(DAYSTAT) $(VERTSTAT) $(VARSSTAT) $(FLDSTAT) $(FLDPSTAT) \
$(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) \
$(THREAD) $(EXPR) $(GRADSDES) $(ARITH) $(MONARITH) $(YMONARITH) $(MAPREDUCE) $(MERGETIME) $(REMAPETA) $(SMOOTH) $(SETMISS) $(FILTER)
......@@ -6,6 +6,88 @@ FORMAT="-f srv -b F32"
#
########################################################################
#
# Timstat Yearstat Monstat Daystat Runstat
#
#IFILE=$HOME/data/cdt/cera/EH5_AMIP_1_TSURF_6H_1991-1995.grb
#OFILE=ts_6h_5years
#$CDO $FORMAT remapnn,lon=55_lat=10 $IFILE $OFILE
#
#IFILE=$OFILE
#OFILE=ts_1d_5years
#$CDO $FORMAT daymean $IFILE $OFILE
#$CDO selmonth,1 -selyear,1991 $IFILE ts_6h_1mon
#
#IFILE=$OFILE
#OFILE=ts_mm_5years
#$CDO $FORMAT -settime,12:00:00 -setday,15 -monmean $IFILE $OFILE
#$CDO selyear,1991 $IFILE ts_1d_1year
#
STATS="min max sum avg mean std std1 var var1 range"
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT seas${STAT} $IFILE seas${STAT}_ref
done
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT run${STAT},12 $IFILE run${STAT}_ref
done
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT tim$STAT $IFILE tim${STAT}_ref
done
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT year$STAT $IFILE year${STAT}_ref
done
#
IFILE=ts_1d_1year
for STAT in $STATS; do
$CDO $FORMAT mon$STAT $IFILE mon${STAT}_ref
done
#
IFILE=ts_6h_1mon
for STAT in $STATS; do
$CDO $FORMAT day$STAT $IFILE day${STAT}_ref
done
#
# missval
#
IFILE=ts_mm_5years_m
for STAT in $STATS; do
$CDO $FORMAT seas${STAT} $IFILE seasm${STAT}_ref
done
#
IFILE=ts_mm_5years_m
for STAT in $STATS; do
$CDO $FORMAT run${STAT},12 $IFILE runm${STAT}_ref
done
#
IFILE=ts_mm_5years_m
for STAT in $STATS; do
$CDO $FORMAT tim$STAT $IFILE timm${STAT}_ref
done
#
IFILE=ts_mm_5years_m
for STAT in $STATS; do
$CDO $FORMAT year$STAT $IFILE yearm${STAT}_ref
done
#
IFILE=ts_1d_1year_m
for STAT in $STATS; do
$CDO $FORMAT mon$STAT $IFILE monm${STAT}_ref
done
#
IFILE=ts_6h_1mon_m
for STAT in $STATS; do
$CDO $FORMAT day$STAT $IFILE daym${STAT}_ref
done
exit
########################################################################
#
# Yearmonstat
#
IFILE1=ts_mm_5years
......@@ -279,56 +361,6 @@ env SKIP_SAME_TIME=1 cdo mergetime mergetime_y12 mergetime_y2 mergetime_ref2
exit
########################################################################
#
# Timstat Yearstat Monstat Daystat Runstat
#
IFILE=$HOME/data/cdt/cera/EH5_AMIP_1_TSURF_6H_1991-1995.grb
OFILE=ts_6h_5years
$CDO $FORMAT remapnn,lon=55_lat=10 $IFILE $OFILE
#
IFILE=$OFILE
OFILE=ts_1d_5years
$CDO $FORMAT daymean $IFILE $OFILE
$CDO selmonth,1 -selyear,1991 $IFILE ts_6h_1mon
#
IFILE=$OFILE
OFILE=ts_mm_5years
$CDO $FORMAT -settime,12:00:00 -setday,15 -monmean $IFILE $OFILE
$CDO selyear,1991 $IFILE ts_1d_1year
#
STATS="min max sum avg mean std std1 var var1 range"
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT seas${STAT} $IFILE seas${STAT}_ref
done
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT run${STAT},12 $IFILE run${STAT}_ref
done
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT tim$STAT $IFILE tim${STAT}_ref
done
#
IFILE=ts_mm_5years
for STAT in $STATS; do
$CDO $FORMAT year$STAT $IFILE year${STAT}_ref
done
#
IFILE=ts_1d_1year
for STAT in $STATS; do
$CDO $FORMAT mon$STAT $IFILE mon${STAT}_ref
done
#
IFILE=ts_6h_1mon
for STAT in $STATS; do
$CDO $FORMAT day$STAT $IFILE day${STAT}_ref
done
exit
########################################################################
#
# EOF
#
export CDO_FILE_SUFFIX=NULL
......
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