Replace cp with cpfs/cpreq for atomic copies to COM directories #4130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses issue #3051 by replacing standard
cp
commands with atomic copy utilities (cpfs
andcpreq
fromprod_util
) for all copies to COM directories. This is required per NCO Implementation Standards v11 to prevent downstream programs from accessing incomplete files.Problem
Using standard
cp
for large files can result in downstream programs accessing incomplete copies while the copy operation is still in progress. This is particularly problematic in operational weather forecasting where timing and data integrity are critical.Solution
Replaced all instances of
cp
to COM directories with:cpfs
: For output files being copied TO COM directories (11 instances)cpreq
: For required input files being copied FROM COM directories (1 instance)The
cpfs
utility provides atomic copies by:This ensures downstream processes never see partially written files.
Changes
Modified 3 files with 12 total changes:
ush/tropcy_relocate.sh (5 changes)
ush/syndat_qctropcy.sh (6 changes)
ush/wave_prnc_ice.sh (1 change)
Testing
cp
to COM directoriesImpact
Fixes #3051
Co-authored-by: @DavidHuber-NOAA
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.