Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Direct Linking to COM from DATA for extractvars Job #3379

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

AntonMFernando-NOAA
Copy link
Contributor

@AntonMFernando-NOAA AntonMFernando-NOAA commented Feb 24, 2025

Description

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 (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

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

@AntonMFernando-NOAA
Copy link
Contributor Author

A C48_S2SWA_gefs test passed with DO_EXTRACTVARS="YES". Find the test on HERA at: /scratch1/NCEPDEV/global/Anton.Fernando/RUNTESTS/EXPDIR/gefs2

Copy link
Contributor

@EricSinsky-NOAA EricSinsky-NOAA left a comment

Choose a reason for hiding this comment

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

Thank you for working on this, @AntonMFernando-NOAA. There are some infile if-statements that may need some revision. Please see my comments.

Comment on lines 81 to 82
elif [[ -f "${new_infile}" ]]; then
echo "WARNING: ${new_infile} does not exist in ${subdata}. Copying skipped."
Copy link
Contributor

Choose a reason for hiding this comment

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

new_infile is defined inside the first if block, so I do not believe this elif condition will ever be met. I think you can check for the existance of new_infile immediately after the cpfs operation.

Comment on lines 79 to 80
elif [[ -f "${infile}" ]]; then
echo "WARNING: ${infile} does not exist in ${com_dir}."
Copy link
Contributor

Choose a reason for hiding this comment

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

The infile existence check has already been performed on line 74.

Suggested change
elif [[ -f "${infile}" ]]; then
echo "WARNING: ${infile} does not exist in ${com_dir}."
else
echo "WARNING: ${infile} does not exist in ${com_dir}."

Comment on lines 83 to 84
else
echo "WARNING: ${infile} and ${new_infile} do not exist."
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the existence of infile and new_infile has already been checked, this part is not needed.

Suggested change
else
echo "WARNING: ${infile} and ${new_infile} do not exist."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@EricSinsky-NOAA I’ve made the suggested changes. Please disregard my previous comments. I now understand what you meant.

Comment on lines 95 to 106
if [[ -f "${infile}" ]]; then # check if input file exists before extraction
new_infile="${outdirpre}/$(basename "${infile}")_ext"
cpfs "${infile}" "${new_infile}"
# shellcheck disable=SC2312
${WGRIB2} "${infile}" | grep -F -f "${varlist_d}" | ${WGRIB2} -i "${infile}" -append -grib "${outfile}"
${WGRIB2} "${new_infile}" | grep -F -f "${varlist_d}" | ${WGRIB2} -i "${new_infile}" -append -grib "${outfile}"
elif [[ -f "${infile}" ]]; then
echo "WARNING: ${infile} does not exist in ${com_dir}."
elif [[ -f "${new_infile}" ]]; then
echo "WARNING: ${new_infile} does not exist in ${subdata}. Copying skipped."
else
echo "WARNING: ${infile} does not exist."
echo "WARNING: ${infile} and ${new_infile} do not exist."
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Please see my earlier comments. I think the same logic applies here as well.

Comment on lines 78 to 83
elif [[ -f "${infile}" ]]; then
echo "WARNING: ${infile} does not exist in ${com_dir}."
elif [[ -f "${new_infile}" ]]; then
echo "WARNING: ${new_infile} does not exist in ${subdata}. Copying skipped."
else
echo "WARNING: ${infile} does not exist."
echo "WARNING: ${infile} and ${new_infile} do not exist."
Copy link
Contributor

Choose a reason for hiding this comment

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

Please see my earlier comments in ush/atmos_extractvars.sh. I think the same logic applies here.

Comment on lines 35 to 36
elif [[ -f "${infile}" ]]; then
echo "WARNING: ${infile} does not exist in ${com_dir}."
Copy link
Contributor

Choose a reason for hiding this comment

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

infile was already checked in the previous if-block (line 31). Please see my comments in ush/atmos_extractvars.sh.

@AntonMFernando-NOAA AntonMFernando-NOAA self-assigned this Feb 27, 2025
@AntonMFernando-NOAA AntonMFernando-NOAA added bug Something isn't working and removed bug Something isn't working labels Feb 27, 2025
Copy link
Contributor

@EricSinsky-NOAA EricSinsky-NOAA left a comment

Choose a reason for hiding this comment

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

The changes look good. Just a couple minor issues.

@AntonMFernando-NOAA
Copy link
Contributor Author

@EricSinsky-NOAA Removed the unnecessary cpfs line. Thanks for the suggestions!

Copy link
Contributor

@EricSinsky-NOAA EricSinsky-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 making those revisions.

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.

Remove direct linking to COM from DATA for extractvars job
2 participants