Skip to content

Commit

Permalink
Update the snow2mdl consistency test script for the new
Browse files Browse the repository at this point in the history
test of afwa global data.

Fixes ufs-community#559.
  • Loading branch information
GeorgeGayno-NOAA committed May 23, 2022
1 parent db9b31f commit 14ad38c
Showing 1 changed file with 40 additions and 19 deletions.
59 changes: 40 additions & 19 deletions reg_tests/snow2mdl/driver.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,22 @@

#-----------------------------------------------------------------------------
#
# Run snow2mdl consistency test on WCOSS2.
# Run snow2mdl consistency tests on WCOSS2.
#
# Set $DATA to your working directory. Set the project code (PBS -A)
# and queue (PBS -q) as appropriate.
# Set $DATA_ROOT to your working directory. Set the project code
# and queue as appropriate.
#
# Invoke the script as follows: qsub $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.
#
#-----------------------------------------------------------------------------

#PBS -l walltime=00:05:00
#PBS -o consistency.log
#PBS -e consistency.log
#PBS -N s2m_regt
#PBS -q debug
#PBS -A GFS-DEV
#PBS -l select=1:ncpus=1:mem=2500MB

cd $PBS_O_WORKDIR

source ../../sorc/machine-setup.sh > /dev/null 2>&1
module use ../../modulefiles
module load build.$target.intel
Expand All @@ -37,8 +27,11 @@ module list

set -x

export DATA="${WORK_DIR:-/lfs/h2/emc/stmp/$LOGNAME}"
export DATA="${DATA}/reg-tests/snow2mdl"
export DATA_ROOT="${WORK_DIR:-/lfs/h2/emc/stmp/$LOGNAME}"
export DATA_ROOT="${DATA_ROOT}/reg-tests/snow2mdl"

PROJECT_CODE=${PROJECT_CODE:-"GFS-DEV"}
QUEUE=${QUEUE:-"dev"}

#-----------------------------------------------------------------------------
# Should not have to change anything below.
Expand All @@ -54,8 +47,36 @@ fi
export HOMEreg=/lfs/h2/emc/global/noscrub/George.Gayno/ufs_utils.git/reg_tests/snow2mdl
export HOMEgfs=$PWD/../..

rm -fr $DATA
LOG_FILE=consistency.log
SUM_FILE=summary.log

rm -fr $DATA_ROOT

./snow2mdl.sh
#-----------------------------------------------------------------------------
# Test GFS ops snow.
#-----------------------------------------------------------------------------

export DATA=$DATA_ROOT/test.ops
TEST1=$(qsub -V -o $LOG_FILE -e $LOG_FILE -q $QUEUE -A $PROJECT_CODE -l select=1:ncpus=1:mem=2500MB \
-N snow.ops -l walltime=00:03:00 $PWD/snow2mdl.ops.sh)

#-----------------------------------------------------------------------------
# Test afwa global snow.
#-----------------------------------------------------------------------------

export DATA=$DATA_ROOT/test.global
TEST2=$(qsub -V -o $LOG_FILE -e $LOG_FILE -q $QUEUE -A $PROJECT_CODE -l select=1:ncpus=1:mem=2500MB \
-N snow.global -l walltime=00:03:00 -W depend=afterok:$TEST1 $PWD/snow2mdl.global.sh)

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

this_dir=$PWD
qsub -V -o ${LOG_FILE} -e ${LOG_FILE} -q $QUEUE -A $PROJECT_CODE -l walltime=00:01:00 \
-N snow_summary -l select=1:ncpus=1:mem=100MB -W depend=afterok:$TEST2 << EOF
#!/bin/bash
cd ${this_dir}
grep -a '<<<' $LOG_FILE | grep -v echo > $SUM_FILE
EOF
exit 0

0 comments on commit 14ad38c

Please sign in to comment.