Skip to content

Conversation

EricSinsky-NOAA
Copy link
Contributor

@EricSinsky-NOAA EricSinsky-NOAA commented Sep 11, 2025

Description

This PR creates a Gaussian sfcanl file at the beginning of the IAU window. This is accomplished by modifying ush/gaussian_sfcanl.sh in the analcalc task. This file is created only when DOIAU is YES.
This PR will remain a draft until further tests are performed. The archive yamls are also modified so that this new file is added to the GFS archive.

Resolves #3895

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? NO

    • EMC verif-global
    • GDAS
    • GFS-utils
    • GSI
    • GSI-monitor
    • GSI-utils
    • UFS-utils
    • UFS-weather-model
    • wxflow

How has this been tested?

  • The C96C48mx500_S2SW_cyc_gfs test has been performed on WCOSS2.

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
  • Any new scripts have been added to the .github/CODEOWNERS file with owners
  • I have made corresponding changes to the system documentation if necessary

@EricSinsky-NOAA
Copy link
Contributor Author

Marking this PR as ready for review. All preliminary offline CI GFS tests passed on WCOSS2 except for the gfs_gempakmeta task in C48_S2SW_extended, which is being investigated.

******** C48ATM ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C48_ATM
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202103231200        Done    Sep 15 2025 13:45:39    Sep 15 2025 15:45:26
******** C48mx5003DVarAOWCDA ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C48mx500_3DVarAOWCDA
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202103241800        Done    Sep 15 2025 13:45:33    Sep 15 2025 14:05:29
202103250000        Done    Sep 15 2025 13:45:33    Sep 15 2025 15:55:35
******** C48mx500hybAOWCDA ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C48mx500_hybAOWCDA
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202103241800        Done    Sep 15 2025 13:45:29    Sep 15 2025 14:05:36
202103250000        Done    Sep 15 2025 13:45:29    Sep 15 2025 15:45:41
******** C48S2SW ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C48_S2SW
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202103231200        Done    Sep 15 2025 13:45:16    Sep 15 2025 15:45:49
******** C48S2SWextended ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C48_S2SW_extended
202103231200          gfs_gempakmeta                   218271868                DEAD                 271         2         219.0
******** C96atm3DVarextended ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C96_atm3DVar_extended
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202112201800        Done    Sep 15 2025 13:45:31    Sep 15 2025 14:05:29
202112210000        Done    Sep 15 2025 13:45:31    Sep 15 2025 19:25:39
202112210600        Done    Sep 15 2025 13:45:31    Sep 15 2025 21:35:41
202112211200        Done    Sep 15 2025 14:10:34    Sep 15 2025 23:10:32
202112211800        Done    Sep 15 2025 19:30:21    Sep 16 2025 03:40:37
******** C96C48hybatmDA ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C96C48_hybatmDA
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202112201800        Done    Sep 15 2025 13:45:34    Sep 15 2025 14:05:38
202112210000        Done    Sep 15 2025 13:45:34    Sep 15 2025 16:35:37
202112210600        Done    Sep 15 2025 13:45:34    Sep 15 2025 16:10:38
******** C96C48hybatmsnowDA ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C96C48_hybatmsnowDA
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202112201200        Done    Sep 15 2025 13:45:24    Sep 15 2025 14:05:29
202112201800        Done    Sep 15 2025 13:45:24    Sep 15 2025 16:15:42
202112210000        Done    Sep 15 2025 13:45:24    Sep 15 2025 16:05:39
******** C96C48hybatmsoilDA ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C96C48_hybatmsoilDA
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202205150600        Done    Sep 15 2025 13:45:50    Sep 15 2025 14:05:30
202205151200        Done    Sep 15 2025 13:45:50    Sep 15 2025 16:35:36
202205151800        Done    Sep 15 2025 13:45:50    Sep 15 2025 16:50:28
******** C96C48mx500S2SWcycgfs ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C96C48mx500_S2SW_cyc_gfs
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202112201200        Done    Sep 15 2025 13:45:46    Sep 15 2025 14:05:45
202112201800        Done    Sep 15 2025 13:45:46    Sep 15 2025 16:30:51
202112210000        Done    Sep 15 2025 13:45:46    Sep 15 2025 18:05:35
202112211800        Done    Sep 15 2025 14:10:37    Sep 15 2025 17:55:51
******** C96C48ufshybatmDA ********
/lfs/h2/emc/ens/noscrub/eric.sinsky/GEFS/expdir/issue3895/EXPDIR/C96C48_ufs_hybatmDA
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202402231800        Done    Sep 15 2025 13:45:34    Sep 15 2025 14:05:29
202402240000        Done    Sep 15 2025 13:45:34    Sep 15 2025 17:05:34
202402240600        Done    Sep 15 2025 13:45:34    Sep 15 2025 16:40:38

