Commit 8c364845 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added Remap2.test.in to test remapping on regional grids.

parent 0a2d5a4b
......@@ -21205,7 +21205,7 @@ ac_config_files="$ac_config_files test/File.test test/Read_grib.test test/Read_n
 
ac_config_files="$ac_config_files test/Comp.test test/Compc.test"
 
ac_config_files="$ac_config_files test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test"
ac_config_files="$ac_config_files test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test test/Remap2.test"
 
ac_config_files="$ac_config_files test/EOF.test test/Select.test test/Spectral.test test/Vertint.test"
 
......@@ -22384,6 +22384,7 @@ do
"test/Gridarea.test") CONFIG_FILES="$CONFIG_FILES test/Gridarea.test" ;;
"test/Genweights.test") CONFIG_FILES="$CONFIG_FILES test/Genweights.test" ;;
"test/Remap.test") CONFIG_FILES="$CONFIG_FILES test/Remap.test" ;;
"test/Remap2.test") CONFIG_FILES="$CONFIG_FILES test/Remap2.test" ;;
"test/EOF.test") CONFIG_FILES="$CONFIG_FILES test/EOF.test" ;;
"test/Select.test") CONFIG_FILES="$CONFIG_FILES test/Select.test" ;;
"test/Spectral.test") CONFIG_FILES="$CONFIG_FILES test/Spectral.test" ;;
......@@ -23915,6 +23916,7 @@ _LT_EOF
"test/Gridarea.test":F) chmod a+x "$ac_file" ;;
"test/Genweights.test":F) chmod a+x "$ac_file" ;;
"test/Remap.test":F) chmod a+x "$ac_file" ;;
"test/Remap2.test":F) chmod a+x "$ac_file" ;;
"test/EOF.test":F) chmod a+x "$ac_file" ;;
"test/Select.test":F) chmod a+x "$ac_file" ;;
"test/Spectral.test":F) chmod a+x "$ac_file" ;;
......
......@@ -252,7 +252,7 @@ AC_PROG_AWK
AC_CONFIG_FILES([test/File.test test/Read_grib.test test/Read_netcdf.test test/Copy_netcdf.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Comp.test test/Compc.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Cat.test test/Gridarea.test test/Genweights.test test/Remap.test test/Remap2.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/EOF.test test/Select.test test/Spectral.test test/Vertint.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Timstat.test test/Timselstat.test test/Seasstat.test test/Runstat.test test/Multiyearstat.test],[chmod a+x "$ac_file"])
AC_CONFIG_FILES([test/Gridboxstat.test test/Vertstat.test test/Fldstat.test test/Fldpctl.test test/Ensstat.test test/Enspctl.test],[chmod a+x "$ac_file"])
......
......@@ -13,7 +13,7 @@ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
# tests which should pass
TESTS = threads.test tsformat.test wildcard.test File.test Comp.test Compc.test \
Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test \
Detrend.test Genweights.test Remap.test Select.test Spectral.test \
Detrend.test Genweights.test Remap.test Remap2.test Select.test Spectral.test \
Ensstat.test Enspctl.test Gridboxstat.test \
Vertstat.test Fldstat.test Fldpctl.test Merstat.test Zonstat.test \
Timstat.test Timselstat.test Seasstat.test \
......
......@@ -85,21 +85,22 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/Copy_netcdf.test.in $(srcdir)/Comp.test.in \
$(srcdir)/Compc.test.in $(srcdir)/Cat.test.in \
$(srcdir)/Gridarea.test.in $(srcdir)/Genweights.test.in \
$(srcdir)/Remap.test.in $(srcdir)/EOF.test.in \
$(srcdir)/Select.test.in $(srcdir)/Spectral.test.in \
$(srcdir)/Vertint.test.in $(srcdir)/Timstat.test.in \
$(srcdir)/Timselstat.test.in $(srcdir)/Seasstat.test.in \
$(srcdir)/Runstat.test.in $(srcdir)/Multiyearstat.test.in \
$(srcdir)/Gridboxstat.test.in $(srcdir)/Vertstat.test.in \
$(srcdir)/Fldstat.test.in $(srcdir)/Fldpctl.test.in \
$(srcdir)/Ensstat.test.in $(srcdir)/Enspctl.test.in \
$(srcdir)/Merstat.test.in $(srcdir)/Zonstat.test.in \
$(srcdir)/Afterburner.test.in $(srcdir)/Detrend.test.in \
$(srcdir)/Arithc.test.in $(srcdir)/Arith.test.in \
$(srcdir)/Expr.test.in $(srcdir)/Gradsdes.test.in \
$(srcdir)/Collgrid.test.in $(srcdir)/threads.test.in \
$(srcdir)/tsformat.test.in $(srcdir)/wildcard.test.in \
$(srcdir)/MapReduce.test.in $(srcdir)/Ninfo.test.in README
$(srcdir)/Remap.test.in $(srcdir)/Remap2.test.in \
$(srcdir)/EOF.test.in $(srcdir)/Select.test.in \
$(srcdir)/Spectral.test.in $(srcdir)/Vertint.test.in \
$(srcdir)/Timstat.test.in $(srcdir)/Timselstat.test.in \
$(srcdir)/Seasstat.test.in $(srcdir)/Runstat.test.in \
$(srcdir)/Multiyearstat.test.in $(srcdir)/Gridboxstat.test.in \
$(srcdir)/Vertstat.test.in $(srcdir)/Fldstat.test.in \
$(srcdir)/Fldpctl.test.in $(srcdir)/Ensstat.test.in \
$(srcdir)/Enspctl.test.in $(srcdir)/Merstat.test.in \
$(srcdir)/Zonstat.test.in $(srcdir)/Afterburner.test.in \
$(srcdir)/Detrend.test.in $(srcdir)/Arithc.test.in \
$(srcdir)/Arith.test.in $(srcdir)/Expr.test.in \
$(srcdir)/Gradsdes.test.in $(srcdir)/Collgrid.test.in \
$(srcdir)/threads.test.in $(srcdir)/tsformat.test.in \
$(srcdir)/wildcard.test.in $(srcdir)/MapReduce.test.in \
$(srcdir)/Ninfo.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 \
......@@ -112,14 +113,14 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES = File.test Read_grib.test Read_netcdf.test \
Copy_netcdf.test Comp.test Compc.test Cat.test Gridarea.test \
Genweights.test Remap.test EOF.test Select.test Spectral.test \
Vertint.test Timstat.test Timselstat.test Seasstat.test \
Runstat.test Multiyearstat.test Gridboxstat.test Vertstat.test \
Fldstat.test Fldpctl.test Ensstat.test Enspctl.test \
Merstat.test Zonstat.test Afterburner.test Detrend.test \
Arithc.test Arith.test Expr.test Gradsdes.test Collgrid.test \
threads.test tsformat.test wildcard.test MapReduce.test \
Ninfo.test
Genweights.test Remap.test Remap2.test EOF.test Select.test \
Spectral.test Vertint.test Timstat.test Timselstat.test \
Seasstat.test Runstat.test Multiyearstat.test Gridboxstat.test \
Vertstat.test Fldstat.test Fldpctl.test Ensstat.test \
Enspctl.test Merstat.test Zonstat.test Afterburner.test \
Detrend.test Arithc.test Arith.test Expr.test Gradsdes.test \
Collgrid.test threads.test tsformat.test wildcard.test \
MapReduce.test Ninfo.test
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
......@@ -531,7 +532,7 @@ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
# tests which should pass
TESTS = threads.test tsformat.test wildcard.test File.test Comp.test Compc.test \
Read_grib.test Read_netcdf.test Copy_netcdf.test Cat.test Gridarea.test \
Detrend.test Genweights.test Remap.test Select.test Spectral.test \
Detrend.test Genweights.test Remap.test Remap2.test Select.test Spectral.test \
Ensstat.test Enspctl.test Gridboxstat.test \
Vertstat.test Fldstat.test Fldpctl.test Merstat.test Zonstat.test \
Timstat.test Timselstat.test Seasstat.test \
......@@ -607,6 +608,8 @@ Genweights.test: $(top_builddir)/config.status $(srcdir)/Genweights.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Remap.test: $(top_builddir)/config.status $(srcdir)/Remap.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Remap2.test: $(top_builddir)/config.status $(srcdir)/Remap2.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
EOF.test: $(top_builddir)/config.status $(srcdir)/EOF.test.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Select.test: $(top_builddir)/config.status $(srcdir)/Select.test.in
......
#! @BASH@
if [ "$USER" = "m214003" ]; then
echo 1..7 # Number of tests to be executed.
else
echo 1..5 # Number of tests to be executed.
fi
#
test -n "$CDO" || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
ABSLIMMAX=0.001
ABSLIMDIS=0.2
ABSLIMYCON=0.25
CDOOUT=cout$$
CDOERR=cerr$$
FORMAT="-f srv -b 32"
GRID=$DATAPATH/spain.grid
#
IFILE=$DATAPATH/tsurf_spain.grb
NTEST=1
#
# remaplaf: sort could give different results"
RMODS="bil bic con ycon laf"
if [ "$USER" = "m214003" ]; then RMODS="dis nn $RMODS"; fi
for RMOD in $RMODS; do
ABSLIM=$ABSLIMMAX
if [ $RMOD = dis ]; then ABSLIM=$ABSLIMDIS; fi
if [ $RMOD = ycon ]; then ABSLIM=$ABSLIMYCON; fi
CDOTEST="remap${RMOD} regional"
RSTAT=0
for extra in def off on; do
EXTRA="$extra"
if [ "$EXTRA" = "def" ]; then EXTRA=""; fi
OFILE=tsurf_spain_${RMOD}_${extra}$$
RFILE=$DATAPATH/tsurf_spain_${RMOD}_${extra}_ref
CDOCOMMAND="$CDO $FORMAT remap${RMOD},$GRID $IFILE ${OFILE}"
echo "Running test: $NTEST"
echo "$CDOCOMMAND"
REMAP_EXTRAPOLATE=$EXTRA $CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
# $CDO diff,$ABSLIM $OFILE $RFILE > $CDOOUT 2> $CDOERR
$CDO diff $OFILE $RFILE > $CDOOUT 2> $CDOERR
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
rm -f $OFILE
done
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
if [ $RMOD = dis ]; then
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST # TODO check depends on optimization"
else
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
fi
let NTEST+=1
rm -f $OFILE
done
#
rm -f $CDOOUT $CDOERR
#
exit 0
INPUTDATA = ts_mm_5years ts_6h_1mon ts_1d_1year hl_l19.grb t21_geosp_tsurf.grb bathy4.grb pl_data pl_data.grb detrend_data \
grib_testfile01.grb grib_testfile02.grb grib_testfile03.grb netcdf_testfile01.nc netcdf_testfile02.nc testfile01c.nc \
datar.nc datac.nc datau.nc datag.nc arith1.srv expr1.srv arithmask.srv psl_DJF_anom.grb
datar.nc datac.nc datau.nc datag.nc arith1.srv expr1.srv arithmask.srv psl_DJF_anom.grb tsurf_spain.grb spain.grid
FILE_REF = file_F32_srv_ref
GRIB_REF = grib_testfile01_sinfo_ref grib_testfile01_info_ref grib_testfile02_sinfo_ref grib_testfile02_info_ref grib_testfile03_sinfo_ref grib_testfile03_info_ref
......@@ -25,6 +25,11 @@ SPECTRAL_REF = sp2gp_ref sp2gpl_ref gp2sp_ref gp2spl_ref
VERTINT_REF = ml2pl_ref
REMAP_REF = n16_bic_ref n16_bil_ref n16_con_ref n16_ycon_ref n16_laf_ref n16_nn_ref n16_dis_ref \
n32_bic_ref n32_bil_ref n32_con_ref n32_ycon_ref n32_laf_ref n32_nn_ref n32_dis_ref
REMAP2_REF = tsurf_spain_bic_def_ref tsurf_spain_bil_on_ref tsurf_spain_dis_off_ref tsurf_spain_nn_def_ref tsurf_spain_ycon_on_ref \
tsurf_spain_bic_off_ref tsurf_spain_con_def_ref tsurf_spain_dis_on_ref tsurf_spain_nn_off_ref \
tsurf_spain_bic_on_ref tsurf_spain_con_off_ref tsurf_spain_laf_def_ref tsurf_spain_nn_on_ref \
tsurf_spain_bil_def_ref tsurf_spain_con_on_ref tsurf_spain_laf_off_ref tsurf_spain_ycon_def_ref \
tsurf_spain_bil_off_ref tsurf_spain_dis_def_ref tsurf_spain_laf_on_ref tsurf_spain_ycon_off_ref
SELECT_REF = select1_ref select2_ref select3_ref select4_ref select5_ref
DETREND_REF = detrend_ref
EXPR_REF = expr1_ref aexpr1_ref expr2_ref aexpr2_ref
......@@ -33,4 +38,7 @@ GRADSDES_REF = pl_data.ctl pl_data.gmp
ARITH_REF = arithadd_ref arithsub_ref arithmul_ref arithdiv_ref
MAPREDUCE = r18x9_grid icon_cell_grid griddes.r18x9 griddes.icon_cell
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(EOF_REF) $(COMP_REF) $(YMONSTAT_REF) $(YSEASSTAT_REF) $(SEASSTAT_REF) $(RUNSTAT_REF) $(TIMSTAT_REF) $(YEARSTAT_REF) $(MONSTAT_REF) $(DAYSTAT_REF) $(VERTSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(EOF_REF) $(COMP_REF) $(YMONSTAT_REF) $(YSEASSTAT_REF) $(SEASSTAT_REF) \
$(RUNSTAT_REF) $(TIMSTAT_REF) $(YEARSTAT_REF) $(MONSTAT_REF) $(DAYSTAT_REF) $(VERTSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) \
$(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(REMAP2_REF) $(SELECT_REF) $(DETREND_REF) \
$(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
......@@ -288,7 +288,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INPUTDATA = ts_mm_5years ts_6h_1mon ts_1d_1year hl_l19.grb t21_geosp_tsurf.grb bathy4.grb pl_data pl_data.grb detrend_data \
grib_testfile01.grb grib_testfile02.grb grib_testfile03.grb netcdf_testfile01.nc netcdf_testfile02.nc testfile01c.nc \
datar.nc datac.nc datau.nc datag.nc arith1.srv expr1.srv arithmask.srv psl_DJF_anom.grb
datar.nc datac.nc datau.nc datag.nc arith1.srv expr1.srv arithmask.srv psl_DJF_anom.grb tsurf_spain.grb spain.grid
FILE_REF = file_F32_srv_ref
GRIB_REF = grib_testfile01_sinfo_ref grib_testfile01_info_ref grib_testfile02_sinfo_ref grib_testfile02_info_ref grib_testfile03_sinfo_ref grib_testfile03_info_ref
......@@ -314,6 +314,12 @@ VERTINT_REF = ml2pl_ref
REMAP_REF = n16_bic_ref n16_bil_ref n16_con_ref n16_ycon_ref n16_laf_ref n16_nn_ref n16_dis_ref \
n32_bic_ref n32_bil_ref n32_con_ref n32_ycon_ref n32_laf_ref n32_nn_ref n32_dis_ref
REMAP2_REF = tsurf_spain_bic_def_ref tsurf_spain_bil_on_ref tsurf_spain_dis_off_ref tsurf_spain_nn_def_ref tsurf_spain_ycon_on_ref \
tsurf_spain_bic_off_ref tsurf_spain_con_def_ref tsurf_spain_dis_on_ref tsurf_spain_nn_off_ref \
tsurf_spain_bic_on_ref tsurf_spain_con_off_ref tsurf_spain_laf_def_ref tsurf_spain_nn_on_ref \
tsurf_spain_bil_def_ref tsurf_spain_con_on_ref tsurf_spain_laf_off_ref tsurf_spain_ycon_def_ref \
tsurf_spain_bil_off_ref tsurf_spain_dis_def_ref tsurf_spain_laf_on_ref tsurf_spain_ycon_off_ref
SELECT_REF = select1_ref select2_ref select3_ref select4_ref select5_ref
DETREND_REF = detrend_ref
EXPR_REF = expr1_ref aexpr1_ref expr2_ref aexpr2_ref
......@@ -321,7 +327,11 @@ THREAD_REF = thread1_ref tsformat1_ref
GRADSDES_REF = pl_data.ctl pl_data.gmp
ARITH_REF = arithadd_ref arithsub_ref arithmul_ref arithdiv_ref
MAPREDUCE = r18x9_grid icon_cell_grid griddes.r18x9 griddes.icon_cell
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(EOF_REF) $(COMP_REF) $(YMONSTAT_REF) $(YSEASSTAT_REF) $(SEASSTAT_REF) $(RUNSTAT_REF) $(TIMSTAT_REF) $(YEARSTAT_REF) $(MONSTAT_REF) $(DAYSTAT_REF) $(VERTSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) $(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(SELECT_REF) $(DETREND_REF) $(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
EXTRA_DIST = $(INPUTDATA) $(FILE_REF) $(GRIB_REF) $(NETCDF_REF) $(EOF_REF) $(COMP_REF) $(YMONSTAT_REF) $(YSEASSTAT_REF) $(SEASSTAT_REF) \
$(RUNSTAT_REF) $(TIMSTAT_REF) $(YEARSTAT_REF) $(MONSTAT_REF) $(DAYSTAT_REF) $(VERTSTAT_REF) $(FLDSTAT_REF) $(FLDPSTAT_REF) \
$(MERSTAT_REF) $(ZONSTAT_REF) $(ENSPSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF) $(REMAP2_REF) $(SELECT_REF) $(DETREND_REF) \
$(THREAD_REF) $(EXPR_REF) $(GRADSDES_REF) $(ARITH_REF) $(MAPREDUCE)
all: all-am
.SUFFIXES:
......
......@@ -6,6 +6,31 @@ FORMAT="-f srv -b F32"
#
########################################################################
#
# Remap regional grid
#
GRID=spain.grid
cat > $GRID <<EOF
gridtype=lonlat
xsize=20
ysize=18
xfirst=-13
yfirst=33
xinc=.8
yinc=.8
EOF
RMODS="bil bic dis nn con ycon laf"
IFILE=tsurf_spain.grb
for RMOD in $RMODS; do
OFILE=tsurf_spain_${RMOD}
for extra in def off on; do
EXTRA="$extra"
if [ "$EXTRA" = "def" ]; then EXTRA=""; fi
REMAP_EXTRAPOLATE=$EXTRA $CDO $FORMAT remap${RMOD},${GRID} $IFILE ${OFILE}_${extra}_ref
done
done
exit
########################################################################
#
# EOF
#
export CDO_FILE_SUFFIX=NULL
......
gridtype=lonlat
xsize=20
ysize=18
xfirst=-13
yfirst=33
xinc=.8
yinc=.8
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