Commit 9b1e58e0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Timstat.test: added year, mon and day.

parent b7006125
#! @SHELL@
echo 1..9 # Number of tests to be executed.
echo 1..36 # Number of tests to be executed.
#
test -n "$CDO" || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
CDOOUT=cout$$
CDOERR=cerr$$
TYPES="tim year mon day"
STATS="min max sum avg mean std std1 var var1"
#
IFILE=$DATAPATH/ts_mm_5years
NTEST=1
#
for STAT in $STATS; do
RSTAT=0
RFILE=$DATAPATH/tim${STAT}_ref
OFILE=tim${STAT}_res
for TYPE in $TYPES; do
if [ $TYPE = day ] ; then
IFILE=$DATAPATH/ts_6h_1mon
elif [ $TYPE = mon ] ; then
IFILE=$DATAPATH/ts_1d_1year
else
IFILE=$DATAPATH/ts_mm_5years
fi
#
for STAT in $STATS; do
RSTAT=0
RFILE=$DATAPATH/${TYPE}${STAT}_ref
OFILE=${TYPE}${STAT}_res
CDOTEST="tim$STAT"
CDOCOMMAND="$CDO tim${STAT} $IFILE $OFILE"
CDOTEST="${TYPE}$STAT"
CDOCOMMAND="$CDO ${TYPE}${STAT} $IFILE $OFILE"
echo "Running test: $NTEST"
echo "$CDOCOMMAND"
echo "Running test: $NTEST"
echo "$CDOCOMMAND"
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDO diff $OFILE $RFILE > $CDOOUT 2> $CDOERR
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
$CDO diff $OFILE $RFILE > $CDOOUT 2> $CDOERR
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
let NTEST+=1
rm -f $OFILE
let NTEST+=1
rm -f $OFILE
done
done
#
rm -f $CDOOUT $CDOERR
......
......@@ -7,6 +7,9 @@ GRIB_REF = grib_testfile01_sinfo_ref grib_testfile01_info_ref grib_testfile0
NETCDF_REF = netcdf_testfile01_sinfon_ref netcdf_testfile01_infon_ref netcdf_testfile02_sinfon_ref netcdf_testfile02_infon_ref
YMONSTAT_REF = ymonmin_ref ymonmax_ref ymonsum_ref ymonavg_ref ymonmean_ref ymonstd_ref ymonstd1_ref ymonvar_ref ymonvar1_ref
TIMSTAT_REF = timmin_ref timmax_ref timsum_ref timavg_ref timmean_ref timstd_ref timstd1_ref timvar_ref timvar1_ref
YEARSTAT_REF = yearmin_ref yearmax_ref yearsum_ref yearavg_ref yearmean_ref yearstd_ref yearstd1_ref yearvar_ref yearvar1_ref
MONSTAT_REF = monmin_ref monmax_ref monsum_ref monavg_ref monmean_ref monstd_ref monstd1_ref monvar_ref monvar1_ref
DAYSTAT_REF = daymin_ref daymax_ref daysum_ref dayavg_ref daymean_ref daystd_ref daystd1_ref dayvar_ref dayvar1_ref
FLDSTAT_REF = fldmin_ref fldmax_ref fldsum_ref fldavg_ref fldmean_ref fldstd_ref fldstd1_ref fldvar_ref fldvar1_ref
FLDPSTAT_REF = fldpctl1_ref fldpctl20_ref fldpctl25_ref fldpctl33_ref fldpctl50_ref fldpctl66_ref fldpctl75_ref fldpctl80_ref fldpctl99_ref fldpctl100_ref
MERSTAT_REF = mermin_ref mermax_ref mersum_ref meravg_ref mermean_ref merstd_ref merstd1_ref mervar_ref mervar1_ref
......@@ -24,4 +27,4 @@ GRADSDES_REF = pl_data.ctl pl_data.gmp
ARITH_REF = arithadd_ref arithsub_ref arithmul_ref arithdiv_ref
MAPREDUCE = r18x9_grid icon_cell_grid griddes.r18x9 griddes.icon_cell
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(YEARSTAT_REF) $(MONSTAT_REF) $(DAYSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
......@@ -294,6 +294,9 @@ GRIB_REF = grib_testfile01_sinfo_ref grib_testfile01_info_ref grib_testfile02_si
NETCDF_REF = netcdf_testfile01_sinfon_ref netcdf_testfile01_infon_ref netcdf_testfile02_sinfon_ref netcdf_testfile02_infon_ref
YMONSTAT_REF = ymonmin_ref ymonmax_ref ymonsum_ref ymonavg_ref ymonmean_ref ymonstd_ref ymonstd1_ref ymonvar_ref ymonvar1_ref
TIMSTAT_REF = timmin_ref timmax_ref timsum_ref timavg_ref timmean_ref timstd_ref timstd1_ref timvar_ref timvar1_ref
YEARSTAT_REF = yearmin_ref yearmax_ref yearsum_ref yearavg_ref yearmean_ref yearstd_ref yearstd1_ref yearvar_ref yearvar1_ref
MONSTAT_REF = monmin_ref monmax_ref monsum_ref monavg_ref monmean_ref monstd_ref monstd1_ref monvar_ref monvar1_ref
DAYSTAT_REF = daymin_ref daymax_ref daysum_ref dayavg_ref daymean_ref daystd_ref daystd1_ref dayvar_ref dayvar1_ref
FLDSTAT_REF = fldmin_ref fldmax_ref fldsum_ref fldavg_ref fldmean_ref fldstd_ref fldstd1_ref fldvar_ref fldvar1_ref
FLDPSTAT_REF = fldpctl1_ref fldpctl20_ref fldpctl25_ref fldpctl33_ref fldpctl50_ref fldpctl66_ref fldpctl75_ref fldpctl80_ref fldpctl99_ref fldpctl100_ref
MERSTAT_REF = mermin_ref mermax_ref mersum_ref meravg_ref mermean_ref merstd_ref merstd1_ref mervar_ref mervar1_ref
......@@ -311,7 +314,7 @@ THREAD_REF = thread1_ref tsformat1_ref
GRADSDES_REF = pl_data.ctl pl_data.gmp
ARITH_REF = arithadd_ref arithsub_ref arithmul_ref arithdiv_ref
MAPREDUCE = r18x9_grid icon_cell_grid griddes.r18x9 griddes.icon_cell
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(YMONSTAT_REF) $(TIMSTAT_REF) $(YEARSTAT_REF) $(MONSTAT_REF) $(DAYSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
all: all-am
.SUFFIXES:
......
......@@ -3,10 +3,49 @@
CDO=cdo
#
FORMAT="-f srv -b F32"
#
########################################################################
#
# Timstat
#
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 selmon,1 -selyear,1991 $IFILE ts_6h_1mon
#
IFILE=$OFILE
OFILE=ts_mm_5years
$CDO $FORMAT monmean $IFILE $OFILE
$CDO selyear,1991 $IFILE ts_1d_1year
#
STATS="min max sum avg mean std std1 var var1"
#
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
########################################################################
#
# Zonstat
#
STATS="min max sum avg mean std std1 var var1"
......@@ -128,27 +167,6 @@ done
exit
########################################################################
#
# Timstat
#
IFILE=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
#
IFILE=$OFILE
OFILE=ts_mm_5years
$CDO $FORMAT monmean $IFILE $OFILE
#
STATS="min max sum avg mean std std1 var var1"
IFILE=$OFILE
for STAT in $STATS; do
$CDO $FORMAT tim$STAT $IFILE tim${STAT}_ref
done
########################################################################
#
# Vertint
#
IFILE=ECHAM5_T21L19monavg.grb
......
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