Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions parm/prep_sfc/snow2mdl.nml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
&source_data
autosnow_file=""
nesdis_snow_file="./imssnow96.grib2"
nesdis_lsmask_file=""
afwa_snow_global_file="./snow.usaf.grib2"
afwa_snow_nh_file=""
afwa_snow_sh_file=""
afwa_lsmask_nh_file=""
afwa_lsmask_sh_file=""
/
&qc
climo_qc_file="@[CLIMO_QC]"
/
&model_specs
model_lat_file="@[MODEL_LATITUDE_FILE]"
model_lon_file="@[MODEL_LONGITUDE_FILE]"
model_lsmask_file="@[MODEL_SLMASK_FILE]"
gfs_lpl_file="@[GFS_LONSPERLAT_FILE]"
/
&output_data
model_snow_file="./@[MODEL_SNOW_FILE]"
output_grib2=@[OUTPUT_GRIB2]
/
&output_grib_time
grib_year=@[IMSYEAR]
grib_month=@[IMSMONTH]
grib_day=@[IMSDAY]
grib_hour=@[IMSHOUR]
/
&parameters
lat_threshold=55.0
min_snow_depth=0.05
snow_cvr_threshold=50.0
/
12 changes: 3 additions & 9 deletions reg_tests/ice_blend/driver.hercules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ set -x
source ../../sorc/machine-setup.sh > /dev/null 2>&1
module use ../../modulefiles
module load build.$target.intelllvm
module load grib-util/1.4.0
module load wgrib2/3.6.0
module list

ulimit -s unlimited

export DATA="${WORK_DIR:-/work/noaa/stmp/$LOGNAME}"
DATA="${WORK_DIR:-/work2/noaa/stmp/$LOGNAME}"
export DATA="${DATA}/reg-tests/ice-blend"

#-----------------------------------------------------------------------------
Expand All @@ -50,17 +52,9 @@ if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

export WGRIB=/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.5.0/envs/unified-env/install/intel/2021.9.0/grib-util-1.3.0-wenl3in/bin/wgrib
export WGRIB2=/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.5.0/envs/unified-env/install/intel/2021.9.0/wgrib2-3.1.1-v7xhwos/bin/wgrib2
export COPYGB=/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.5.0/envs/unified-env/install/intel/2021.9.0/grib-util-1.3.0-wenl3in/bin/copygb
export COPYGB2=/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.5.0/envs/unified-env/install/intel/2021.9.0/grib-util-1.3.0-wenl3in/bin/copygb2
export CNVGRIB=/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.5.0/envs/unified-env/install/intel/2021.9.0/grib-util-1.3.0-wenl3in/bin/cnvgrib

export HOMEreg=/work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/ice_blend
export HOMEgfs=$PWD/../..

rm -fr $DATA

./ice_blend.sh

exit 0
2 changes: 0 additions & 2 deletions reg_tests/ice_blend/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ export HOMEreg=/lfs5/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests

export HOMEgfs=$PWD/../..

rm -fr $DATA

./ice_blend.sh

exit 0
2 changes: 0 additions & 2 deletions reg_tests/ice_blend/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ fi
export HOMEreg=/work/noaa/nems/role-nems/ufs_utils/reg_tests/ice_blend
export HOMEgfs=$PWD/../..

rm -fr $DATA

./ice_blend.sh

exit 0
2 changes: 0 additions & 2 deletions reg_tests/ice_blend/driver.ursa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ fi
export HOMEreg=/scratch3/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/ice_blend
export HOMEgfs=$PWD/../..

rm -fr $DATA

./ice_blend.sh

exit 0
2 changes: 0 additions & 2 deletions reg_tests/ice_blend/driver.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ fi
export HOMEreg=/lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/ice_blend
export HOMEgfs=$PBS_O_WORKDIR/../..

rm -fr $DATA

./ice_blend.sh

exit 0
49 changes: 40 additions & 9 deletions reg_tests/ice_blend/ice_blend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,52 @@
# driver script.
#-----------------------------------------------------------------------------

export IMS_FILE=$HOMEreg/input_data/imssnow96.grib2.gdas.2018120618
export FIVE_MIN_ICE_FILE=$HOMEreg/input_data/seaice.5min.grib2.gdas.2018120618
set -x

${HOMEgfs}/ush/emcsfc_ice_blend.sh
rm -fr $DATA
mkdir -p $DATA
cd $DATA

IMS_FILE=${HOMEreg}/input_data/imssnow96.grib2.gdas.2018120618
cp ${IMS_FILE} ./ims.grib2

# Follow OPS procedure by converting the IMS data to the 5 minute
# global grid.
$WGRIB2 ims.grib2 -match "ICEC" -grib ims.icec.grib2
grid173="0 0 0 0 0 0 0 0 4320 2160 0 0 89958000 42000 48 -89958000 359958000 83000 83000 0"
$COPYGB2 -x -i3 -g "$grid173" ims.icec.grib2 ims.icec.5min.grib2