@EricSinsky-NOAA EricSinsky-NOAA marked this pull request as ready for review September 16, 2025 12:25
Comment on lines 153 to 158
iy=${gcycle_date:0:4}
im=${gcycle_date:4:2}
id=${gcycle_date:6:2}
ih=${gcycle_date:8:2}

# input analysis tiles (with nst records)
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile1.nc" "./anal.tile1.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile2.nc" "./anal.tile2.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile3.nc" "./anal.tile3.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile4.nc" "./anal.tile4.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile5.nc" "./anal.tile5.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile6.nc" "./anal.tile6.nc"
export OMP_NUM_THREADS=${OMP_NUM_THREADS_SFC:-1}
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
iy=${gcycle_date:0:4}
im=${gcycle_date:4:2}
id=${gcycle_date:6:2}
ih=${gcycle_date:8:2}
# input analysis tiles (with nst records)
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile1.nc" "./anal.tile1.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile2.nc" "./anal.tile2.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile3.nc" "./anal.tile3.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile4.nc" "./anal.tile4.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile5.nc" "./anal.tile5.nc"
${NLN} "${COMIN_ATMOS_RESTART}/${PDY}.${cyc}0000.sfcanl_data.tile6.nc" "./anal.tile6.nc"
export OMP_NUM_THREADS=${OMP_NUM_THREADS_SFC:-1}

Move this section closer to where it is used, and no need to set OMP_NUM_THREADS each time in the loop.

gcycle_dates+=("${BDATE}")
fi

for hr in "${!gcycle_dates[@]}"; do
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
for hr in "${!gcycle_dates[@]}"; do
for ii in "${!gcycle_dates[@]}"; do

This is an index, not hour.


for hr in "${!gcycle_dates[@]}"; do

gcycle_date=${gcycle_dates[hr]}
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
gcycle_date=${gcycle_dates[hr]}
gcycle_date=${gcycle_dates[ii]}

fi
export err=$?
if [[ ${err} -ne 0 ]]; then
echo "FATAL ERROR: ${GAUSFCANLEXE} returned non-zero exit status!"
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 "FATAL ERROR: ${GAUSFCANLEXE} returned non-zero exit status!"
echo "FATAL ERROR: ${GAUSFCANLEXE} returned non-zero exit status processing ${gcycle_date}!"

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.

Thanks for this PR @EricSinsky-NOAA
A few suggestions if you wouldn't mind taking into consideration.

################################################################################
# Postprocessing
cd "${pwd}"
cd "${pwd}" || 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 "${pwd}" || exit
cd "${DATA}" || exit

@EricSinsky-NOAA
Copy link
Contributor Author

Thank you for the review, @aerorahul. I have committed and pushed your suggestions.

if [[ ${err} -ne 0 ]]; then
echo "FATAL ERROR: ${GAUSFCANLEXE} returned non-zero exit status processing ${gcycle_date}!"
# Since we are in "${DATA}/gausfcanl_${gcycle_date:8:2}", we need to step out
cd "${DATA}" || exit "${err}"
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 "${DATA}" || exit "${err}"
exit "${err}"

