Skip to content

Commit

Permalink
bugfix/topo_filter
Browse files Browse the repository at this point in the history
Add new regression test for regional ESG grid.  Update
hera grid_gen regression test script accordingly.

Issue #236.
  • Loading branch information
GeorgeGayno-NOAA committed Dec 11, 2020
1 parent 1c7e4b3 commit 47fed2c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
7 changes: 7 additions & 0 deletions reg_tests/grid_gen/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ TEST1=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:15:00 -A $PROJECT_
TEST2=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J gfdl.regional \
-o $LOG_FILE -e $LOG_FILE -d afterok:$TEST1 ./gfdl.regional.sh)

#-----------------------------------------------------------------------------
# esg regional grid
#-----------------------------------------------------------------------------

TEST3=$(sbatch --parsable --ntasks-per-node=24 --nodes=1 -t 0:10:00 -A $PROJECT_CODE -q $QUEUE -J esg.regional \
-o $LOG_FILE -e $LOG_FILE -d afterok:$TEST2 ./esg.regional.sh)

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------
Expand Down
68 changes: 68 additions & 0 deletions reg_tests/grid_gen/esg.regional.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

#-----------------------------------------------------------------------
# Create a regional esg grid. Compare output to a set
# of baseline files using the 'nccmp' utility. This script is
# run by the machine specific driver script.
#-----------------------------------------------------------------------

set -x

export TEMP_DIR=${WORK_DIR}/esg.regional.work
export out_dir=${WORK_DIR}/esg.regional

export gtype=regional_esg
export target_lon=-97.5 # Center longitude of the highest resolution tile
export target_lat=35.5 # Center latitude of the highest resolution tile
export idim=1301 # Dimension of grid in 'i' direction
export jdim=600 # Dimension of grid in 'j' direction
export delx=0.0145 # Grid spacing in degrees in 'i' direction
export dely=0.0145 # Grid spacing in degrees in 'j' direction
export halo=3

NCCMP=${NCCMP:-$(which nccmp)}

#-----------------------------------------------------------------------
# Start script.
#-----------------------------------------------------------------------

echo "Starting at: " `date`

$home_dir/ush/fv3gfs_driver_grid.sh

iret=$?
if [ $iret -ne 0 ]; then
set +x
echo "<<< ESG REGIONAL TEST FAILED. <<<"
exit $iret
fi

echo "Ending at: " `date`

#-----------------------------------------------------------------------------
# Compare output to baseline set of data.
#-----------------------------------------------------------------------------

cd $out_dir/C3113

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
$NCCMP -dmfqS $files $HOMEreg/esg.regional/$files
iret=$?
if [ $iret -ne 0 ]; then
test_failed=1
fi
fi
done

set +x
if [ $test_failed -ne 0 ]; then
echo "<<< ESG REGIONAL TEST FAILED. >>>"
else
echo "<<< ESG REGIONAL TEST PASSED. >>>"
fi

exit 0

0 comments on commit 47fed2c

Please sign in to comment.