Skip to content

Commit

Permalink
Add option to create WGNE atmosphere products (#2233)
Browse files Browse the repository at this point in the history
Adds option to create WGNE products for the atmosphere.

Resolves #1951
Resolves #2226
  • Loading branch information
aerorahul committed Jan 18, 2024
1 parent d95ed85 commit 7759163
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions parm/config/gfs/config.atmos_products
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ if [[ "${RUN:-}" == "gdas" ]]; then
export downset=1
export FHOUT_PGBS=${FHOUT:-1} # Output frequency of supplemental gfs pgb file at 1.0 and 0.5 deg
export FLXGF="NO" # Create interpolated sflux.1p00 file
export WGNE="NO" # WGNE products are created for first FHMAX_WGNE forecast hours
export FHMAX_WGNE=0
elif [[ "${RUN:-}" == "gfs" ]]; then
export downset=2
export FHOUT_PGBS=${FHOUT_GFS:-3} # Output frequency of supplemental gfs pgb file at 1.0 and 0.5 deg
export FLXGF="YES" # Create interpolated sflux.1p00 file
export WGNE="YES" # WGNE products are created for first FHMAX_WGNE forecast hours
export FHMAX_WGNE=180
fi

export APCP_MSG="597" # Message number for APCP in GFSv16. Look for TODO in exglobal_atmos_products.sh

# paramlist files for the different forecast hours and downsets
export paramlista="${HOMEgfs}/parm/product/gfs.fFFF.paramlist.a.txt"
export paramlista_anl="${HOMEgfs}/parm/product/gfs.anl.paramlist.a.txt"
Expand Down
20 changes: 18 additions & 2 deletions scripts/exglobal_atmos_products.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ INTERP_ATMOS_SFLUXSH=${INTERP_ATMOS_SFLUXSH:-"${HOMEgfs}/ush/interp_atmos_sflux.
downset=${downset:-1} # No. of groups of pressure grib2 products to create
npe_atmos_products=${npe_atmos_products:-8} # no. of processors available to process each group

# WGNE related options
WGNE=${WGNE:-NO} # Create WGNE products
FHMAX_WGNE=${FHMAX_WGNE:-0} # WGNE products are created for first FHMAX_WGNE forecast hours (except 0)

cd "${DATA}" || exit 1

# Set paramlist files based on FORECAST_HOUR (-1, 0, 3, 6, etc.)
Expand Down Expand Up @@ -194,6 +198,15 @@ if [[ "${FLXGF:-}" == "YES" ]]; then
done
fi

# Section creating 0.25 degree WGNE products for nset=1, and fhr <= FHMAX_WGNE
if [[ "${WGNE:-}" == "YES" ]]; then
grp="" # TODO: this should be "a" when we eventually rename the pressure grib2 files per EE2 convention
if (( FORECAST_HOUR > 0 & FORECAST_HOUR <= FHMAX_WGNE )); then
# TODO: 597 is the message number for APCP in GFSv16. GFSv17 may change this as more messages are added. This can be controlled via config.atmos_products
${WGRIB2} "${COM_ATMOS_GRIB_0p25}/${PREFIX}pgrb2${grp}.0p25.${fhr3}" -d "${APCP_MSG:-597}" -grib "${COM_ATMOS_GRIB_0p25}/${PREFIX}wgne.${fhr3}"
fi
fi

#---------------------------------------------------------------

# Start sending DBN alerts
Expand All @@ -204,18 +217,21 @@ if [[ "${SENDDBN:-}" == "YES" ]]; then
if [[ "${RUN}" == "gfs" ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2B_0P25" "${job}" "${COM_ATMOS_GRIB_0p25}/${PREFIX}pgrb2b.0p25.${fhr3}"
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2B_0P25_WIDX" "${job}" "${COM_ATMOS_GRIB_0p25}/${PREFIX}pgrb2b.0p25.${fhr3}.idx"
if [[ -s "${COM_ATMOS_GRIB_0p50}/${PREFIX}pgrb2.0p50.f${fhr3}" ]]; then
if [[ -s "${COM_ATMOS_GRIB_0p50}/${PREFIX}pgrb2.0p50.${fhr3}" ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2_0P5" "${job}" "${COM_ATMOS_GRIB_0p50}/${PREFIX}pgrb2.0p50.${fhr3}"
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2_0P5_WIDX" "${job}" "${COM_ATMOS_GRIB_0p50}/${PREFIX}pgrb2.0p50.${fhr3}.idx"
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2B_0P5" "${job}" "${COM_ATMOS_GRIB_0p50}/${PREFIX}pgrb2b.0p50.${fhr3}"
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2B_0P5_WIDX" "${job}" "${COM_ATMOS_GRIB_0p50}/${PREFIX}pgrb2b.0p50.${fhr3}.idx"
fi
if [[ -s "${COM_ATMOS_GRIB_1p00}/${PREFIX}pgrb2.1p00.f${fhr3}" ]]; then
if [[ -s "${COM_ATMOS_GRIB_1p00}/${PREFIX}pgrb2.1p00.${fhr3}" ]]; then
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2_1P0" "${job}" "${COM_ATMOS_GRIB_1p00}/${PREFIX}pgrb2.1p00.${fhr3}"
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2_1P0_WIDX" "${job}" "${COM_ATMOS_GRIB_1p00}/${PREFIX}pgrb2.1p00.${fhr3}.idx"
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2B_1P0" "${job}" "${COM_ATMOS_GRIB_1p00}/${PREFIX}pgrb2b.1p00.${fhr3}"
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_PGB2B_1P0_WIDX" "${job}" "${COM_ATMOS_GRIB_1p00}/${PREFIX}pgrb2b.1p00.${fhr3}.idx"
fi
if [[ "${WGNE:-}" == "YES" ]] && [[ -s "${COM_ATMOS_GRIB_0p25}/${PREFIX}wgne.${fhr3}" ]] ; then
"${DBNROOT}/bin/dbn_alert" MODEL "${RUN^^}_WGNE" "${job}" "${COM_ATMOS_GRIB_0p25}/${PREFIX}wgne.${fhr3}"
fi
fi

if [[ "${fhr3}" == "anl" ]]; then
Expand Down

0 comments on commit 7759163

Please sign in to comment.