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

Refine the vector level matching logic when reading NetCDF output generated by other MET tools #3087

Closed
11 of 24 tasks
JohnHalleyGotway opened this issue Feb 18, 2025 · 0 comments · Fixed by #3088 or #3089
Closed
11 of 24 tasks
Assignees
Labels
MET: Wind Verification priority: medium Medium Priority requestor: UK Met Office United Kingdom Met Office type: enhancement Improve something that it is currently doing
Milestone

Comments

@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Feb 18, 2025

Describe the Enhancement

This issue arose via the dtcenter/METplus#2898 discussion. The task is to enhance the vx_data2d_nc_met library to better support computing VL1L2/VAL1L2/VCNT vector statistics at multiple levels when reading data from MET NetCDF files.

Demonstrate the issue to be addressed by running the following commands:

cp $MET_TEST_INPUT/model_data/grib2/gfs/gfs.0p25.2022092400.f012.grib2 .

# Run Regrid-Data-Plane to create a MET NetCDF file with U/V records at multiple pressure levels
regrid_data_plane \
gfs.0p25.2022092400.f012.grib2 \
gfs.0p25.2022092400.f012.grib2 \
regrid_UV.nc \
-field 'name="UGRD"; level="P250";' \
-field 'name="VGRD"; level="P250";' \
-field 'name="UGRD"; level="P500";' \
-field 'name="VGRD"; level="P500";'

# Run Grid-Stat to compute VL1L2 at multiple pressure levels
grid_stat regrid_UV.nc regrid_UV.nc GridStatConfig_UV -v 3

Where GridStatConfig_UV includes:

fcst = {
   field = [
      { name = "UGRD_P250"; level = "P250"; is_u_wind = true; },
      { name = "VGRD_P250"; level = "P250"; is_v_wind = true; },
      { name = "UGRD_P500"; level = "P500"; is_u_wind = true; },
      { name = "VGRD_P500"; level = "P500"; is_v_wind = true; }
   ];
}
obs = fcst;

And generates the following warning messages:

DEBUG 3: U-wind field array entry 1 matches V-wind field array entry 2.
DEBUG 3: U-wind field array entry 1 matches V-wind field array entry 4.
WARNING: 
WARNING: GridStatConfInfo::process_config() -> For U-wind, found multiple matching V-wind field array entries! Using the first match found. Set the "level" strings to differentiate between them.
WARNING: 
DEBUG 3: V-wind field array entry 2 matches U-wind field array entry 1.
DEBUG 3: V-wind field array entry 2 matches U-wind field array entry 3.
WARNING: 
WARNING: GridStatConfInfo::process_config() -> For V-wind, found multiple matching U-wind field array entries! Using the first match found. Set the "level" strings to differentiate between them.
WARNING: 
DEBUG 3: U-wind field array entry 3 matches V-wind field array entry 2.
DEBUG 3: U-wind field array entry 3 matches V-wind field array entry 4.
  • Fix the logic to actually use the specified level string when determining the U/V matches.

In addition:

  • Be sure to add a new unit test to demonstrate this usage in grid_stat or point_stat.
  • Unrelated, but also remove line 68 of temp_file.cc (int errno;) since it is NOT needed and may cause a compilation error as described in the Error when installing METplus--12.0.2 METplus#2897 discussion.

Time Estimate

< 1 day

