Skip to content

Conversation

@AntonMFernando-NOAA
Copy link
Contributor

Description

Some jobs in the current global-workflow create links from their working directories to files in the COM directory, allowing output to be written or accessed directly in COM.

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 change expected to change outputs (e.g. value changes to existing outputs, new files stored in COM, files removed from COM, filename changes, additions/subtractions to archives)? YES/NO (If YES, please indicate to which system(s))
    • GFS
    • GEFS
    • SFS
    • GCAFS
  • 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 (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?

  • CI tests on hera and extended tests 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

Copy link
Contributor

@DavidHuber-NOAA DavidHuber-NOAA 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. There's just one member loop that should stay as links and I spotted a COMIN that should be a COMOUT.

Comment on lines 71 to 72
${NLN} "${COMIN_ATMOS_HISTORY}/${PREFIX}sfc.f${fhrchar}.nc" "sfcf${fhrchar}_${memchar}"
${NLN} "${COMIN_ATMOS_HISTORY}/${PREFIX}atm.f${fhrchar}.nc" "atmf${fhrchar}_${memchar}"
cpreq "${COMIN_ATMOS_HISTORY}/${PREFIX}sfc.f${fhrchar}.nc" "sfcf${fhrchar}_${memchar}"
cpreq "${COMIN_ATMOS_HISTORY}/${PREFIX}atm.f${fhrchar}.nc" "atmf${fhrchar}_${memchar}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Since these are member forecasts, they can stay as links for the post job.

for cycle in $(seq -f "%02g" -s ' ' 0 "${INTERVAL_GFS}" "${cyc}"); do
YMD=${PDY} HH=${cycle} GRID="1p00" declare_from_tmpl gempak_dir:COM_ATMOS_GEMPAK_TMPL
for file_in in "${gempak_dir}/gfs_1p00_${PDY}${cycle}f"*; do
file_out="${COMIN}/$(basename "${file_in}")"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be updated to COMOUT.

@AntonMFernando-NOAA AntonMFernando-NOAA self-assigned this Jan 5, 2026
@AntonMFernando-NOAA AntonMFernando-NOAA marked this pull request as ready for review January 7, 2026 16:10
@DavidHuber-NOAA DavidHuber-NOAA self-requested a review January 9, 2026 16:54
if [[ ! -L "${COMIN}" ]]; then
${NLN} "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi
cpreq -R "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, sorry for the whiplash. This will take some more thought. Please revert these cpreq calls to NLN and add a TODO. I will create a follow-up issue.

if [[ ! -L ${COMIN} ]]; then
${NLN} "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi
cpreq -R "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the intended use of cpreq with -R to copy a directory.
A required directory may exist, but may not contain all the required files. cpreq operates on a file and if it does not exist or is corrupted, reports an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

@aerorahul I'm not sure if this is the intended purpose, but the cpreq script does take $* as the argument to cp (cpreq#L3):

cp $*

Thus, the -R does get passed as an argument to cp and if anything fails in the copy, it will call err_exit. That said, the standards only have one example with a single file operation:

   cpreq $COMIN/inputfile inputfile       # copy essential input files into working directory

All of that said, I think these linking/copying operations need to be reworked anyway and I'll open a follow-up issue for that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I misread your comment. You're correct about the potentially-missing files. Still, I'll open another issue.

Copy link
Contributor

@aerorahul aerorahul Jan 9, 2026

Choose a reason for hiding this comment

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

Yes. cpreq is essentially this: cp $*; if [[ $? -ne 0 ]]; then echo "we have a problem"; exit 1; fi

I think that's quite silly. Instead, it should work on file-by-file basis, because a directory may exist with none of the required files and yet cpreq will succeed.

Instead, we should propose to NCO that cpreq should be more thorough.

AntonMFernando-NOAA and others added 13 commits January 12, 2026 14:43
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
if [[ ! -L ${COMIN} ]]; then
${NLN} "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi
cpreq -R "${COMIN_ATMOS_GEMPAK_1p00}" "${COMIN}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be reverted to linking.

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.

4 participants