2010-06-03 21:24:43 +08:00
|
|
|
#!/bin/sh
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
|
|
. ../test_common.sh
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
# This shell script tests ncdump -t option for CF calendar attributes
|
|
|
|
|
|
|
|
set -e
|
|
|
|
echo ""
|
|
|
|
echo "*** Testing ncdump -t output for times with CF calendar attribute"
|
|
|
|
echo "*** creating netcdf file tst_calendars.nc from tst_calendars.cdl..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCGEN} -b -o tst_calendars.nc $srcdir/tst_calendars.cdl
|
2011-09-06 00:09:17 +08:00
|
|
|
echo "*** creating tst_times.cdl from tst_calendars.nc with ncdump -t ..."
|
2017-03-09 08:01:10 +08:00
|
|
|
${NCDUMP} -n tst_times -t tst_calendars.nc > tst_times.cdl
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** comparing tst_times.cdl with ref_times.cdl..."
|
2012-05-09 03:36:27 +08:00
|
|
|
diff -b tst_times.cdl $srcdir/ref_times.cdl
|
2017-07-26 01:58:34 +08:00
|
|
|
echo ""
|
|
|
|
echo "*** Testing ncdump -t output"
|
|
|
|
echo "*** creating tst_mud4.cdl from tst_mud4.nc ..."
|
|
|
|
|
|
|
|
# Test 360, 365 and 366 day calendars specifically
|
|
|
|
TSTS="test_360_day_1900 test_365_day_1900 test_366_day_1900"
|
|
|
|
for t in $TSTS ; do
|
|
|
|
rm -f ./${t}.cdl
|
|
|
|
echo "create: ${t}.cdl from ${t}.nc"
|
2017-11-19 05:20:04 +08:00
|
|
|
${NCDUMP} -n ${t} -t $srcdir/ref_${t}.nc > ${t}.cdl
|
2017-07-26 01:58:34 +08:00
|
|
|
echo "compare: ${t}.cdl ref_${t}.cdl"
|
|
|
|
diff -b ${t}.cdl $srcdir/ref_${t}.cdl
|
|
|
|
rm -f ${t}.cdl
|
|
|
|
done
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
echo "*** All ncdump test output for -t option with CF calendar atts passed!"
|
2017-07-26 01:58:34 +08:00
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
exit 0
|