dtcenter / MET

Model Evaluation Tools
https://dtcenter.org/community-code/model-evaluation-tools-met
Apache License 2.0
74 stars 22 forks source link

Bugfix #2841 develop tang_rad_winds #2921

Closed JohnHalleyGotway closed 1 week ago

JohnHalleyGotway commented 2 weeks ago

Expected Differences

Please review this at the same time as PR #2920, to fix this bug in the main_v11.1 branch.

Pull Request Testing

I used ncdump to dump to ascii and compare the results. Some diffs are way out in the 8th or more decimal place, but real differences only occur for 850TANG, 850VORT, and 200DVRG as planned/hoped:

Screen Shot 2024-06-21 at 11 10 01 AM

I'll note that while the diagnostics are modified, they do not resolve the discrepancies noted in MET #2729.

Please find the code for testing on seneca in: /d1/projects/MET/MET_pull_requests/met-12.0.0/beta5/MET-bugfix_2841_develop_tang_rad_winds

You can find the updated documentation for this PR at this link: https://met--2921.org.readthedocs.build/en/2921/Users_Guide/tc-rmw.html

Pull Request Checklist

See the METplus Workflow for details.

JohnHalleyGotway commented 2 weeks ago

@JohnHalleyGotway and @KathrynNewman met to review this PR and found the following:

JohnHalleyGotway commented 2 weeks ago

I was able to update the logic in tcrmw_grid.cc to reverse the x dimension of the range-azimuth grid, effectively switching from a counterclockwise rotation of azimuths to clockwise. Here's what that change looks like in the latitudes:

Screen Shot 2024-06-22 at 11 16 56 AM

Moving left to right, as the azimuth increases from 0 degrees to 360 degrees, the CCW data on the left INCREASES in latitude before decreasing. Whereas the updated CW data on the right DECREASES in latitude before increasing.

A similar result can be seen in the reversed pattern of the range/azimuth gridded data. Here's 500mb RH, CCW on the left and CW on the right:

Screen Shot 2024-06-22 at 11 19 29 AM

I also see the clockwise rotation by inspecting the lat/lon locations reported in the DEBUG(4) log messages from by TC-RMW. Compare the center point to the lat/lon of 4 points for range ~= 200km. Here's a selection:

DEBUG 4: wind_ne_to_rt() -> center lat/lon (25.3, 84.8), range (km): 199.8, azimuth (deg): 0, point lat/lon (25.2867, 82.8149), uv (-22.29, 3.51), radial wind: -22.29, tangential wind: 3.51
DEBUG 4: wind_ne_to_rt() -> center lat/lon (25.3, 84.8), range (km): 199.8, azimuth (deg): 90, point lat/lon (23.5052, 84.8), uv (-21.41, 2.45), radial wind: 2.45, tangential wind: 21.41
DEBUG 4: wind_ne_to_rt() -> center lat/lon (25.3, 84.8), range (km): 199.8, azimuth (deg): 180, point lat/lon (25.2867, 86.7851), uv (-18.19, 3.81), radial wind: 18.19, tangential wind: -3.81
DEBUG 4: wind_ne_to_rt() -> center lat/lon (25.3, 84.8), range (km): 199.8, azimuth (deg): 270, point lat/lon (27.0948, 84.8), uv (-20.07, 3.66), radial wind: -3.66, tangential wind: -20.07

Note that I also dumped the data from some of these lines into Excel to "manually" derive radial and tangential winds to confirm that MET is computing them correctly. The manual output matches the values reported by MET.

I also compared the U/V values reported in these log messages to the values shown in the NetCDF range-azimuth file and confirmed that they are consistent... just to make sure there wasn't a problem in how the data is being read from the file.