Skip to content

Commit

Permalink
feature/g2_reg_test: This commit references ufs-community#64.
Browse files Browse the repository at this point in the history
Update ./ush/chgres_cube.sh for GRIB2 option.

Baseline new grib2 regression test script - c192.gfs.grib2.sh

Correct error message in reg test script - c192.fv3.history.sh

Update Dell regression test driver for grib2 test.  Remove
unused variables.
  • Loading branch information
GeorgeGayno-NOAA committed Feb 21, 2020
1 parent e339b26 commit 70cd6c9
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 13 deletions.
2 changes: 1 addition & 1 deletion reg_tests/chgres_cube/c192.fv3.history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ${HOMEufs}/ush/chgres_cube.sh

iret=$?
if [ $iret -ne 0 ]; then
echo "<<< C96 FV3 GAUSSIAN NEMSIO TEST FAILED. <<<"
echo "<<< C192 FV3 HISTORY TEST FAILED. <<<"
exit $iret
fi

Expand Down
71 changes: 71 additions & 0 deletions reg_tests/chgres_cube/c192.gfs.grib2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash

#-----------------------------------------------------------------------------
# Invoke chgres to create C192 coldstart files using GFS GRIB2 data
# as input. The coldstart files are then compared to baseline files
# using the 'nccmp' utility. This script is run by the machine specific
# driver script.
#-----------------------------------------------------------------------------

set -x

export DATA=$OUTDIR/c192_gfs_grib2
rm -fr $DATA

export CRES=192
export FIXfv3=${HOMEreg}/fix/C192
export COMIN=${HOMEreg}/input_data/gfs.grib2

export GRIB2_FILE_INPUT=gfs.t00z.pgrb2.0p50.f000
export VCOORD_FILE=${HOMEufs}/fix/fix_am/global_hyblev.l65.txt
export VARMAP_FILE=${HOMEufs}/parm/varmap_tables/GFSphys_var_map.txt
export INPUT_TYPE='grib2'
export CONVERT_NST=".false."

export CDATE=2019110400

export OMP_NUM_THREADS_CY=1

#-----------------------------------------------------------------------------
# Invoke chgres program.
#-----------------------------------------------------------------------------

echo "Starting at: " `date`

${HOMEufs}/ush/chgres_cube.sh

iret=$?
if [ $iret -ne 0 ]; then
echo "<<< C192 GFS GRIB2 TEST FAILED. <<<"
exit $iret
fi

echo "Ending at: " `date`

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

cd $DATA

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

set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C192 GFS GRIB2 TEST FAILED. >>>"
else
echo "<<< C192 GFS GRIB2 TEST PASSED. >>>"
fi

exit 0
16 changes: 9 additions & 7 deletions reg_tests/chgres_cube/driver.dell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export APRUN=mpirun
#-----------------------------------------------------------------------------

export OMP_NUM_THREADS=1
export INPUT_DATA=${HOMEreg}/input_data/fv3.restart
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.fv3.restart -W 0:15 -x -n 6 \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/c96.fv3.restart.sh"

Expand All @@ -71,7 +70,6 @@ bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.fv3.restart -W
#-----------------------------------------------------------------------------

export OMP_NUM_THREADS=1
export INPUT_DATA=${HOMEreg}/input_data/fv3.history
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c192.fv3.history -W 0:15 -x -n 6 -w 'ended(c96.fv3.restart)' \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/c192.fv3.history.sh"

Expand All @@ -80,7 +78,6 @@ bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c192.fv3.history -W
#-----------------------------------------------------------------------------

export OMP_NUM_THREADS=1
export INPUT_DATA=${HOMEreg}/input_data/fv3.nemsio
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.fv3.nemsio -W 0:15 -x -n 6 -w 'ended(c192.fv3.history)' \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/c96.fv3.nemsio.sh"

Expand All @@ -89,7 +86,6 @@ bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.fv3.nemsio -W 0
#-----------------------------------------------------------------------------

export OMP_NUM_THREADS=4
export INPUT_DATA=${HOMEreg}/input_data/gfs.sigio
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.gfs.sigio -W 0:15 -x -n 6 -w 'ended(c96.fv3.nemsio)' \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/c96.gfs.sigio.sh"

Expand All @@ -98,7 +94,6 @@ bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.gfs.sigio -W 0
#-----------------------------------------------------------------------------

export OMP_NUM_THREADS=1
export INPUT_DATA=${HOMEreg}/input_data/gfs.nemsio
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.gfs.nemsio -W 0:15 -x -n 6 -w 'ended(c96.gfs.sigio)' \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/c96.gfs.nemsio.sh"

Expand All @@ -107,15 +102,22 @@ bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.gfs.nemsio -W
#-----------------------------------------------------------------------------

export OMP_NUM_THREADS=1
export INPUT_DATA=${HOMEreg}/input_data/fv3.nemsio
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.regional -W 0:15 -x -n 6 -w 'ended(c96.gfs.nemsio)' \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/c96.regional.sh"

