#! @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/t21_geosp_tsurf.grb
#
RFILE=catdata_ref
OFILE=catdata
#
cp $IFILE ${RFILE}
chmod u+w ${RFILE}
cat $IFILE >> ${RFILE}
#
rm -f ${OFILE}
#
CDOTEST="cat"
CDOCOMMAND="$CDO cat $IFILE ${OFILE}"
#
$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
#
test $RSTAT -eq 0 && echo "ok 1 - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok 1 - $CDOTEST"
#
rm -f $OFILE $RFILE
#
rm -f $CDOOUT $CDOERR
#
exit 0