Sub-Issues

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

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Spend up to 2 h of 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 a MET-X.Y.Z version, Consider for Next Release, or Backlog of Development Ideas
  • For a MET-X.Y.Z version, select the MET-X.Y.Z Development project

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 issue
    Select: Milestone as the next official version
    Select: MET-X.Y.Z Development project for development toward the next official release
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.
@JohnHalleyGotway JohnHalleyGotway added alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle MET: Wind Verification priority: medium Medium Priority requestor: UK Met Office United Kingdom Met Office type: enhancement Improve something that it is currently doing labels Feb 18, 2025
@JohnHalleyGotway JohnHalleyGotway added this to the MET-12.1.0 milestone Feb 18, 2025
@JohnHalleyGotway JohnHalleyGotway self-assigned this Feb 18, 2025
@github-project-automation github-project-automation bot moved this to 🩺 Needs Triage in METplus-6.1.0 Development Feb 18, 2025
@JohnHalleyGotway JohnHalleyGotway moved this from 🩺 Needs Triage to 🟢 Ready in METplus-6.1.0 Development Feb 18, 2025
@JohnHalleyGotway JohnHalleyGotway removed alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle labels Feb 18, 2025
JohnHalleyGotway added a commit that referenced this issue Feb 18, 2025
…ore the requested level string to allow for discriminating between multiple U/V vertical level matches.
JohnHalleyGotway added a commit that referenced this issue Feb 18, 2025
…temp_file.cc that caused an unexpected copmilation error with GCC 9.4.0 on Ubuntu as described in the dtcenter/METplus#2897 discussion.
JohnHalleyGotway added a commit that referenced this issue Feb 18, 2025
…e creating vector pairs at multiple levels from NetCDF input files.
@JohnHalleyGotway JohnHalleyGotway linked a pull request Feb 18, 2025 that will close this issue
17 tasks
@JohnHalleyGotway JohnHalleyGotway moved this from 🟢 Ready to 🔎 In review in METplus-6.1.0 Development Feb 18, 2025
JohnHalleyGotway added a commit that referenced this issue Feb 19, 2025
…string to just a string itself. This is based on SonarQube code smells, but the implementation is much simpler and easier to maintain.
JohnHalleyGotway added a commit that referenced this issue Feb 19, 2025
…num class and the use of explicit since those had huge and wide-ranging impacts. Touching that many files is not worth it to reduce SonarQube code smells.
JohnHalleyGotway added a commit that referenced this issue Feb 20, 2025
…t_point2grid.xml by switching from requesting the 'Z2' level to using '*', like all the other simliar point2grid tests. Note that I DID actually test to confirm that 'Z2' and '*' produce the same result. So specifying Z2 does NOT actually filter the obs data as you'd expect it would. With this change, the diff of the output from the test should go away for PR #3088.
JohnHalleyGotway added a commit that referenced this issue Feb 20, 2025
… line from the Ensemble-Stat chapter of the MET User's Guide referencing the 'ens' dictionary which was removed at the same time Gen-Ens-Prod was created.
JohnHalleyGotway added a commit that referenced this issue Feb 20, 2025
* Per #3087, update logic in VarInfoNcMet::set_magic(...) to actuall store the requested level string to allow for discriminating between multiple U/V vertical level matches.

* Unrelated to #3087, delete unneeded 'int errno;' local variable from temp_file.cc that caused an unexpected copmilation error with GCC 9.4.0 on Ubuntu as described in the dtcenter/METplus#2897 discussion.

* Per #3087, tweak logic to handle '*' and fix resolve regression test differences.

* Per #3087, add regrid_data_plane and grid_stat unit test to demostrate creating vector pairs at multiple levels from NetCDF input files.

* Per #3087, forgot to add the Grid-Stat config file needed for the new unit test.

* Per #3075, refine name and logic the new tests.

* Per #3087, update ConcatString class to simplify from a pointer to a string to just a string itself. This is based on SonarQube code smells, but the implementation is much simpler and easier to maintain.

* Per #3087, drive down a few more SonarQube code smells.

* Per #3087, back out the ConcatString changes to switch from enum to enum class and the use of explicit since those had huge and wide-ranging impacts. Touching that many files is not worth it to reduce SonarQube code smells.

* Per #3087, modify the existing point2grid_pb2nc_big_input test in unit_point2grid.xml by switching from requesting the 'Z2' level to using '*', like all the other simliar point2grid tests. Note that I DID actually test to confirm that 'Z2' and '*' produce the same result. So specifying Z2 does NOT actually filter the obs data as you'd expect it would. With this change, the diff of the output from the test should go away for PR #3088.

* Unrelated to #3087, but pointed out by @j-opatz, removing an outdated line from the Ensemble-Stat chapter of the MET User's Guide referencing the 'ens' dictionary which was removed at the same time Gen-Ens-Prod was created.
@github-project-automation github-project-automation bot moved this from 🔎 In review to 🏁 Done in METplus-6.1.0 Development Feb 20, 2025
@JohnHalleyGotway JohnHalleyGotway linked a pull request Feb 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MET: Wind Verification priority: medium Medium Priority requestor: UK Met Office United Kingdom Met Office type: enhancement Improve something that it is currently doing
Projects
Status: 🏁 Done
Development

Successfully merging a pull request may close this issue.

2 participants