Skip to content

Conversation

sbanihash
Copy link
Contributor

Description

This PR will add the missing scripts that will complete PR#3846 in order to add the capability to add ensemble mean, spread and prob gridded and point outputs to the gefs application.

Type of change

  • Bug fix (fixes something broken)
  • New feature (adds functionality)
  • Maintenance (code refactor, clean-up, new CI test, etc.)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO
  • Does this change require an update to any of the following submodules? YES/NO (If YES, please add a link to any PRs that are pending.)
    • EMC verif-global
    • GDAS
    • GFS-utils
    • GSI
    • GSI-monitor
    • GSI-utils
    • UFS-utils
    • UFS-weather-model
    • wxflow

How has this been tested?

Yes

  • Clone and build on WCOSS2, ran all CI tests, outputs are here on Cactus:

/lfs/h2/emc/couple/noscrub/saeideh.banihashemi/WAVE_INFRST/RUNTESTS

Added products could be seen in the C48_S2SWA_gefs test at this location on Cactus:
/lfs/h2/emc/couple/noscrub/saeideh.banihashemi/WAVE_INFRST/RUNTESTS/COMROOT/C48_S2SWA_gefs_wavestat2/gefs.20210323/12/ensstat/products/wave

gridded files;
gridded/gefs.t12z.mean.global.5p00.f***.grib2 gridded/gefs.t12z.prob.global.5p00.f***.grib2 gridded/gefs.t12z.spread.global.5p00.f***.grib2

station files;
gefs.t12z.bull_tar gefs.t12z.station_tar

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have documented my code, including function, input, and output descriptions
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • This change is covered by an existing CI test or a new one has been added- C48_S2SWA_gefs
  • Any new scripts have been added to the .github/CODEOWNERS file with owners
  • I have made corresponding changes to the system documentation if necessary

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@aerorahul
Copy link
Contributor

@sbanihash
Let me know when you have incorporated the feedback and the Github actions are passing their tests -- I'll take a look then

@sbanihash
Copy link
Contributor Author

@aerorahul Working on it, Thanks for the guidance.

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar changes are required in the other scripts.

  • Please follow shellcheck suggested warnings. It might only point a few errors that are repeated, and not flag subsequent warnings.
  • Check variables are defined before being used
  • Use cpfs and cpreq where files are being copied from DATA to COM or when they are required.

export err=1
err_exit "Requires NTASKS to be set"
fi
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_WAVE_STATION_ENS:COM_WAVE_STATION_TMPL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_WAVE_STATION_ENS:COM_WAVE_STATION_TMPL
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_WAVE_STATION_ENS:COM_WAVE_STATION_TMPL

valid_time=$(date -u -d "${PDY} ${cyc}" "+%Y%m%d%H")
ymdh_init=$(date -u -d "${valid_time:0:8} ${valid_time:8:2} - ${WAVHINDH} hours" "+%Y%m%d%H")

mkdir output_${ymdh_init}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mkdir output_${ymdh_init}
mkdir "output_${ymdh_init}"

ymdh_init=$(date -u -d "${valid_time:0:8} ${valid_time:8:2} - ${WAVHINDH} hours" "+%Y%m%d%H")

mkdir output_${ymdh_init}
cd output_${ymdh_init} || exit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cd output_${ymdh_init} || exit
cd "output_${ymdh_init}" || exit

Comment on lines +58 to +59


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

dir_var="${COMOUT_WAVE_STATION_ENS}"

# Ensure directory exists before proceeding
if [ ! -d "$dir_var" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ ! -d "$dir_var" ]; then
if [[ ! -d "${dir_var}" ]]; then

#
if [ "$SENDDBN" = 'YES' ]
then
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]')
MODCOM="${NET}_${COMPONENT^^}"

if [ "$SENDDBN" = 'YES' ]
then
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]')
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar
"${DBNROOT}/bin/dbn_alert" MODEL "${MODCOM}_GB2" "${job}" "${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar"

then
MODCOM=$(echo ${NET}_${COMPONENT} | tr '[a-z]' '[A-Z]')
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.bull_tar
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.station_tar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$DBNROOT/bin/dbn_alert MODEL ${MODCOM}_GB2 $job ${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.station_tar
"${DBNROOT}/bin/dbn_alert" MODEL "${MODCOM}_GB2" "${job}" "${ROTDIR}/${RUN}.${PDY}/${cyc}/${ENSTAG}/products/wave/station/${RUN}.t${cyc}z.station_tar"

fi
#

echo "$job completed normally"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "$job completed normally"
echo "${job} completed normally"


echo "$job completed normally"
#
echo "Ending at : `date`"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Ending at : `date`"
echo "Ending at : $(date)"

Do not use backticks

@sbanihash sbanihash closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants