Commit e8ab8b26 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

fixed tsformat.test.in

parent 10ea2dbc
......@@ -12,77 +12,79 @@ NTEST=1
#
function fileformat()
{
FILEFORMAT=undefined
FILEFORMAT=undefined
if [ "${FORMAT}" = srv ] ; then FILEFORMAT=SERVICE; fi
if [ "${FORMAT}" = ext ] ; then FILEFORMAT=EXTRA; fi
if [ "${FORMAT}" = ieg ] ; then FILEFORMAT=IEG; fi
if [ "${FORMAT}" = grb ] ; then FILEFORMAT=GRIB; fi
if [ "${FORMAT}" = grb2 ] ; then FILEFORMAT=GRIB_API; fi
if [ "${FORMAT}" = nc ] ; then FILEFORMAT=netCDF; fi
if [ "${FORMAT}" = nc2 ] ; then FILEFORMAT=netCDF2; fi
if [ "${FORMAT}" = nc4 ] ; then FILEFORMAT=netCDF4; fi
if [ "${FORMAT}" = srv ] ; then FILEFORMAT=SERVICE; fi
if [ "${FORMAT}" = ext ] ; then FILEFORMAT=EXTRA; fi
if [ "${FORMAT}" = ieg ] ; then FILEFORMAT=IEG; fi
if [ "${FORMAT}" = grb ] ; then FILEFORMAT=GRIB; fi
if [ "${FORMAT}" = grb2 ] ; then FILEFORMAT=GRIB_API; fi
if [ "${FORMAT}" = nc ] ; then FILEFORMAT=netCDF; fi
if [ "${FORMAT}" = nc2 ] ; then FILEFORMAT=netCDF2; fi
if [ "${FORMAT}" = nc4 ] ; then FILEFORMAT=netCDF4; fi
HAS_FORMAT=`${CDO} --config has-${FORMAT}`
HAS_FORMAT=`${CDO} --config has-${FORMAT}`
}
#
function testfunc()
{
RSTAT=0
if [ -z "$1" ] || [ $NTEST == $1 ]; then
RSTAT=0
CDOTEST="chaining set $INSET with $FILEFORMAT"
echo "Running test: $NTEST - $CDOTEST"
CDOTEST="chaining set $INSET with $FILEFORMAT"
echo "Running test: $NTEST - $CDOTEST"
RFILE=$DATAPATH/tsformat${INSET}_ref
OFILE=thread${NTEST}_res
RFILE=$DATAPATH/tsformat${INSET}_ref
OFILE=thread${NTEST}_res
CDOCOMMAND="$CDO $INSTR ${IFILE}(${FORMAT}) $OFILE"
CDOCOMMAND="$CDO $INSTR ${IFILE}(${FORMAT}) $OFILE"
echo "$CDOCOMMAND"
echo "$CDOCOMMAND"
HAS_THREADS=`${CDO} --config has-threads`
HAS_THREADS=`${CDO} --config has-threads`
if [ "${HAS_FORMAT}" = yes ] ; then
if [ "${HAS_THREADS}" = yes ] ; then
$CDO -f $FORMAT setgrid,r12x6 ${IFILE} ifile$$
CDOCOMMAND="$CDO $INSTR ifile$$ $OFILE"
if [ "${HAS_FORMAT}" = yes ] ; then
if [ "${HAS_THREADS}" = yes ] ; then
$CDO -f $FORMAT setgrid,r12x6 ${IFILE} ifile$$
CDOCOMMAND="$CDO $INSTR ifile$$ $OFILE"
for i in {1..5} ; do
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
done
for i in {1..5} ; do
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
done
$CDO diff -selcode,130 $RFILE $OFILE
test $? -eq 0 || let RSTAT+=1
$CDO diff -selcode,130 $RFILE $OFILE
test $? -eq 0 || let RSTAT+=1
rm -f $OFILE ifile$$
rm -f $OFILE ifile$$
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
else
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST # SKIP threads not enabled"
fi
else
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST # SKIP $FILEFORMAT not enabled"
fi
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
else
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST # SKIP threads not enabled"
fi
else
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST # SKIP $FILEFORMAT not enabled"
fi
let NTEST+=1
rm -f $OFILE
rm -f $OFILE
fi
let NTEST+=1
}
#
for FORMAT in $FORMATS; do
fileformat
INSTR="-fldmin -timmean -select,code=130"
INSET=1
testfunc
fileformat
INSTR="-fldmin -timmean -select,code=130"
INSET=1
testfunc $1
done
#
FORMAT="nc4"
fileformat
if [ ${H5_HAVE_THREADSAFE} = yes ] ; then
if ![ -z "${H5_HAVE_THREADSAFE}" ] ; then
INSTR="-fldmin -timmean -select,code=130"
INSET=1
testfunc
testfunc $1
else
echo "ok $NTEST - $CDOTEST # SKIP $FORMAT enabled but not threadsafe (hdf5)"
fi
......
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