#-----------------------------------------------------------------------------
# Initialize global C192 using GFS GRIB2 file.
#-----------------------------------------------------------------------------

export OMP_NUM_THREADS=1
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c192.gfs.grib2 -W 0:05 -x -n 6 -w 'ended(c96.regional)' \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/c192.gfs.grib2.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"
-w 'ended(c192.gfs.grib2)' "grep -a '<<<' $LOG_FILE >> $SUM_FILE"

exit
23 changes: 18 additions & 5 deletions ush/chgres_cube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ HALO_BLEND=${HALO_BLEND:-0}
# 'restart' for tiled fv3 warm restart files. 'gfs_gaussian'
# for spectral gfs nemsio files. 'gfs_spectral' for
# for spectral gfs sigio/sfcio files. 'gaussian' for fv3
# gaussian nemsio files.
# gaussian nemsio files. 'grib2' for gfs grib2 files.
#
# MOSAIC_FILE_INPUT_GRID - Path/Name of mosaic file for input grid. Only
# used for 'history' and 'restart' INPUT_TYPE.
Expand Down Expand Up @@ -101,7 +101,7 @@ COMIN=${COMIN:-$PWD}

#----------------------------------------------------------------------------
# ATM_FILES_INPUT - Input atmospheric data file(s). Not used for 'restart'
# INPUT_TYPE.
# and 'grib2' INPUT_TYPE.
#
# ATM_CORE_FILES - Input atmospheric core files. Used for 'restart'
# INPUT_TYPE only. The first six entries are the tiled
Expand All @@ -111,25 +111,34 @@ COMIN=${COMIN:-$PWD}
# ATM_TRACER_FILES_INPUT - Input atmospheric tracer files for each tile.
# Used for 'restart' INPUT_TYPE only.
#
# SFC_FILES_INPUT - Input surface data file(s).
# SFC_FILES_INPUT - Input surface data file(s). Not used for 'grib2'
# INPUT_TYPE.
#
# NST_FILES_INPUT - Input nst data file. 'gfs_gaussian' INPUT_TYPE only.
#
# GRIB2_FILE_INPUT - Input gfs grib2 data file. Only used for 'grib2'
# INPUT_TYPE.
#
# TRACERS_INPUT - List of input atmospheric tracer records to be processed.
# Not used for 'grib2' INPUT_TYPE.
#----------------------------------------------------------------------------

ATM_FILES_INPUT=${ATM_FILES_INPUT:-NULL}
ATM_CORE_FILES_INPUT=${ATM_CORE_FILES_INPUT:-NULL}
ATM_TRACER_FILES_INPUT=${ATM_TRACER_FILES_INPUT:-NULL}
SFC_FILES_INPUT=${SFC_FILES_INPUT:-NULL}
NST_FILES_INPUT=${NST_FILES_INPUT:-NULL}
GRIB2_FILE_INPUT=${GRIB2_FILE_INPUT:-NULL}
TRACERS_INPUT=${TRACERS_INPUT:-'"spfh","clwmr","o3mr","icmr","rwmr","snmr","grle"'}

#----------------------------------------------------------------------------
#
# VARMAP_FILE - Variable mapping table. Only used for 'grib2' INPUT_TYPE.
#
# TRACERS_TARGET - List of target tracer records. Must corresponde with
# with TRACERS_INPUT.
# with TRACERS_INPUT. Not used for 'grib2' INPUT_TYPE.
#
# VCOORD_FILE - File containing vertical coordinate defintion for target
# VCOORD_FILE - File containing vertical coordinate definition for target
# grid.
#
# MOSAIC FILE_TARGET_GRID - Mosaic file for target grid (include path).
Expand All @@ -140,6 +149,8 @@ TRACERS_INPUT=${TRACERS_INPUT:-'"spfh","clwmr","o3mr","icmr","rwmr","snmr","grle
# be located in FIXfv3.
#----------------------------------------------------------------------------

VARMAP_FILE=${VARMAP_FILE:-NULL}

TRACERS_TARGET=${TRACERS_TARGET:-'"sphum","liq_wat","o3mr","ice_wat","rainwat","snowwat","graupel"'}

VCOORD_FILE=${VCOORD_FILE:-${FIXam}/global_hyblev.l65.txt}
Expand Down Expand Up @@ -196,6 +207,8 @@ cat << EOF > ./fort.41
atm_tracer_files_input_grid="${ATM_TRACER_FILES_INPUT}"
sfc_files_input_grid="${SFC_FILES_INPUT}"
nst_files_input_grid="${NST_FILES_INPUT}"
grib2_file_input_grid="${GRIB2_FILE_INPUT}"
varmap_file="${VARMAP_FILE}"
cycle_mon=$im
cycle_day=$id
cycle_hour=$ih
Expand Down

0 comments on commit 70cd6c9

Please sign in to comment.