Skip to content

Commit

Permalink
Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1…
Browse files Browse the repository at this point in the history
… since the range values start at 0.
  • Loading branch information
JohnHalleyGotway committed Mar 11, 2024
1 parent afd886a commit 18ace77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/tools/tc_utils/tc_diag/tc_diag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// 000 09/27/22 Halley Gotway New
// 001 08/17/23 Halley Gotway MET #2609 handle missing data
// 002 10/24/23 Halley Gotway MET #2550 enhance diagnostics
// 003 03/11/24 Halley Gotway MET #2833 range/azimuth grid
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -2203,7 +2204,9 @@ void TmpFileInfo::setup_nc_file(const DomainInfo &di,
// Set grid center
d.lat_center = pnt_ptr->lat();
d.lon_center = -1.0*pnt_ptr->lon(); // degrees east to west
d.range_max_km = di.delta_range_km * d.range_n;

// MET #2833 divide by n-1 since the ranges begin at 0 km
d.range_max_km = di.delta_range_km * (d.range_n - 1);

// Instantiate the grid
grid_out.set(d);
Expand Down
5 changes: 4 additions & 1 deletion src/tools/tc_utils/tc_rmw/tc_rmw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// 002 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main
// 003 09/28/22 Prestopnik MET #2227 Remove namspace std and netCDF from header files
// 004 04/26/23 Halley Gotway MET #2523 Reorder NetCDF dimensions
// 005 03/11/24 Halley Gotway MET #2833 range/azimuth grid
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -688,9 +689,11 @@ void process_fields(const TrackInfoArray& tracks) {
grid_data.lat_center = point.lat();
grid_data.lon_center = -1.0*point.lon(); // internal sign change

// MET #2833 divide by n-1 since the ranges begin at 0 km
// RMW is same as mrd()
grid_data.range_max_km = conf_info.rmw_scale *
point.mrd() * tc_km_per_nautical_miles * conf_info.n_range;
point.mrd() * tc_km_per_nautical_miles *
(conf_info.n_range - 1);
tcrmw_grid.clear();
tcrmw_grid.set_from_data(grid_data);
grid.clear();
Expand Down

0 comments on commit 18ace77

Please sign in to comment.