Skip to content

Commit

Permalink
Update Orion script.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed May 19, 2022
1 parent 1a7cf7c commit bf2ea4d
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions reg_tests/snow2mdl/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,22 @@

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

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

set -x

source ../../sorc/machine-setup.sh > /dev/null 2>&1
Expand All @@ -36,8 +27,11 @@ module list

ulimit -s unlimited

export DATA="${WORK_DIR:-/work/noaa/stmp/$LOGNAME}"
export DATA="${DATA}/reg-tests/snow2mdl"
export DATA_ROOT="${WORK_DIR:-/work/noaa/stmp/$LOGNAME}"
export DATA_ROOT="${DATA_ROOT}/reg-tests/snow2mdl"

PROJECT_CODE="${PROJECT_CODE:-fv3-cpu}"
QUEUE="${QUEUE:-batch}"

#-----------------------------------------------------------------------------
# Should not have to change anything below.
Expand All @@ -50,13 +44,32 @@ if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

rm -fr $DATA
rm -fr $DATA_ROOT

export HOMEreg=/work/noaa/nems/role-nems/ufs_utils/reg_tests/snow2mdl
export HOMEgfs=$PWD/../..
export WGRIB=/apps/contrib/NCEPLIBS/orion/utils/grib_util.v1.2.0/exec/wgrib
export WGRIB2=/apps/contrib/NCEPLIBS/orion/utils/grib_util.v1.2.0/exec/wgrib2

./snow2mdl.sh
# The first test mimics GFS OPS.

export DATA="${DATA_ROOT}/test.ops"
TEST1=$(sbatch --parsable -J snow.ops -A $PROJECT_CODE -o consistency.log \
-e consistency.log --ntasks=1 -q $QUEUE -t 00:03:00 ./snow2mdl.ops.sh)

# This tests the afwa global grib2 data.

export DATA="${DATA_ROOT}/test.global"
TEST2=$(sbatch --parsable -J snow.global -A $PROJECT_CODE -o consistency.log \
-e consistency.log --ntasks=1 -q $QUEUE -t 00:03:00 --open-mode=append \
-d afterok:$TEST1 ./snow2mdl.global.sh)

# Create the summary file.

sbatch --ntasks=1 -t 0:01:00 -A $PROJECT_CODE -J snow_summary -o consistency.log -e consistency.log \
--open-mode=append -q $QUEUE -d afterok:$TEST2 << EOF
#!/bin/bash
grep -a '<<<' consistency.log > summary.log
EOF

exit 0

0 comments on commit bf2ea4d

Please sign in to comment.