Skip to content

Commit

Permalink
feature/reg_tests This commit references ufs-community#99.
Browse files Browse the repository at this point in the history
Add reg test for emcsfc_ice_blend program.  Add
driver script for Hera.
  • Loading branch information
GeorgeGayno-NOAA committed Apr 30, 2020
1 parent 9dea088 commit fbcca4b
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 2 deletions.
53 changes: 53 additions & 0 deletions reg_tests/ice_blend/driver.hera.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

#-----------------------------------------------------------------------------
#
# Run ice_blend regression test on Hera.
#
# Set $DATA to your working directory. Set the project code (SBATCH -A)
# and queue (SBATCH -q) as appropriate.
#
# Invoke the script as follows: sbatch $script
#
# Log output is placed in regression.log. A summary is
# placed in summary.log
#
# The test fails when its output does not match the baseline files
# as determined by the 'cmp' command. The baseline files are
# stored in HOMEreg.
#
#-----------------------------------------------------------------------------

#SBATCH -J ice_blend
#SBATCH -A fv3-cpu
#SBATCH --open-mode=truncate
#SBATCH -o regression.log
#SBATCH -e regression.log
#SBATCH --ntasks=1
#SBATCH -q debug
#SBATCH -t 00:03:00

set -x

module load intel

export DATA="/scratch2/NCEPDEV/stmp1/$LOGNAME/reg_test.ice_blend"

#-----------------------------------------------------------------------------
# Should not have to change anything below.
#-----------------------------------------------------------------------------

export WGRIB=/scratch2/NCEPDEV/nwprod/NCEPLIBS/utils/grib_util.v1.1.1/exec/wgrib
export WGRIB2=/scratch2/NCEPDEV/nwprod/NCEPLIBS/utils/grib_util.v1.1.1/exec/wgrib2
export COPYGB=/scratch2/NCEPDEV/nwprod/NCEPLIBS/utils/grib_util.v1.1.1/exec/copygb
export COPYGB2=/scratch2/NCEPDEV/nwprod/NCEPLIBS/utils/grib_util.v1.1.1/exec/copygb2
export CNVGRIB=/scratch2/NCEPDEV/nwprod/NCEPLIBS/utils/grib_util.v1.1.1/exec/cnvgrib

export HOMEreg=/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/ice_blend
export HOMEgfs=$PWD/../..

rm -fr $DATA

./ice_blend.sh

exit 0
43 changes: 43 additions & 0 deletions reg_tests/ice_blend/ice_blend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

#-----------------------------------------------------------------------------
# Run ice_blend regression test. This script called from it machine-specific
# driver script.
#-----------------------------------------------------------------------------

export IMS_FILE=$HOMEreg/input_data/imssnow96.grib2.gdas.2018120618
export FIVE_MIN_ICE_FILE=$HOMEreg/input_data/seaice.5min.grib2.gdas.2018120618

${HOMEgfs}/ush/emcsfc_ice_blend.sh

iret=$?
if [ $iret -ne 0 ]; then
set +x
echo "<<< ICE_BLEND TEST FAILED. <<<"
echo "<<< ICE_BLEND TEST FAILED. <<<" > ./summary.log
exit $iret
fi

cmp ${DATA}/seaice.5min.blend $HOMEreg/baseline_data/seaice.5min.blend
iret=$?
test_failed=0
if [ $iret -ne 0 ]; then
test_failed=1
fi

set +x
if [ $test_failed -ne 0 ]; then
echo
echo "*********************************"
echo "<<< ICE BLEND TEST FAILED. >>>"
echo "*********************************"
echo "<<< ICE BLEND TEST FAILED. >>>" > ./summary.log
else
echo
echo "*********************************"
echo "<<< ICE BLEND TEST PASSED. >>>"
echo "*********************************"
echo "<<< ICE BLEND TEST PASSED. >>>" > ./summary.log
fi

exit 0
2 changes: 1 addition & 1 deletion reg_tests/snow2mdl/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set -x

module load intel

export DATA="/scratch2/NCEPDEV/stmp1/$LOGNAME/snow2mdl"
export DATA="/scratch2/NCEPDEV/stmp1/$LOGNAME/reg_tests.snow2mdl"

#-----------------------------------------------------------------------------
# Should not have to change anything below.
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/snow2mdl/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module unload intel
module load intel/18.0.5.274
module list

export DATA="/mnt/lfs3/projects/emcda/$LOGNAME/stmp/snow2mdl"
export DATA="/mnt/lfs3/projects/emcda/$LOGNAME/stmp/reg_tests.snow2mdl"

#-----------------------------------------------------------------------------
# Should not have to change anything below.
Expand Down

0 comments on commit fbcca4b

Please sign in to comment.