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
Create grid generation regression tests for uniform and
regional grids.  Create driver script for Dell.
  • Loading branch information
GeorgeGayno-NOAA committed Apr 28, 2020
1 parent ad909ed commit f23b73c
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 0 deletions.
63 changes: 63 additions & 0 deletions reg_tests/grid_gen/c96.regional.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

set -x

export TMPDIR=${WORK_DIR}/c96.regional.work
export out_dir=${WORK_DIR}/c96.regional

export res=96
export gtype=regional
export stretch_fac=1.5 # Stretching factor for the grid
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 refine_ratio=3 # The refinement ratio
export istart_nest=27 # Starting i-direction index of nest grid in parent tile supergrid
export jstart_nest=37 # Starting j-direction index of nest grid in parent tile supergrid
export iend_nest=166 # Ending i-direction index of nest grid in parent tile supergrid
export jend_nest=164 # Ending j-direction index of nest grid in parent tile supergrid
export halo=3

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

echo "Starting at: " `date`

$home_dir/ush/fv3gfs_driver_grid.sh

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

echo "Ending at: " `date`

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

cd $out_dir

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

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

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

set -x

export TMPDIR=${WORK_DIR}/c96.uniform.work
export out_dir=${WORK_DIR}/c96.uniform

export res=96
export gtype=uniform

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

echo "Starting at: " `date`

$home_dir/ush/fv3gfs_driver_grid.sh

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

echo "Ending at: " `date`

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

cd $out_dir

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

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

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

module purge
module load EnvVars/1.0.2
module load lsf/10.1
module load ips/18.0.1.163
module load impi/18.0.1
module load NetCDF/4.5.0
module load HDF5-serial/1.10.1
module list

set -x

LOG_FILE=regression.log
SUM_FILE=summary.log
QUEUE="debug"
PROJECT_CODE="GFS-DEV"

export home_dir=$PWD/../..
export WORK_DIR=/gpfs/dell1/stmp/$LOGNAME/reg_tests.grid
rm -f $WORK_DIR

export APRUN=time
export APRUN_SFC="mpirun -l"
export OMP_STACKSIZE=2048m
export machine=WCOSS_DELL_P3

export NCCMP=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp
export HOMEreg=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/reg_tests/grid_gen

ulimit -a
ulimit -s unlimited

export OMP_NUM_THREADS=24
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.uniform -W 0:15 -x -n 24 \
-R "span[ptile=24]" -R "affinity[core(1):distribute=balance]" "$PWD/c96.uniform.sh"

bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.regional -W 0:10 -x -n 24 -w 'ended(c96.uniform)' \
-R "span[ptile=24]" -R "affinity[core(1):distribute=balance]" "$PWD/c96.regional.sh"

#-----------------------------------------------------------------------------
# Create summary log.
#-----------------------------------------------------------------------------

bsub -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J summary -R "affinity[core(1)]" -R "rusage[mem=100]" -W 0:01 \
-w 'ended(c96.regional)' "grep -a '<<<' $LOG_FILE >> $SUM_FILE"

0 comments on commit f23b73c

Please sign in to comment.