Skip to content

Commit

Permalink
Create new cycle consistency test based on Cathy's c48
Browse files Browse the repository at this point in the history
noahmp fractional grid workflow test.

Fixes ufs-community#549.
  • Loading branch information
GeorgeGayno-NOAA committed Jan 17, 2024
1 parent cf37243 commit fcc0b31
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 1 deletion.
92 changes: 92 additions & 0 deletions reg_tests/global_cycle/C48.noahmp.fracgrid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash

#------------------------------------------------------------------
# Run global_cycle for a C48 case that tests the NOAHMP and
# fractional grid options.
#
# Compare output to a baseline set of files using the 'nccmp'
# utility.
#------------------------------------------------------------------

set -x

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

export MAX_TASKS_CY=6

export HOMEgfs=$NWPROD
export BASE_GSM=$NWPROD

export CYCLEXEC=$BASE_GSM/exec/global_cycle

export CDATE=2021032406
export FHOUR=00
export DELTSFC=6

export CASE=C48
export OCNRES=500

export COMIN=$HOMEreg/input_data_c48.noahmp.frac.grid
export FNACNA=$COMIN/gdas.t06z.seaice.5min.blend.grb
export FNTSFA=" "
export FNSNOA=" "
export NST_FILE=$COMIN/gdas.t06z.dtfanl.nc

export JCAP=1534
export LONB=3072
export LATB=1536

export OROFIX=$HOMEreg/fix/$CASE

export FIXgsm=$BASE_GSM/fix/am

export FNAISC=$FIXgsm/IMS-NIC.blended.ice.monthly.clim.grb

export DONST="YES"
export use_ufo=.true.
export FRAC_GRID=.true.

export VERBOSE=YES
export CYCLVARS=FSNOL=99999.,FSNOS=99999.,

$BASE_GSM/ush/global_cycle_driver.sh

iret=$?
if [ $iret -ne 0 ]; then
set +x
echo "<<< C48 NOAHMP FRAC GRID TEST FAILED. >>>"
exit $iret
fi

test_failed=0

cd $DATA
for files in *tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
$NCCMP -dmfqS $files $HOMEreg/baseline_data/c48.noahmp.fracgrid/$files
iret=$?
if [ $iret -ne 0 ]; then
test_failed=1
fi
fi
done

set +x
if [ $test_failed -ne 0 ]; then
echo
echo "******************************************"
echo "<<< C48 NOAHMP FRAC GRID TEST FAILED. >>>"
echo "******************************************"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$BASE_GSM/reg_tests/update_baseline.sh $HOMEreg "c48.noahmp.fracgrid" $commit_num
fi
else
echo
echo "*****************************************"
echo "<<< C48 NOAHMP FRAC GRID TEST PASSED. >>>"
echo "*****************************************"
fi

exit
8 changes: 7 additions & 1 deletion reg_tests/global_cycle/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@ export COMOUT=$DATA
TEST3=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c768.lndincsnow \
-o $LOG_FILE -e $LOG_FILE ./C768.lndincsnow.sh)

LOG_FILE=consistency.log04
export DATA="${DATA_DIR}/test4"
export COMOUT=$DATA
TEST4=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:05:00 -A $PROJECT_CODE -q $QUEUE -J c48.noahmp.frac \
-o $LOG_FILE -e $LOG_FILE ./C48.noahmp.fracgrid.sh)

LOG_FILE=consistency.log
sbatch --nodes=1 -t 0:01:00 -A $PROJECT_CODE -J chgres_summary -o $LOG_FILE -e $LOG_FILE \
--open-mode=append -q $QUEUE -d\
afterok:$TEST1:$TEST2:$TEST3 << EOF
afterok:$TEST1:$TEST2:$TEST3:$TEST4 << EOF
#!/bin/bash
grep -a '<<<' ${LOG_FILE}* > summary.log
EOF
Expand Down

0 comments on commit fcc0b31

Please sign in to comment.