Skip to content

Commit

Permalink
More updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Apr 25, 2023
1 parent 6d1c7b7 commit 047822c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 20 deletions.
16 changes: 14 additions & 2 deletions reg_tests/chgres_cube/README
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ changes to the chgres_cube program are merged to the
main line of development. Any test failures must
be resolved or explained before merging.

To run the consistency tests:
TO RUN THE CONSISTENCY TESTS (Release mode):

1) Build chgres_cube program. Go to ./sorc and
1) Build chgres_cube program. Go to root directory and
invoke 'build_all.sh' with no arguments.
2) Set the fixed directories. Go to ./fix and
invoke the script.
Expand All @@ -20,3 +20,15 @@ Log output from each test will be placed in its own
logfile - "consistency.log??".

A summary of results will be in "summary.log".

TO RUN THE CONSISTENCY TEST ON WCOSS2 IN Debug MODE:

1) Ensure fixed directories are set (see above).
2) Invoke the 'driver.debug.wcoss2.sh script.

The program will be compiled in 'Debug' model. A single
test will run. Log output will be placed in
"consistency.debug.log01" and a summary of
results will be placed in "summary.debug.log".

DO NOT RUN THE RELEASE AND DEBUG TESTS AT THE SAME TIME.
19 changes: 14 additions & 5 deletions reg_tests/chgres_cube/c96.regional.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export OMP_NUM_THREADS_CH=${OMP_NUM_THREADS:-1}

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

DEBUG_MODE=${DEBUG_MODE:-'false'}

#-----------------------------------------------------------------------------
# Invoke chgres program.
#-----------------------------------------------------------------------------
Expand All @@ -41,7 +43,7 @@ ${HOMEufs}/ush/chgres_cube.sh
iret=$?
if [ $iret -ne 0 ]; then
set +x
echo "<<< C96 REGIONAL TEST FAILED. <<<"
echo "<<< C96 REGIONAL DEBUG TEST FAILED. <<<"
exit $iret
fi

Expand All @@ -56,12 +58,19 @@ cd $DATA
mv out.sfc.tile7.nc out.sfc.tile1.nc
mv out.atm.tile7.nc out.atm.tile1.nc

if [ "$DEBUG_MODE" = 'true' ]; then
BASELINE_DIR=c96_regional.debug
else
BASELINE_DIR=c96_regional
fi
BASELINE_DATA=$HOMEreg/baseline_data/$BASELINE_DIR

test_failed=0
for files in *.nc
do
if [ -f $files ]; then
echo CHECK $files
$NCCMP -dmfqS $files $HOMEreg/baseline_data/c96_regional/$files
$NCCMP -dmfqS $files $BASELINE_DATA/$files
iret=$?
if [ $iret -ne 0 ]; then
test_failed=1
Expand All @@ -71,12 +80,12 @@ done

set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 REGIONAL TEST FAILED. >>>"
echo "<<< C96 REGIONAL DEBUG TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_regional" $commit_num
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg $BASELINE_DIR $commit_num
fi
else
echo "<<< C96 REGIONAL TEST PASSED. >>>"
echo "<<< C96 REGIONAL DEBUG TEST PASSED. >>>"
fi

exit 0
32 changes: 19 additions & 13 deletions reg_tests/chgres_cube/driver.debug.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#-----------------------------------------------------------------------------
#
# Run the chgres_cube consistency tests on WCOSS2.
# Run a single chgres_cube consistency test on WCOSS2 in 'Debug' mode.
#
# Set WORK_DIR to a general working location outside the UFS_UTILS directory.
# The exact working directory (OUTDIR) will be WORK_DIR/reg_tests/chgres-cube.
Expand All @@ -13,10 +13,10 @@
# "qstat -u USERNAME".
#
# The run output will be stored in OUTDIR. Log output will be placed
# in LOG_FILE??. Once the suite has completed, a summary is placed
# in LOG_FILE??. Once the test has completed, a summary is placed
# in SUM_FILE.
#
# A test fails when its output does not match the baseline files as
# The test fails when its output does not match the baseline files as
# determined by the "nccmp" utility. The baseline files are stored in
# HOMEreg.
#
Expand All @@ -25,25 +25,30 @@
set -x

this_dir=$PWD
export HOMEufs=$this_dir/../..

#-----------------------------------------------------------------------------
# Compile the repository in 'Debug' mode.
#-----------------------------------------------------------------------------

export compiler="intel"
export CMAKE_OPTS="-DCMAKE_BUILD_TYPE=Debug"

cd ../..
./build_all.sh

source ./sorc/machine-setup.sh > /dev/null 2>&1
module use ./modulefiles
cd $this_dir

source $HOMEufs/sorc/machine-setup.sh > /dev/null 2>&1
module use $HOMEufs/modulefiles
module load build.$target.$compiler
module list

cd $this_dir

export OUTDIR="${WORK_DIR:-/lfs/h2/emc/stmp/$LOGNAME}"
export OUTDIR="${OUTDIR}/reg-tests/chgres-cube"
export OUTDIR="${OUTDIR}/reg-tests/chgres-cube-debug"

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

#-----------------------------------------------------------------------------
# Should not have to change anything below here. HOMEufs is the root
Expand All @@ -58,16 +63,17 @@ if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

export HOMEufs=$this_dir/../..

export HOMEreg=/lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube
#export HOMEreg=/lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/chgres_cube
export HOMEreg=/lfs/h2/emc/global/noscrub/George.Gayno/ufs_utils.git/reg_tests/chgres_cube

LOG_FILE=consistency.debug.log
SUM_FILE=summary.debug.log
rm -f $LOG_FILE* $SUM_FILE

export OMP_STACKSIZE=1024M

export DEBUG_MODE='true'

export NCCMP=/lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp
#export NCCMP=${NCCMP:-nccmp}
rm -fr $OUTDIR
Expand All @@ -90,7 +96,7 @@ qsub -V -o ${LOG_FILE} -e ${LOG_FILE} -q $QUEUE -A $PROJECT_CODE -l walltime=00:
-W depend=afterok:$TEST1 << EOF
#!/bin/bash
cd ${this_dir}
grep -a '<<<' ${LOG_FILE}?? | grep -v echo > $SUM_FILE
grep -a '<<<' ${LOG_FILE} | grep -v echo > $SUM_FILE
EOF

exit 0

0 comments on commit 047822c

Please sign in to comment.