Skip to content

Enhance MET to handle CF-compliant time strings with an offset defined in months or years. #2155

@JohnHalleyGotway

Description

@JohnHalleyGotway

Describe the Enhancement

This issue arose via GitHub discussions dtcenter/METplus#1604 and an enhancement to the MET's support for CF-compliant NetCDF files is needed to read WOA climatology files. This enhancement supports development of the NOAA/EMC EVS verification system.

As of MET version 10.1.0, processing CF-compliant data with times defined with a months or years offset results in this warning message.

WARNING: parse_cf_time_string() -> Unsupported time step in the CF convention time unit "months since 1955-01-01 00:00:00"

And MET uses sets the valid time to unixtime 0 which is Jan 1, 1970.

The "months" offset is commonly used for climatology data and climate simulations, and this short-coming has come up a few times in the past.

The use of months is discouraged since they vary. According to this section of the CF-convention documentation, 1 year = 365.242198781 days and 1 month = 1 year / 12. So 1 month = 30.436 days.

However, I recommend against implementing this logic. Instead, let's implement the logic that users actually intend and expect. For example, when time is defined as a value of 377.5 with the string "months since 1955-01-01 00:00:00"...

  • Use integer division to convert 377.5 to 31 years + 5 months + 15 days.
  • Increment the year from 1955 to 1986.
  • Increment the month from 01 to 06.
  • Increment the day from 01 to 15.

The last step is confusing. Modelers use 0.5 month to mean the 15th of the months rather than an offset of 15 days (01 + 15). Need to think about that one.

@hsoh-u also ask how to handle these cases, where the compute time does not actually exist?
Another issue is what if the start day is 29, 30 or 31.
"month since 2020-01-29 00:00:00"
"month since 2020-01-31 00:00:00"
30, Feb
31, Apr

We'd need to define logic for handling these edge cases.

Time Estimate

Estimate the amount of work required here.
Issues should represent approximately 1 to 3 days of work.

Sub-Issues

Consider breaking the enhancement down into sub-issues.
No sub-issues needed.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

2773542 (was 2793541)

Define the Metadata

Assignee

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

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Repository and/or Organization level Project(s) or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next official version or Future Versions

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement 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 develop.
    Branch name: feature_<Issue Number>_<Description>
  • Complete the development 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 develop.
    Pull request: feature <Issue Number> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Linked issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions