Skip to content

Feature #1518 winds#3403

Open
JohnHalleyGotway wants to merge 66 commits into
developfrom
feature_1518_winds
Open

Feature #1518 winds#3403
JohnHalleyGotway wants to merge 66 commits into
developfrom
feature_1518_winds

Conversation

@JohnHalleyGotway

@JohnHalleyGotway JohnHalleyGotway commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

This is a rather extensive set of changes to more broadly support wind rotation and derivation of gridded wind data across multiple input file types. Please note the following development details:

  1. set_job_controls.sh reverts back to METbaseimage 3.4 for now since 3.5 causes an unrelated segfault in TC-Diag. This needs to be fixed separately.
  2. ConfigConstants defaults show common GRIB and WRF-NetCDF variable names. Please advise if these should be updated.
  3. In unit_plot_data_plane.xml, I added is_grid_relative=false; in 2 spots to suppress wind rotation to preserve existing output and demonstrate that setting is_grid_relative actually works.
  4. The new tests in unit_winds.xml call pcp_combine as a "pass-through" to demonstrate the rotation and derivations of winds from both U/V and wind speed/direction inputs.
  5. The WindMetaData struct stores the metadata for identifying winds info in one spot. It is an element of VarInfo and can be specified separately for EACH FIELD read, if needed.
  6. Big picture, the wind rotation logic previously housed in the GRIB 1/2 library code is now moved into the vx_data2d base class library.
  7. In the read_wind_data() function, when going U->V or V->U, it FIRST tries swapping the U's and V's to look for a match. If the swap changes the field name, we try that first. If not, we proceed to the search strings in the *_wind_field_name option.
  • To try a new name, we store and use the entire "Dictionary" entry for that field... swapping in only the new name.
  • I found that calling set_name() was NOT sufficient. Instead we need the full set_dict() option to include all the misc config options.
  1. Changes in table_lookup.h/.cc should be noted. Previously, MET logged when a variable named (e.g. TMP) appeared more than once in the GRIB tables. Of course that happens all the time! That's now changed to only print info about the name NEVER appearing in the GRIB tables.
  2. Changes are made in the library code for all the derived file types.
  3. Additional changes are needed in the application code for...
  • PCP-Combine: In get_field() reach each config string independently rather than letting one string settings affect the subsequent ones.
  • Ensemble-Stat and Gen-Ens-Prod: Add nullptr check
  • Point2Grid: Read ConfigConstants file prior to config strings so that the new wind field name settings are defined in context.

Expected Differences

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

    If yes, please describe:

    Adds the following config options in ConfigConstants:
// Comma-separated lists of wind variable names for rotating and deriving
u_wind_field_name = "UGRD,U";
v_wind_field_name = "VGRD,V";
wind_speed_field_name = "WIND,SP";
wind_direction_field_name = "WDIR,DD";
  • 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:

    Extensive manual testing during development and added 3 new unit tests in unit_winds.xml to illustrate the functionality for GRIB1, GRIB2, and WRF-NetCDF input files.

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

    • Please review the doc updates for accuracy and clarity.
    • Please run the new tests in unit_winds.xml at verbosity level 3 and carefully review the log messages about the derivation and rotation of winds.
    • Please try to break it... using other flavors of NetCDF inputs and providing "bad" settings for the new config options to make sure that MET fails "gracefully" with bad inputs.
    • Find the code compiled and available for testing in seneca:/d1/projects/MET/MET_pull_requests/met-13.0.0/rc1/MET-feature_1518_winds.
  • 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? [Yes]

    • 3 new tests in unit_winds.xml demonstrate with 3 input files. Please advise if testing for additional inputs is warranted.
  • Will this PR result in changes to the MET test suite? [Yes]

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

    • 3 new output files from unit_winds.xml are added.
    • 3 existing output files are modified:
      • grib_tables/um_raw/PS.557WW_SC.U_DI.F_GP.GALWEM-GD_GR.C17KM_AR.GLOBAL_DD.20160424_CY.00_FH.000_DF.ps
        • Title changes from "TCDC" to "TCC" single GRIB table lookup logic changes impact how how to select data from this GALWEM file.
      • grid_stat/grid_stat_WRF_pres_120000L_20190831_120000V_pairs.nc and grid_stat/grid_stat_WRF_pres_120000L_20190831_120000V.stat
        • Existing output for U_PL data (e.g. U-wind at pressure levels) was NOT being rotated from grid-to-earth relative, and now it is.
  • Will this PR result in changes to existing METplus Use Cases? [Maybe]

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

    • Any existing METplus use cases reading WRF wind data will be impacted. It's also possible that GALWEM use cases will be impacted by improvements to GRIB table lookup.
  • Do these changes introduce new SonarQube findings? [Yes]

    If yes, please describe:

    • Some findings are flagged but the overall number of findings are reduced by 75 from 13,534 in develop to 13,459 for this branch.
  • Please complete this pull request review by [Friday, July 3rd].

    I scheduled a meeting to discuss for Tuesday, June 30th.

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.

…d, used a pre-defined hard-coded list of variable names to drive the derivation logic.
…class. Next up are handling wind rotations and adding lots of tests.
…add long names and units for derived wind fields.
…ing winds, the level string needs to be wrapped in parenthesis based on the existing parsing logic.
…r than just the derived classes for GRIB1 and GRIB2.
…nce. Still need to add the vorticity and divergence derivations and add new unit tests.
…cp_combine -sum command to work again on precip data where name = APCP_03 while req_name = APCP.
…). We now have rotate_winds() for both DataPlane and DataPlaneArray inputs. And wind rotation is now handled AFTER the calls to process_data_plane().
…as to make the unit tests happier. ci-run-unit
@JohnHalleyGotway JohnHalleyGotway requested review from georgemccabe, jaredalee and michelleharrold and removed request for jaredalee June 25, 2026 18:10
@JohnHalleyGotway JohnHalleyGotway marked this pull request as ready for review June 25, 2026 21:04
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

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.

Generalize support for automated derivation of wind speed and direction and rotation of winds from grid to earth-relative

1 participant