FIVE_MIN_ICE_FILE=${HOMEreg}/input_data/seaice.5min.grib2.gdas.2018120618
FIVE_MIN_ICE_MASK_FILE=${HOMEgfs}/fix/am/emcsfc_gland5min.grib2
BLENDED_ICE_FILE="seaice.5min.blend"

# These are input files.
export FORT17="$FIVE_MIN_ICE_MASK_FILE"
export FORT11="ims.icec.5min.grib2"
export FORT15="$FIVE_MIN_ICE_FILE"

# This is the output blended file
export FORT51=${BLENDED_ICE_FILE}

# Run the emcsfc_ice_blend executable.
${HOMEgfs}/exec/emcsfc_ice_blend >> OUTPUT 2> errfile
iret=$?

if [ $iret -ne 0 ]; then
set +x
echo "<<< ICE_BLEND TEST FAILED. <<<"
echo "<<< ICE_BLEND TEST FAILED. <<<" > ./summary.log
echo "<<< ICE_BLEND TEST FAILED. <<<" > ${HOMEgfs}/reg_tests/ice_blend/summary.log
exit $iret
else
# Follow the OPS procedure by converting the output to grib1 and replace the
# bitmap with a flag value of 1.57. That flag is expected by the global_cycle
# program.
$WGRIB2 -set_int 3 51 42000 ${BLENDED_ICE_FILE} -grib ${BLENDED_ICE_FILE}.corner
$CNVGRIB -g21 ${BLENDED_ICE_FILE}.corner ${BLENDED_ICE_FILE}.bitmap
$COPYGB -M "#1.57" -x ${BLENDED_ICE_FILE}.bitmap $BLENDED_ICE_FILE
fi

cmp ${DATA}/seaice.5min.blend $HOMEreg/baseline_data/t1534/seaice.5min.blend
cmp ${BLENDED_ICE_FILE} ${HOMEreg}/baseline_data/t1534/seaice.5min.blend
iret=$?
test_failed=0
if [ $iret -ne 0 ]; then
Expand All @@ -31,17 +63,16 @@ if [ $test_failed -ne 0 ]; then
echo "*********************************"
echo "<<< ICE BLEND TEST FAILED. >>>"
echo "*********************************"
echo "<<< ICE BLEND TEST FAILED. >>>" > ./summary.log
echo "<<< ICE BLEND TEST FAILED. >>>" > ${HOMEgfs}/reg_tests/ice_blend/summary.log
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
cd $DATA
$HOMEgfs/reg_tests/update_baseline.sh $HOMEreg "t1534" $commit_num
${HOMEgfs}/reg_tests/update_baseline.sh $HOMEreg "t1534" $commit_num
fi
else
echo
echo "*********************************"
echo "<<< ICE BLEND TEST PASSED. >>>"
echo "*********************************"
echo "<<< ICE BLEND TEST PASSED. >>>" > ./summary.log
echo "<<< ICE BLEND TEST PASSED. >>>" > ${HOMEgfs}/reg_tests/ice_blend/summary.log
fi

exit 0
7 changes: 2 additions & 5 deletions reg_tests/snow2mdl/driver.hercules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ set -x
source ../../sorc/machine-setup.sh > /dev/null 2>&1
module use ../../modulefiles
module load build.$target.intelllvm
module load prod_util/2.1.1
module list

ulimit -s unlimited

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

PROJECT_CODE="${PROJECT_CODE:-fv3-cpu}"
QUEUE="${QUEUE:-batch}"
Expand All @@ -51,8 +50,6 @@ export OMP_NUM_THREADS=1

export HOMEreg=/work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/snow2mdl
export HOMEgfs=$PWD/../..
export WGRIB=/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.5.0/envs/unified-env/install/intel/2021.9.0/grib-util-1.3.0-wenl3in/bin/wgrib
export WGRIB2=/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.5.0/envs/unified-env/install/intel/2021.9.0/wgrib2-3.1.1-v7xhwos/bin/wgrib2

# The first test uses the hemispheric air force/afwa data, which was used in OPS.

Expand Down
3 changes: 0 additions & 3 deletions reg_tests/snow2mdl/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ set -x
source ../../sorc/machine-setup.sh > /dev/null 2>&1
module use ../../modulefiles
module load build.$target.intelllvm
module load wgrib2/2.0.8
module load prod_util/2.1.1
set +x
module list
set -x
Expand All @@ -49,7 +47,6 @@ fi

export HOMEreg=/lfs5/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/snow2mdl
export HOMEgfs=$PWD/../..
export WGRIB=/apps/wgrib/1.8.1.0b/bin/wgrib

rm -fr $DATA_ROOT

