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

Added test/test_Remap.sh

parent c3786878
......@@ -601,6 +601,16 @@ test/data/gp2sp_ref -text
test/data/gp2spl_ref -text
test/data/hl_l19.grb -text
test/data/ml2pl_ref -text
test/data/n16_bic_ref -text
test/data/n16_bil_ref -text
test/data/n16_con_ref -text
test/data/n16_laf_ref -text
test/data/n16_nn_ref -text
test/data/n32_bic_ref -text
test/data/n32_bil_ref -text
test/data/n32_con_ref -text
test/data/n32_laf_ref -text
test/data/n32_nn_ref -text
test/data/sp2gp_ref -text
test/data/sp2gpl_ref -text
test/data/t21_geosp_tsurf.grb -text
......@@ -618,6 +628,7 @@ test/testStreams.py -text
test/test_Arith.py -text
test/test_Arithc.py -text
test/test_Gridarea.sh -text
test/test_Remap.sh -text
test/test_Selvar.py -text
test/test_Spectral.sh -text
test/test_Timstat.sh -text
......
......@@ -3,6 +3,10 @@
* using CDI library version 1.6.2
* Version 1.6.2 released
2013-11-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Added test/test_Remap.sh
2013-10-25 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* eca_gsl: start date of growing season is wrong if the length of growing season is zero (bug fix)
......
......@@ -3,6 +3,7 @@ CLEANFILES =
export
TESTS = $(top_srcdir)/test/test_Gridarea.sh \
$(top_srcdir)/test/test_Remap.sh \
$(top_srcdir)/test/test_Spectral.sh \
$(top_srcdir)/test/test_Timstat.sh \
$(top_srcdir)/test/test_Vertint.sh
......
......@@ -252,6 +252,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
CLEANFILES = `ls *.pyc`
TESTS = $(top_srcdir)/test/test_Gridarea.sh \
$(top_srcdir)/test/test_Remap.sh \
$(top_srcdir)/test/test_Spectral.sh \
$(top_srcdir)/test/test_Timstat.sh \
$(top_srcdir)/test/test_Vertint.sh
......
INPUTDATA = ts_mm_5years hl_l19.grb t21_geosp_tsurf.grb
INPUTDATA = ts_mm_5years hl_l19.grb t21_geosp_tsurf.grb bathy4.grb
TIMSTAT_REF = timmin_ref timmax_ref timsum_ref timavg_ref timmean_ref timstd_ref timstd1_ref timvar_ref timvar1_ref
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_laf_ref n16_nn_ref n32_bic_ref n32_bil_ref n32_con_ref n32_laf_ref n32_nn_ref
EXTRA_DIST = $(INPUTDATA) $(TIMSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF)
EXTRA_DIST = $(INPUTDATA) $(TIMSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF)
......@@ -235,11 +235,12 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INPUTDATA = ts_mm_5years hl_l19.grb t21_geosp_tsurf.grb
INPUTDATA = ts_mm_5years hl_l19.grb t21_geosp_tsurf.grb bathy4.grb
TIMSTAT_REF = timmin_ref timmax_ref timsum_ref timavg_ref timmean_ref timstd_ref timstd1_ref timvar_ref timvar1_ref
SPECTRAL_REF = sp2gp_ref sp2gpl_ref gp2sp_ref gp2spl_ref
VERTINT_REF = ml2pl_ref
EXTRA_DIST = $(INPUTDATA) $(TIMSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF)
REMAP_REF = n16_bic_ref n16_bil_ref n16_con_ref n16_laf_ref n16_nn_ref n32_bic_ref n32_bil_ref n32_con_ref n32_laf_ref n32_nn_ref
EXTRA_DIST = $(INPUTDATA) $(TIMSTAT_REF) $(SPECTRAL_REF) $(VERTINT_REF) $(REMAP_REF)
all: all-am
.SUFFIXES:
......
......@@ -4,6 +4,8 @@ CDO=cdo
#
FORMAT="-f srv -b 32"
#
########################################################################
#
# Timstat
#
IFILE=EH5_AMIP_1_TSURF_6H_1991-1995.grb
......@@ -23,6 +25,7 @@ IFILE=$OFILE
for STAT in $STATS; do
$CDO $FORMAT tim$STAT $IFILE tim${STAT}_ref
done
########################################################################
#
# Vertint
#
......@@ -32,6 +35,7 @@ $CDO fldmean -sp2gp -selcode,129,130,152 $IFILE $OFILE
IFILE=$OFILE
OFILE=ml2pl_ref
$CDO $FORMAT ml2pl,92500,85000,50000,20000 $IFILE $OFILE
########################################################################
#
# Spectral
#
......@@ -50,3 +54,19 @@ $CDO sp2gp $IFILE $OFILE
IFILE=gp2spl_ref
OFILE=sp2gpl_ref
$CDO sp2gpl $IFILE $OFILE
########################################################################
#
# Remap
#
cdo -f grb setrtomiss,0,10000 -gridboxmean,8,8 -topo bathy4.grb
#
GRIDS="n16 n32"
RMODS="bil bic nn con laf"
IFILE=bathy4.grb
for GRID in $GRIDS; do
for RMOD in $RMODS; do
OFILE=${GRID}_${RMOD}
$CDO $FORMAT remap${RMOD},$GRID $IFILE ${OFILE}_ref
done
done
########################################################################
#!/bin/sh
#
#CDO=cdo
#DATAPATH=data
#
CDODEBUG=0
#
if [ "$CDODEBUG" == 0 ]; then CDO="$CDO -s"; fi
CDOOUT=cout
CDOERR=cerr
FORMAT="-f srv -b 32"
GRIDS="n16 n32"
RSTAT=0;
#
IFILE=$DATAPATH/bathy4.grb
#
for GRIDTYPE in " " "-setgridtype,curvilinear" "-setgridtype,unstructured"; do
for GRID in $GRIDS; do
RMODS="bil bic nn con laf"
if [ "$GRIDTYPE" == "-setgridtype,unstructured" ]; then RMODS="nn con laf"; fi
for RMOD in $RMODS; do
OFILE=${GRID}_${RMOD}
RFILE=$DATAPATH/${OFILE}_ref
$CDO $FORMAT remap${RMOD},$GRID $GRIDTYPE $IFILE ${OFILE} > $CDOOUT 2> $CDOERR
if [ $? != 0 ] ; then RSTAT=`expr $RSTAT + 1`; fi
if [ "$CDODEBUG" == 1 ]; then cat $CDOOUT $CDOERR; fi
$CDO diff $OFILE $RFILE > $CDOOUT 2> $CDOERR
if [ $? != 0 ] ; then RSTAT=`expr $RSTAT + 1`; fi
if [ -s $CDOOUT ] ; then RSTAT=`expr $RSTAT + 1`; fi
if [ "$CDODEBUG" == 1 ]; then cat $CDOOUT $CDOERR; fi
rm -f $OFILE
done
done
done
#
rm -f $CDOOUT $CDOERR
#
if [ "$CDODEBUG" == 1 ]; then
echo "rstat: $RSTAT"
fi
#
exit $RSTAT
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