This is incorrect, as cd ${DATA} will be true, and the || will not be executed.

Comment on lines 148 to 152
if [[ ! -d "${DATA}/gausfcanl_${gcycle_date:8:2}" ]]; then
mkdir -p "${DATA}/gausfcanl_${gcycle_date:8:2}"
fi

cd "${DATA}/gausfcanl_${gcycle_date:8:2}"
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 "${DATA}/gausfcanl_${gcycle_date:8:2}" ]]; then
mkdir -p "${DATA}/gausfcanl_${gcycle_date:8:2}"
fi
cd "${DATA}/gausfcanl_${gcycle_date:8:2}"
rm -rf "${DATA}/gausfcanl_${gcycle_date:8:2}"
mkdir -p "${DATA}/gausfcanl_${gcycle_date:8:2}"
cd "${DATA}/gausfcanl_${gcycle_date:8:2}"

We should perhaps start with a clean directory each time, so that when/if the job fails and restarts, it gets a clean directory.

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.

Looks good.
Just one suggestion on starting with a clean directory for the gcycle_date each time.
Ready to run the tests after it.

@EricSinsky-NOAA
Copy link
Contributor Author

Thank you, @aerorahul. I have also requested a review from @CatherineThomas-NOAA. Would it be possible to hold off on CI testing until she’s had a chance to review?

aerorahul
aerorahul previously approved these changes Sep 17, 2025
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.

looks good. thanks for addressing the comments and for this work.

Copy link
Contributor

@CatherineThomas-NOAA CatherineThomas-NOAA left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together @EricSinsky-NOAA and running the tests. I did a spot check of the new output from the low res v17 tests and it looks reasonable.

One consideration for both @aerorahul @EricSinsky-NOAA : the new file is called gdas.tHHz.sfcanl.nc with HH being the time at the beginning of the window. For the 3D fields, we have analyses and increment files valid at the beginning of the window with the nomenclature of gdas.tHHz.atmi003.nc and gdas.tHHz.atma003.ensres.nc where the HH is the cycle and 003 signifies they are valid at the beginning of the window. What do you think about naming this new file gdas.tHHz.sfca003.nc?

@aerorahul
Copy link
Contributor

Thanks for putting this together @EricSinsky-NOAA and running the tests. I did a spot check of the new output from the low res v17 tests and it looks reasonable.

One consideration for both @aerorahul @EricSinsky-NOAA : the new file is called gdas.tHHz.sfcanl.nc with HH being the time at the beginning of the window. For the 3D fields, we have analyses and increment files valid at the beginning of the window with the nomenclature of gdas.tHHz.atmi003.nc and gdas.tHHz.atma003.ensres.nc where the HH is the cycle and 003 signifies they are valid at the beginning of the window. What do you think about naming this new file gdas.tHHz.sfca003.nc?

@CatherineThomas-NOAA Good catch there.
The HH in gdas.tHHz. should always be the cyc and not the hour of the beginning of the window. I support gdas.tcycz.sfca003.nc for surface analysis valid at the beginning of the window.

@EricSinsky-NOAA
Copy link
Contributor Author

Thanks for the suggestion @CatherineThomas-NOAA! I'll work on changing the file names to gdas.tcycz.sfca003.nc. I believe this naming convention will also reduce confusion.

@EricSinsky-NOAA
Copy link
Contributor Author

EricSinsky-NOAA commented Sep 17, 2025

Converting this PR back to draft since options are being explored to see if the creation of an sfcanl gaussian file at the beginning of the IAU window can be bypassed. The status of this PR will be updated from draft as soon as a decision is made.

@EricSinsky-NOAA EricSinsky-NOAA marked this pull request as draft September 17, 2025 19:53
@EricSinsky-NOAA
Copy link
Contributor Author

Closing this PR since a sfcanl file at the beginning of the IAU window is no longer needed.

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.

Generate Gaussian grid surface analysis file (sfcanl) at beginning of IAU window for GEFSv13

3 participants