Commit 3d02a9ce authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added test/EOFcoeff.test.in

parent 9c5af674
......@@ -290,6 +290,7 @@ AC_CONFIG_FILES([
test/Copy_netcdf.test
test/Detrend.test
test/EOF.test
test/EOFcoeff.test
test/Enspctl.test
test/Ensstat.test
test/Expr.test
......
......@@ -6,19 +6,20 @@ test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data"
#
declare -a STATS
STATS=("detrend" "trend" "subtrend")
#
IFILE=$DATAPATH/detrend_data
NTEST=1
#
RSTAT=0
RFILE=$DATAPATH/detrend_ref
OFILE=detrend_res
#
# detrend
#
RSTAT=0
CDOCOMMAND="$CDO ${STATS[0]} $IFILE $OFILE"
CDOTEST="${STATS[0]}"
echo "Running test: $NTEST"
echo "$CDOCOMMAND"
......@@ -34,10 +35,13 @@ test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
let NTEST+=1
rm -f $OFILE
#
# trend
# trend/subtrend
#
RSTAT=0
CDOCOMMAND="$CDO ${STATS[1]} $IFILE ta tb"
CDOTEST="${STATS[1]}/${STATS[2]}"
echo "Running test: $NTEST"
echo "$CDOCOMMAND"
......@@ -55,15 +59,11 @@ test $? -eq 0 || let RSTAT+=1
$CDO diff $OFILE $RFILE
test $? -eq 0 || let RSTAT+=1
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
let NTEST+=1
rm -f $OFILE
rm -f ta tb
#
#
exit 0
#! @BASH@
#
echo 1..8 # Number of tests to be executed.
echo 1..4 # Number of tests to be executed.
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
export CDO_FILE_SUFFIX=NULL
export CDO_WEIGHT_MODE=off
#export CDO_SVD_MODE=danielson_lanczos
#
FORMAT="-f srv -b 32"
STATS="eof eof3d"
#
NTEST=1
######################################################
IFILE=$DATAPATH/psl_DJF_anom.grb
RFILE1=$DATAPATH/eval_ref
RFILE2=$DATAPATH/eof_ref
RFILE3=$DATAPATH/pcoeff00000
OFILE1=eval_res
OFILE2=eof_res
OFILE3=res_pcoeff
#
declare -a STATS
STATS=("eof" "eofcoeff" "eof3d" "eofcoeff3d")
#
RSTAT=0
#
for X in 0 1; do
for STAT in $STATS; do
for MODE in jacobi danielson_lanczos; do
RSTAT=0
export CDO_SVD_MODE=$MODE
#--------------------------------------------------------------
CDOTEST="eof${DIM} - $MODE"
CDOCOMMAND="$CDO $FORMAT ${STATS[$x]},1 $IFILE $OFILE1 $OFILE2"
CDOTEST="${STAT} - $MODE"
CDOCOMMAND="$CDO $FORMAT ${STAT},1 $IFILE $OFILE1 $OFILE2"
echo "$CDOCOMMAND"
#
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
#
$CDO diff,abslim=1e-8 $OFILE1 $RFILE1
test $? -eq 0 || let RSTAT+=1
#
$CDO diff,abslim=1e-7 -abs $OFILE2 -abs $RFILE2
test $? -eq 0 || let RSTAT+=1
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
let NTEST+=1
RSTAT=0
#--------------------------------------------------------------
CDOTEST="eofcoeff${DIM} - $MODE"
#
CDOCOMMAND="$CDO $FORMAT ${STATS[$x + 1]} $OFILE2 $IFILE $OFILE3"
echo "$CDOCOMMAND"
#
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
#
$CDO diff,abslim=0.02 -abs ${OFILE3}00000 -abs $RFILE3
test $? -eq 0 || let RSTAT+=1
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
let NTEST+=1
RSTAT=0
#--------------------------------------------------------------
rm -f $OFILE1 $OFILE2 ${OFILE3}00000
done
done
#
#
exit 0
#! @BASH@
echo 1..4 # Number of tests to be executed.
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
export CDO_FILE_SUFFIX=NULL
export CDO_WEIGHT_MODE=off
#
FORMAT="-f srv -b 32"
STATS="eofcoeff eofcoeff3d"
#
NTEST=1
IFILE=$DATAPATH/psl_DJF_anom.grb
RFILE=$DATAPATH/pcoeff00000
OFILE=res_pcoeff
#
for STAT in $STATS; do
for MODE in jacobi danielson_lanczos; do
RSTAT=0
export CDO_SVD_MODE=$MODE
CDOTEST="${STAT} - $MODE"
CDOCOMMAND="$CDO $FORMAT ${STAT} $DATAPATH/eof_ref $IFILE $OFILE"
echo "$CDOCOMMAND"
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDO diff,abslim=0.02 -abs ${OFILE}00000 -abs $RFILE
test $? -eq 0 || let RSTAT+=1
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
let NTEST+=1
rm -f ${OFILE}00000
done
done
#
exit 0
......@@ -4,9 +4,8 @@ echo 1..3 # Number of tests to be executed.
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
FORMAT="-f srv -b 32"
STATS="expr aexpr"
ABSLIMMAX=0.001
#
IFILE=$DATAPATH/pl_data
......@@ -14,26 +13,22 @@ NTEST=1
#
FINSTR=finstr
#
#
function testfunc()
{
STATS="expr aexpr"
RSTAT=0
CDOTEST="instruction set $NTEST"
echo "Running test: $NTEST - $CDOTEST"
for EXPR in $STATS; do
RFILE=$DATAPATH/${EXPR}${NTEST}_ref
OFILE=${EXPR}${NTEST}_res
for FILE in "" "f"; do
for STAT in $STATS; do
RFILE=$DATAPATH/${STAT}${NTEST}_ref
OFILE=${STAT}${NTEST}_res
if [ "$FILE" = "f" ] ; then
if [ "$STAT" = "exprf" ] ; then
echo $INSTR > $FINSTR
CDOCOMMAND="$CDO $FORMAT $EXPR${FILE},$FINSTR $IFILE $OFILE"
CDOCOMMAND="$CDO $FORMAT $STAT,$FINSTR $IFILE $OFILE"
else
CDOCOMMAND="$CDO $FORMAT $EXPR,$INSTR $IFILE $OFILE"
CDOCOMMAND="$CDO $FORMAT $STAT,$INSTR $IFILE $OFILE"
fi
echo "$CDOCOMMAND"
......@@ -46,7 +41,6 @@ function testfunc()
rm -f $OFILE $FINSTR
done
done
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
......@@ -62,7 +56,5 @@ testfunc
#
INSTR="C1=3+4;C2=C1-7;r1=C2+fldmean(var130);r2=vertmean(var130)+C2;"
testfunc
#
#
exit 0
......@@ -4,8 +4,6 @@ echo 1..16 # Number of tests to be executed.
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
FORMATS="srv ext ieg grb grb2 nc nc2 nc4"
#
NTEST=1
......@@ -55,11 +53,8 @@ for OPERATOR in $STATS; do
test $? -eq 0 || let RSTAT+=1
test -s $FILE || let RSTAT+=1
$CDO diff,abslim=0.0001 $FILE $RFILE
test $? -eq 0 || let RSTAT+=1
else
OFILE=file_${DATATYPE}_${FORMAT}_res
CDOCOMMAND="$CDO copy $FILE $OFILE"
......@@ -68,11 +63,9 @@ for OPERATOR in $STATS; do
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDO diff,abslim=0.0001 $FILE $OFILE
test $? -eq 0 || let RSTAT+=1
rm -f $FILE $OFILE
fi
done
......@@ -83,11 +76,8 @@ for OPERATOR in $STATS; do
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST # SKIP $FILEFORMAT not enabled"
fi
fi
let NTEST+=1
done
done
#
#
exit 0
......@@ -12,7 +12,6 @@ ABSLIMMAX=0.001
ABSLIMDIS=0.2
ABSLIMSCON=0.25
FORMAT="-f srv -b 32"
GRIDS="n16 n32"
#
......@@ -38,7 +37,6 @@ for GRIDTYPE in "regular" "curvilinear" "unstructured"; do
OFILE=${GRID}_${RMOD}_$$
RFILE=$DATAPATH/${GRID}_${RMOD:3}_ref
CDOTEST="gen${RMOD} $GRID $GRIDTYPE"
CDOCOMMAND="$CDO $FORMAT $RMOD,$GRID $SETGRID $IFILE remapweights"
......@@ -58,8 +56,6 @@ for GRIDTYPE in "regular" "curvilinear" "unstructured"; do
$CDO diff,abslim=$ABSLIM $OFILE $RFILE
test $? -eq 0 || let RSTAT+=1
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
if [ $RMOD = dis ]; then
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST # TODO check depends on optimization"
......@@ -76,7 +72,5 @@ for GRIDTYPE in "regular" "curvilinear" "unstructured"; do
done
done
done
#
#
exit 0
......@@ -3,9 +3,6 @@ echo 1..1 # Number of tests to be executed.
#
test -n "$CDO" || CDO="@abs_top_builddir@/src/cdo $CDO_DEBUG"
test -n "$DATAPATH" || DATAPATH="@abs_top_srcdir@/test/data/"
#
#
IFILE=$DATAPATH/pl_data.grb
OFILE=pl_data.grb
......@@ -42,7 +39,5 @@ rm -f $OFILE $RFILE1 $RFILE2
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
#
exit 0
......@@ -23,6 +23,7 @@ TESTS =\
Copy_netcdf.test \
Detrend.test \
EOF.test \
EOFcoeff.test \
Enspctl.test \
Ensstat.test \
Expr.test \
......
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