Skip to content

Commit

Permalink
Update fbwind for COM refactor (NOAA-EMC#2479)
Browse files Browse the repository at this point in the history
Updates fbwind job for the COM refactor and some other cleanup.

This works on WCOSS but not on Orion. There seems to be a problem with
either `grbindex` or `GETGB()` on Orion that causes the executable to be
unable to read the grib1 index file. The grib1 data file produced there
seems fine. Haven't checked Hera yet, maybe there is a problem with the
spack-stack build of `grbindex`.

Resolves: NOAA-EMC#2160
Refs: NOAA-EMC#289
  • Loading branch information
WalterKolczynski-NOAA authored Apr 15, 2024
1 parent 7e35a66 commit 28b840c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 44 deletions.
21 changes: 11 additions & 10 deletions jobs/JGFS_ATMOS_FBWIND
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,34 @@ export COMPONENT="atmos"
##############################################
# Define COM directories
##############################################
export COMIN=${COMIN:-$(compath.py ${envir}/${NET}/${gfs_ver})/${RUN}.${PDY}/${cyc}/${COMPONENT}}
export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${gfs_ver}/${RUN}.${PDY})/${cyc}/${COMPONENT}}
export COMOUTwmo=${COMOUTwmo:-${COMOUT}/wmo}

GRID="0p25" YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMIN_ATMOS_GRIB_0p25:COM_ATMOS_GRIB_GRID_TMPL
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMOUT:COM_ATMOS_WMO_TMPL
if [[ ! -d "${COMOUT}" ]]; then
mkdir -m 775 -p "${COMOUT}"
fi

export SENDDBN=${SENDDBN:-NO}
export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn}

mkdir -m 775 -p ${COMOUT} ${COMOUTwmo}


########################################################
# Execute the script.
${SCRgfs}/exgfs_atmos_fbwind.sh
"${SCRgfs}/exgfs_atmos_fbwind.sh"
export err=$?;err_chk
########################################################

############################################
# print exec I/O output
############################################
if [ -e "${pgmout}" ] ; then
cat ${pgmout}
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

###################################
# Remove temp directories
###################################
if [ "${KEEPDATA}" != "YES" ] ; then
rm -rf ${DATA}
if [[ "${KEEPDATA}" != "YES" ]] ; then
rm -rf "${DATA}"
fi

53 changes: 20 additions & 33 deletions scripts/exgfs_atmos_fbwind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
# echo " Nov 2019 - B Vuong Removed WINTEMV bulletin (retired)"
#####################################################################

source "${USHgfs}/preamble.sh"
source "${HOMEgfs}/ush/preamble.sh"

cd $DATA
cd "${DATA}" || exit 2

######################
# Set up Here Files.
######################

job_name=$(echo $job|sed 's/[jpt]gfs/gfs/')
outfile_name="${COMOUT}/${RUN}.atmos.t${cyc}z.fbwind.pacific.ascii"

set +x
echo " "
Expand All @@ -34,20 +34,17 @@ echo " "
set_trace

export pgm=bulls_fbwndgfs
. prep_step

for fhr in 006 012 024
do

cp $COMIN/gfs.${cycle}.pgrb2.0p25.f${fhr} tmp_pgrb2_0p25${fhr}
cp $COMIN/gfs.${cycle}.pgrb2b.0p25.f${fhr} tmp_pgrb2b_0p25${fhr}
cat tmp_pgrb2_0p25${fhr} tmp_pgrb2b_0p25${fhr} > tmp0p25filef${fhr}
$WGRIB2 tmp0p25filef${fhr} | grep -F -f ${PARMgfs}/product/gfs_fbwnd_parmlist_g2 | $WGRIB2 -i -grib tmpfilef${fhr} tmp0p25filef${fhr}
$CNVGRIB -g21 tmpfilef${fhr} tmpfilef${fhr}.grib1
$GRBINDEX tmpfilef${fhr}.grib1 tmpfilef${fhr}.grib1i
mv tmpfilef${fhr}.grib1 gfs.t${cyc}z.grbf${fhr}_grb1
mv tmpfilef${fhr}.grib1i gfs.t${cyc}z.grbif${fhr}_grb1

source prep_step

for fhr3 in 006 012 024; do
cp "${COMIN_ATMOS_GRIB_0p25}/gfs.${cycle}.pgrb2.0p25.f${fhr3}" "tmp_pgrb2_0p25${fhr3}"
cp "${COMIN_ATMOS_GRIB_0p25}/gfs.${cycle}.pgrb2b.0p25.f${fhr3}" "tmp_pgrb2b_0p25${fhr3}"
cat "tmp_pgrb2_0p25${fhr3}" "tmp_pgrb2b_0p25${fhr3}" > "tmp0p25filef${fhr3}"
# shellcheck disable=SC2312
${WGRIB2} "tmp0p25filef${fhr3}" | grep -F -f "${PARMgfs}/product/gfs_fbwnd_parmlist_g2" | \
${WGRIB2} -i -grib "tmpfilef${fhr3}" "tmp0p25filef${fhr3}"
${CNVGRIB} -g21 "tmpfilef${fhr3}" "gfs.t${cyc}z.grbf${fhr3}_grb1"
${GRBINDEX} "gfs.t${cyc}z.grbf${fhr3}_grb1" "gfs.t${cyc}z.grbf${fhr3}_grb1.idx"
done

export FORT11="gfs.t${cyc}z.grbf006_grb1"
Expand All @@ -56,31 +53,21 @@ export FORT13="gfs.t${cyc}z.grbf024_grb1"

# GFS grib index files

export FORT31="gfs.t${cyc}z.grbif006_grb1"
export FORT32="gfs.t${cyc}z.grbif012_grb1"
export FORT33="gfs.t${cyc}z.grbif024_grb1"
export FORT31="gfs.t${cyc}z.grbf006_grb1.idx"
export FORT32="gfs.t${cyc}z.grbf012_grb1.idx"
export FORT33="gfs.t${cyc}z.grbf024_grb1.idx"

#
# 1280 byte transmission file
#

export FORT51="tran.fbwnd_pacific"

startmsg
cp "${PARMgfs}/product/fbwnd_pacific.stnlist" fbwnd_pacific.stnlist

$EXECgfs/fbwndgfs < ${PARMgfs}/product/fbwnd_pacific.stnlist >> $pgmout 2> errfile
"${EXECgfs}/fbwndgfs.x" < fbwnd_pacific.stnlist >> "${pgmout}" 2> errfile
export err=$?; err_chk


cp tran.fbwnd_pacific ${COMOUTwmo}/tran.fbwnd_pacific.$job_name

if test "$SENDDBN" = 'YES'
then
# make_ntc_bull.pl WMOBH NONE KWNO NONE tran.fbwnd_pacific ${COMOUTwmo}/tran.fbwnd_pacific.$job_name
${USHgfs}/make_ntc_bull.pl WMOBH NONE KWNO NONE tran.fbwnd_pacific ${COMOUTwmo}/tran.fbwnd_pacific.$job_name
fi

#####################################################################

"${USHgfs}/make_ntc_bull.pl" WMOBH NONE KWNO NONE tran.fbwnd_pacific "${outfile_name}"

############################### END OF SCRIPT #######################
2 changes: 1 addition & 1 deletion sorc/gfs_utils.fd

0 comments on commit 28b840c

Please sign in to comment.