#! @SHELL@
echo 1..1 # Number of tests to be executed.
#
test -n "$CDO"      || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
CDOOUT=cout$$
CDOERR=cerr$$
FORMAT="-f srv -b 32"
RSTAT=0
#
IFILE=$DATAPATH/hl_l19.grb
#
RFILE=$DATAPATH/ml2pl_ref
OFILE=ml2pl_res
#
CDOTEST="ml2pl"
CDOCOMMAND="$CDO $FORMAT ml2pl,92500,85000,50000,20000 $IFILE $OFILE"
#
echo "$CDOCOMMAND"
#
$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
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
rm -f $OFILE
#
rm -f $CDOOUT $CDOERR
#
exit 0
