Skip to content

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

Description

@DanielAdriaansen

Describe the Problem

When using ugrid_dataset=mpas;, the forecast lead time is not correctly parsed from the input file. To work around this, set_attr_lead can be configured to use the forecast lead time in METplus wrappers for each forecast variable. However, support for reading this directly from the MPAS files should be added.

In the ugrid_metadata_map, one option is to add a new item for forecast_lead_time_varname (or some other key name, I don't think this is the correct/best option), so the user can set the name of the variable that contains the forecast lead time. We can set the default to be the name we see in the diag files we have used or others have used, but this would allow the user to configure it themselves if it deviated from the default.

Expected Behavior

Grid-Stat and Point-Stat will correctly parse the forecast lead time from MPAS files so it can be used in the output filenames and the FCST_LEAD column in the output files.

Environment

I was working on Seneca preparing for the 2026 MPAS user's workshop mini-tutorial.

To Reproduce

On Seneca, you can find a sample file:
/home/dadriaan/projects/mpas/data/fcst/mpas/ugrid/OK_1km_ugrid/2025051800/ens_1/diag.2025-05-18_01.00.00.nc

There are three variables related to time:

inital_time
xtime
Time

I think that initial_time = forecast initialization time, xtime = forecast valid time, and Time = forecast lead time.

I've created an easy-to-run environment for testing at:
seneca:/home/dadriaan/projects/mpas/bugfix_3410_mpas_ugrid_lead_time

You can issue the command:

./grid_stat fcst_file obs_file GridStatConfig_bugfix -outdir /path/to/your/output

And replacing /path/to/your/output to an area that's writeable.

Running that command as-is, produces these three output files:

-rw-r--r-- 1 dadriaan rap  626 Jul  6 17:53 grid_stat_000000L_20250518_010000V_ctc.txt
-rw-r--r-- 1 dadriaan rap  11M Jul  6 17:53 grid_stat_000000L_20250518_010000V_pairs.nc
-rw-r--r-- 1 dadriaan rap  580 Jul  6 17:53 grid_stat_000000L_20250518_010000V.stat

However note that the 000000L in all of the files, should be 010000L for a "1-hr" lead time as that is the lead time being processed with the sample command.

Additionally, inside the file:
grid_stat_000000L_20250518_010000V.stat

The FCST_LEAD column shows 000000, which once fixed, should say 010000.

Relevant Deadlines

NONE

Funding Source

NCAR base 2702701

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Review default alert labels
  • Select component(s)
  • Select priority
  • Select requestor(s)

Milestone and Projects

  • Select Milestone as the next bugfix version
  • Select METplus-X.Y Support project for support of the current coordinated release
  • Select MET-X.Y Development project for development toward the next coordinated release

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next bugfix version
    Select: METplus-X.Y Support project for support of the current coordinated release
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next official version
    Select: MET-X.Y Development project for development toward the next coordinated release
  • Close this issue.

Metadata

Metadata

Labels

MET: UGRIDIssues related to unstructured grid (UGRID) support in METcomponent: input dataInput data issuepriority: mediumMedium Prioritytype: bugFix something that is not working

Type

Fields

No fields configured for Bug.

Projects

Status
🩺 Needs Triage

Relationships

None yet

Development

No branches or pull requests

Issue actions