Skip to content

Bugfix #3410 ugrid lead time develop - #3425

Open
hsoh-u wants to merge 15 commits into
developfrom
bugfix_3410_ugrid_lead_time_develop
Open

Bugfix #3410 ugrid lead time develop#3425
hsoh-u wants to merge 15 commits into
developfrom
bugfix_3410_ugrid_lead_time_develop

Conversation

@hsoh-u

@hsoh-u hsoh-u commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Expected Differences

The init_hour (or lead_time) is computed.

  1. If the time variable has the units minutes/hours since YYYY-MM-DD, sets init_time from the units attribute.
  2. If init_time variable is configured at the UGrid configurations, read the init_time variable and sets oroverride init_time
  3. Compute init_hour/lead_time from the time variable and init_time variable

As a result, the 7 output file names were changed from *_000000_* to _120000_ because init_hour 00 was changed to 12. The FCST_LEAD column at the output files were changed too.

The unit.py was updated to handle missing output files and initialized the result object to None

Refactored UGridFile::open_metadata() at ugrid_file.cc and separated two APIs: metadata_coord_variables() and metadata_time().

  • Do these changes introduce new tools, command line arguments, or configuration file options? [No]

    If yes, please describe:

  • Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [No]

    If yes, please describe:

Pull Request Testing

  • Describe testing already performed for these changes:

by unit test
The binary files are available at seneca:/d1/personal/hsoh/git/pull_request/MET_bugfix_3410_ugrid_lead_time_develop/share/met
Note:
/d1/personal/hsoh/git/pull_request/MET_bugfix_3410_ugrid_lead_time_develop/share/met/config/UGridConfig_mpas should be applied to compute lead_hour (to read the initial_time variable).

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes]

  • Do these changes include sufficient testing updates? [No]

The tests themselves were not updated, but the existing tests are now producing different outputs — specifically, the file name and init_hour columns differ across the 7 files.

  • Will this PR result in changes to the MET test suite? [No]

    If yes, describe the new output and/or changes to the existing output:

The output file names are different (from 000000 to 120000). The values in the init_hour columns have also changed.

  • Will this PR result in changes to existing METplus Use Cases? [Yes]

    If yes, create a new Update Truth METplus issue to describe them.

The output file names changed from 000000 to 120000. If these are used as input for the test cases, the expected input files may no longer exist. The values in the init_hour columns have also changed.

  • Do these changes introduce new SonarQube findings? [No]

    If yes, please describe:

  • Please complete this pull request review by [Fill in date].

Pull Request Checklist

See the METplus Workflow for details.

  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the version that will include these changes
    Select: METplus-X.Y Support project for bugfix releases or MET-X.Y Development project for the next coordinated release
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

@JohnHalleyGotway JohnHalleyGotway changed the title Bugfix 3410 ugrid lead time develop Bugfix #3410 ugrid lead time develop Aug 21, 2026
@github-project-automation github-project-automation Bot moved this to 🩺 Needs Triage in METplus-13.0 Development Aug 21, 2026
@JohnHalleyGotway JohnHalleyGotway moved this from 🩺 Needs Triage to 🔎 In review in METplus-13.0 Development Aug 21, 2026
@JohnHalleyGotway JohnHalleyGotway added this to the MET-13.0.0 milestone Aug 21, 2026

@DanielAdriaansen DanielAdriaansen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same changes as in #3424

Comment thread docs/Users_Guide/appendixH.rst Outdated
Comment thread docs/Users_Guide/appendixH.rst Outdated
@DanielAdriaansen

Copy link
Copy Markdown
Contributor

@hsoh-u I also suggest we update the MPAS test data for the UGRID capability as part of this PR. Could you try running the unit tests with this file on Seneca?

/home/dadriaan/projects/mpas/tutorial/data/fcst/mpas/ugrid/OK_12km_ugrid/2025051800/ens_1/diag.2025-05-18_12.00.00.nc

Here is the static file:
/home/dadriaan/projects/mpas/tutorial/data/fcst/mpas/ugrid/OK_12km_ugrid/init.nc

hsoh-u and others added 2 commits August 26, 2026 10:44
Co-authored-by: Dan Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Dan Adriaansen <dadriaan@ucar.edu>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In review

Development

Successfully merging this pull request may close these issues.

Bugfix: Enable MPAS UGRID support to parse forecast lead time from diag files

3 participants