Expand Down
7 changes: 2 additions & 5 deletions reg_tests/snow2mdl/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ set -x
source ../../sorc/machine-setup.sh > /dev/null 2>&1
module use ../../modulefiles
module load build.$target.intelllvm
module load grib-util/1.4.0
module load wgrib2/3.6.0
module load prod_util/2.1.1
module list

ulimit -a

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

PROJECT_CODE="${PROJECT_CODE:-fv3-cpu}"
QUEUE="${QUEUE:-batch}"
Expand Down
8 changes: 0 additions & 8 deletions reg_tests/snow2mdl/driver.ursa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,8 @@ compiler=${compiler:-"intelllvm"}
source ../../sorc/machine-setup.sh > /dev/null 2>&1
module use ../../modulefiles
module load build.$target.$compiler
module load grib-util
module load wgrib2
module load prod_util
module list

WGRIB=${GRIB_UTIL_ROOT}/bin/wgrib

export WGRIB
export WGRIB2

DATA_ROOT="${WORK_DIR:-/scratch4/NCEPDEV/stmp/$LOGNAME}"
DATA_ROOT="${DATA_ROOT}/reg-tests/snow2mdl"

Expand Down
7 changes: 2 additions & 5 deletions reg_tests/snow2mdl/driver.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@
source ../../sorc/machine-setup.sh > /dev/null 2>&1
module use ../../modulefiles
module load build.$target.intel
module load grib_util/1.2.2
module load wgrib2/2.0.8
module load prod_util/2.0.14
module list

set -x

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

PROJECT_CODE=${PROJECT_CODE:-"GFS-DEV"}
QUEUE=${QUEUE:-"dev"}
Expand Down
50 changes: 40 additions & 10 deletions reg_tests/snow2mdl/snow2mdl.global.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,55 @@
#!/bin/bash

#--------------------------------------------------------------------------
# Create a snow file from afwa global data and ims data. This script
# Create a snow file from afwa global data and ims data. This script
# is run from its machine-specific driver.
#
# This test mimics current GFS OPS which uses the global afwa data.
#
# Note, this test uses the "snow2mdl.nml.tmpl" template to create
# the fort.41 namelist as is done by the global workflow.
#--------------------------------------------------------------------------

echo "BEGIN SNOW2MDL GLOBAL TEST."

set -x

export IMS_FILE=$HOMEreg/input_data/global/gfs.t00z.imssnow96.grib2
export AFWA_GLOBAL_FILE="$HOMEreg/input_data/global/gfs.t00z.snow.usaf.grib2"
HOMEush="${HOMEgfs}/ush"
HOMEparm="${HOMEgfs}/parm"
HOMEexec="${HOMEgfs}/exec"
HOMEfix="${HOMEgfs}/fix/am"

source "${HOMEush}/atparse.bash" # include function atparse for parsing @[XYZ] templated files

SNOW2MDLNMLTMPL="${HOMEparm}/prep_sfc/snow2mdl.nml.tmpl"

CLIMO_QC="${HOMEfix}/emcsfc_snow_cover_climo.grib2"

MODEL_LATITUDE_FILE="${HOMEfix}/global_latitudes.t1534.3072.1536.grb"
MODEL_LONGITUDE_FILE="${HOMEfix}/global_longitudes.t1534.3072.1536.grb"
MODEL_SLMASK_FILE="${HOMEfix}/global_slmask.t1534.3072.1536.grb"
GFS_LONSPERLAT_FILE="${HOMEfix}/global_lonsperlat.t1534.3072.1536.txt"

MODEL_SNOW_FILE="snogrb_model"
OUTPUT_GRIB2=".false."

IMSYEAR=2025
IMSMONTH=03
IMSDAY=25
IMSHOUR=0

export MODEL_LATITUDE_FILE=$HOMEgfs/fix/am/global_latitudes.t1534.3072.1536.grb
export MODEL_LONGITUDE_FILE=$HOMEgfs/fix/am/global_longitudes.t1534.3072.1536.grb
export MODEL_SLMASK_FILE=$HOMEgfs/fix/am/global_slmask.t1534.3072.1536.grb
export GFS_LONSPERLAT_FILE=$HOMEgfs/fix/am/global_lonsperlat.t1534.3072.1536.txt
rm -fr $DATA
mkdir -p $DATA
cd $DATA

export OMP_NUM_THREADS=1
export OUTPUT_GRIB2=.false.
cp "$HOMEreg/input_data/global/gfs.t00z.imssnow96.grib2" "./imssnow96.grib2"
cp "$HOMEreg/input_data/global/gfs.t00z.snow.usaf.grib2" "./snow.usaf.grib2"

${HOMEgfs}/ush/emcsfc_snow.sh
atparse < "${SNOW2MDLNMLTMPL}" >> "./fort.41"
echo "Rendered fort.41"
cat "./fort.41"

eval ${HOMEexec}/emcsfc_snow2mdl >> OUTPUT 2> errfile
iret=$?
if [ $iret -ne 0 ]; then
set +x
Expand Down
Loading