Skip to content

Bugfix: Fix support for the YYYYMMDD format in NetCDF level timestrings #2482

@John-Sharples

Description

@John-Sharples

I'm currently testing a move from METplus 4.1.3 (MET 10.1.2) to 5.0.0 (11.0.0), and noticed this change in behaviour.

Might be bug, but there's an easy work around, so reporting as a request for enhanced doco. I couldn't see anything in the release notes or any related issues, please close if already documented somewhere.

Describe the Enhancement

With METplus 4.1.3 I can run the following without errors
plot_data_plane some_fcst.nc output.ps 'name="apcp";level="(20230102,*,*)";'

With METplus 5.0.0 I get the following:

WARNING: MetNcCFDataFile::convert_time_to_offset() -> 20230102 does not exist at time variable
WARNING:
ERROR  :
ERROR  : MetNcCFDataFile::data_plane(VarInfo &, DataPlane &) -> the requested time offset -9999 for "apcp" variable is out of range (between 0 and 9).
ERROR  :
ERROR  :

The workaround is to provide the date string with full HHMMSS format. e.g.
plot_data_plane some_fcst.nc output.ps 'name="apcp";level="(20230102_000000,*,*)";'

Note that this also applies to other tools. For example, to avoid similar errors in GridStat
FCST_VAR1_LEVELS = "({valid?fmt=%Y%m%d},*,*)"
Should become
FCST_VAR1_LEVELS = "({valid?fmt=%Y%m%d_%H%M%S},*,*)"

Time Estimate

Not much.

Sub-Issues

Consider breaking the enhancement down into sub-issues.

  • Add a checkbox for each sub-issue here.

Relevant Deadlines

NONE.

Funding Source

NONE.

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

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions