Commit a4dcfec0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added test/Collgrid.test

parent 9aa924f0
......@@ -710,6 +710,7 @@ test/.checklib_pyunittest -text
test/Afterburner.test.in -text
test/Arith.test.in -text
test/Cat.test.in -text
test/Collgrid.test.in -text
test/Copy_netcdf.test.in -text
test/Detrend.test.in -text
test/Enspctl.test.in -text
......
......@@ -21259,7 +21259,7 @@ ac_config_files="$ac_config_files test/Ymonstat.test test/Fldstat.test test/Fldp
 
ac_config_files="$ac_config_files test/Afterburner.test test/Detrend.test test/Arith.test test/Gradsdes.test"
 
ac_config_files="$ac_config_files test/wildcard.test"
ac_config_files="$ac_config_files test/Collgrid.test test/wildcard.test"
 
ac_config_files="$ac_config_files Makefile src/Makefile contrib/Makefile test/Makefile test/data/Makefile cdo.spec cdo.settings"
 
......@@ -22431,6 +22431,7 @@ do
"test/Detrend.test") CONFIG_FILES="$CONFIG_FILES test/Detrend.test" ;;
"test/Arith.test") CONFIG_FILES="$CONFIG_FILES test/Arith.test" ;;
"test/Gradsdes.test") CONFIG_FILES="$CONFIG_FILES test/Gradsdes.test" ;;
"test/Collgrid.test") CONFIG_FILES="$CONFIG_FILES test/Collgrid.test" ;;
"test/wildcard.test") CONFIG_FILES="$CONFIG_FILES test/wildcard.test" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
......@@ -23945,6 +23946,7 @@ _LT_EOF
"test/Detrend.test":F) chmod a+x "$ac_file" ;;
"test/Arith.test":F) chmod a+x "$ac_file" ;;
"test/Gradsdes.test":F) chmod a+x "$ac_file" ;;
"test/Collgrid.test":F) chmod a+x "$ac_file" ;;
"test/wildcard.test":F) chmod a+x "$ac_file" ;;
 
esac
......
......@@ -247,7 +247,7 @@ AC_CONFIG_FILES([test/Cat.test test/Gridarea.test test/Genweights.test test/Rema
AC_CONFIG_FILES([test/Select.test test/Spectral.test test/Timstat.test test/Vertint.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Ymonstat.test test/Fldstat.test test/Fldpctl.test test/Ensstat.test test/Enspctl.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Afterburner.test test/Detrend.test test/Arith.test test/Gradsdes.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/wildcard.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Collgrid.test test/wildcard.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([Makefile src/Makefile contrib/Makefile test/Makefile test/data/Makefile cdo.spec cdo.settings])
AC_OUTPUT
......
......@@ -151,9 +151,15 @@ int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid, int nxblocks
if ( yvals[fileID][0] > yvals[fileID][ysize[fileID]-1] ) lsouthnorth = FALSE;
}
}
else
{
xyinfo[fileID].x = 0;
xyinfo[fileID].y = 0;
xyinfo[fileID].id = fileID;
}
}
if ( cdoVerbose )
if ( cdoVerbose && lregular )
for ( int fileID = 0; fileID < nfiles; fileID++ )
printf("1 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
......@@ -476,8 +482,7 @@ void *Collgrid(void *argument)
{
if ( gridIDs[i] != -1 )
{
if ( gridID == vlistGrid(vlistID2, i) )
vars[varID] = TRUE;
if ( gridID == vlistGrid(vlistID2, i) ) vars[varID] = TRUE;
break;
}
}
......
#! @SHELL@
echo 1..3 # Number of tests to be executed.
#
test -n "$CDO" || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
CDOOUT=cout
CDOERR=cerr
#
FILES="datar.nc datac.nc"
FILES="datar.nc"
DISTS="4,3 12,1 1,6"
#
NTEST=1
#
for FILE in $FILES; do
for DIST in $DISTS; do
RSTAT=0
IFILE=$DATAPATH/${FILE}
OFILE=${OPERATOR}_${FILE}
CDOTEST="collgrid $DIST $FILE"
if [ "@ENABLE_NETCDF@" = yes ] ; then
nx=$(echo $DIST | sed 's/,.*//')
NX=""
if [ $FILE = datac.nc ] ; then NX=",$nx" ; fi
CDOCOMMAND="$CDO collgrid$NX xxx* $OFILE"
echo "Running test: $NTEST"
echo "$CDOCOMMAND"
$CDO distgrid,$DIST $IFILE xxx
test $? -eq 0 || let RSTAT+=1
$CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
$CDO diff $IFILE $OFILE > $CDOOUT 2> $CDOERR
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
rm -f $OFILE xxx*
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 netCDF not enabled"
fi
let NTEST+=1
done
done
#
rm -f $CDOOUT $CDOERR
#
exit 0
......@@ -13,7 +13,8 @@ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
# tests which should pass
TESTS = File.test Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test Detrend.test \
Genweights.test Remap.test Select.test Spectral.test Ymonstat.test Timstat.test Ensstat.test \
Enspctl.test Fldstat.test Fldpctl.test Vertint.test Afterburner.test Arith.test Gradsdes.test wildcard.test
Enspctl.test Fldstat.test Fldpctl.test Vertint.test Afterburner.test Arith.test Gradsdes.test \
Collgrid.test wildcard.test
# tests which should fail
XFAIL_TESTS =
......
......@@ -91,7 +91,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/Ensstat.test.in $(srcdir)/Enspctl.test.in \
$(srcdir)/Afterburner.test.in $(srcdir)/Detrend.test.in \
$(srcdir)/Arith.test.in $(srcdir)/Gradsdes.test.in \
$(srcdir)/wildcard.test.in README
$(srcdir)/Collgrid.test.in $(srcdir)/wildcard.test.in README
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
......@@ -107,7 +107,7 @@ CONFIG_CLEAN_FILES = File.test Read_grib.test Read_netcdf.test \
Remap.test Select.test Spectral.test Timstat.test Vertint.test \
Ymonstat.test Fldstat.test Fldpctl.test Ensstat.test \
Enspctl.test Afterburner.test Detrend.test Arith.test \
Gradsdes.test wildcard.test
Gradsdes.test Collgrid.test wildcard.test
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
......@@ -519,7 +519,8 @@ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
# tests which should pass
TESTS = File.test Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test Detrend.test \
Genweights.test Remap.test Select.test Spectral.test Ymonstat.test Timstat.test Ensstat.test \
Enspctl.test Fldstat.test Fldpctl.test Vertint.test Afterburner.test Arith.test Gradsdes.test wildcard.test
Enspctl.test Fldstat.test Fldpctl.test Vertint.test Afterburner.test Arith.test Gradsdes.test \
Collgrid.test wildcard.test
# $(top_srcdir)/test/test_Remap.sh \
......@@ -610,6 +611,8 @@ Arith.test: $(top_builddir)/config.status $(srcdir)/Arith.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Gradsdes.test: $(top_builddir)/config.status $(srcdir)/Gradsdes.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Collgrid.test: $(top_builddir)/config.status $(srcdir)/Collgrid.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
wildcard.test: $(top_builddir)/config.status $(srcdir)/wildcard.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
......
......@@ -288,7 +288,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INPUTDATA = ts_mm_5years hl_l19.grb t21_geosp_tsurf.grb bathy4.grb pl_data pl_data.grb detrend_data \
grib_testfile01.grb grib_testfile02.grb netcdf_testfile01.nc netcdf_testfile02.nc testfile01c.nc \
datar.nc datac.nc datau.nc
datar.nc datac.nc datau.nc datag.nc
FILE_REF = file_F32_srv_ref
GRIB_REF = grib_testfile01_sinfo_ref grib_testfile01_info_ref grib_testfile02_sinfo_ref grib_testfile02_info_ref
......
Supports Markdown
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