Skip to content

Commit

Permalink
Update main_v11.1-ref after #2920, #2923 (#2926)
Browse files Browse the repository at this point in the history
* Add user execute permissions to compile script - main_v11.1 (#2740)

* Changing -j to "-j 5" as the recommended value for MAKE_ARGS

* Per #2761, update the MET development environment after upgrading seneca to debian bookworm.

* Per #2761, define runtime python version for testing  rather than using the default version which no longer exists in /usr/local

* Per #2761, fix  setting ci-skip-all

* Per #2761, patching test_util.R to use the -C command line option for ncdiff.

* #2652 Added find_var_by_standard_name and separated common codes to find_xy_vars

* #2757 The SonarQube token and URL are replaced with the pre-defined strings, SONAR_TOKEN_VALUE and SONAR_SERVER_URL

* #2757 Get the email list from the environment variable MET_CRON_EMAIL_LIST__MET (or MET_CRON_EMAIL_LIST)

* #2757 The SonarQube token and URL are replaced by using the environment variable SONAR_TOKEN_VALUE and SONAR_SERVER_URL

* Bugfix #2760 main_v11.1 --enable-python (#2767)

* #2755 Added a header count and checking header count instead of using header id (hid)

* Bugfix #2782 main_v11.1 MASSDEN (#2784)

* Per #2782, update the multiple matching records warning message to include the table number for each record.

* Per #2782, update read_grib2_record_list() to parse the level values and aerosol information correctly for table 4.48.

* Per #2782 tweak variable naming convention.

* Removing ${MAKE_ARGS} in some locations

Removing ${MAKE_ARGS} from "make install" and "make test" for MET.  Removing "met" prefix from met.configure.log because we really need config.log for any detail.  It is confusing to have met.configure.log when that does not contain useful information.

* Adding -lnetcdf -lm to configure_lib_args for NetCDF-CXX

* Feature #2796 main_v11.1 gha node20 (#2798)

* Per #2796, update versions of actions to fix the node 16 to 20 warning message.

* Per #2796, port fixes for artifact name handling over from the develop branch to the main_v11.1 testing workflow. Also add the compilation_options.yml workflow since the workflows are being updated.

* Create 11.1.0_casper

* Recent changes to branch protection rules for the main_vX.Y branches have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge main_vX.Y into main_vX.Y-ref directly, use an intermediate update_truth_for_main_vX.Y branch.

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* Bugfix #2833 main_v11.1 azimuth (#2834)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, port fixes over from the bugfix_2833_develop_azimuth branch over to the main_v11.1 branch.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2379 main_v11.1 sonarqube GHA (#2848)

* Per #2379, migrating largely the same changes for #2379 into the main_v11.1 branch. The difference is that --enable-all is not used since that is not a valid configuration option for MET version 11.1.0.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* Feature #2379 main_v11.1 sonarqube updates (#2851)

* Feature #2379 main_v11.1 single_sq_project (#2866)

* Bugfix 2867 point2grid qc flag main v11.1 (#2874)

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high and changed qc flags for ADP

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values

* #2867 Get the ADP QC flag values from the varibale attributes (support GOES16 Enterprise allgorithm) and apply them for QC Flags. Adjusted the ADP QC flags based on the variable QC values

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Bugfix 2867 point2grid qc flag main v11.1 (#2878)

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high and changed qc flags for ADP

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values

* #2867 Get the ADP QC flag values from the varibale attributes (support GOES16 Enterprise allgorithm) and apply them for QC Flags. Adjusted the ADP QC flags based on the variable QC values

* #2867 Added adjusted confidnece counts

* #2867 Corretced indent

* #2867 Corretced indent

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* #2884 No filtering by QC flags without -qc option (#2885)

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Per #2659, making updates as proposed at the 20240516 MET Eng. Mtg. (#2896)

* Bugfix #2897 main_v11.1 python_valid_time (#2898)

* Per #2897, fix typos in 3 log messages. Also fix the bug in storing the valid time strings. The time string in vld_array should exactly correspond to the numeric unixtime values in vld_num_array. Therefore they need to be updated inside the same if block. The bug is that we were storing only the unique unixtime values but storing ALL of the valid time string, not just the unique ones.

* Per #2897, don’t waste time searching, just set vld_odd to n-1

* #2687 Saved the PBL input into the vector (#2903)

* #2904 Changed R path to R-4.4.0 (#2909)

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Bugfix #2856 main_v11.1 ens_climo (#2917)

* Per #2856, reinitialize the climo cdf info pointer.

* Per #2856, update the testing.yml workflow dispatch option to let the comparison branch be manually defined.

* Revert "Per #2856, reinitialize the climo cdf info pointer."

This reverts commit 99b6bb3.

* Per #2856, reinitialize the climo cdf info pointer.

* Revert "Per #2856, update the testing.yml workflow dispatch option to let the comparison branch be manually defined."

This reverts commit 0ae224f.

* Per #2856, update the truth_data_version and input_data_version if main_vX.Y is not present in the branch name.

* Update set_job_controls.sh

* Update set_job_controls.sh

* Per #2856, update logic for counting the maximum number of PCT, PRC, PJC, and PSTD lines. Need to multiply by the number of climo cdf bins.

* Per #2856, add more error checking to avoid writing nan to .stat output files

* Bugfix #2841 main_v11.1 tang_rad_winds (#2920)

* Per #2841, unrelated, just removing a spurious character from a  log message.

* Per #2841, work in progress. Mostly just modifying whitespace and log messages so far

* Per #2841, running tc_rmw with only UGRD input causes the tool to hang. Adding break statements to prevent the hang.

* Per #2841, add new has_pressure_level() utility function and update tc_rmw to use it to deteremine whether or not the pressure dimension should be written the output rather than basing that off the number of levels being > 1.

* Per #1849, fix to radial and tangential winds.

* Per #2841, just changing a code comment about the longitude swap

* Per #2841, update variable names for consistency and understanding.

* Per #2841, the substantive bug fixed here is how we index into the U and V data in wind_ne_to_rt() using i_rev instead of i. Also, update the variable names for consistency and clarity..

* Per #2841, patch apparent copy/paste bug in tcrmw_grid.cc code.

* Per #2841, only changing whitespace.

* Per #2841, update logic in EarthRotation::set_tcrmw() to change the rotation of TCRMW grids from pointing north to pointing east.

* Per #2841, fix warning message

* Replace tab with spaces

* Per #2841, correct the units for the azimuth netcdf output variable

* Per #2841, reverse the x dimension of the rotated latlon grid to effectively switch from counterclockwise rotation to clockwise.

* Feature #2855 v11.1.1 (#2923)

* Per #2855, add v11.1.1 release notes.

* Per #2841, fix bold formatting of release notes.

* Update conf.py with actual 11.1.1 release date

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
  • Loading branch information
8 people authored Jun 25, 2024
1 parent 86a01ed commit 59a5f86
Show file tree
Hide file tree
Showing 30 changed files with 400 additions and 349 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/enhancement_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Consider breaking the enhancement down into sub-issues.
- [ ] Select **requestor(s)**

### Milestone and Projects ###
- [ ] Select **Milestone** as the next official version or **Backlog of Development Ideas**
- [ ] For the next official version, select the **MET-X.Y.Z Development** project
- [ ] 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.
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/new_feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Consider breaking the new feature down into sub-issues.
- [ ] Select **requestor(s)**

### Milestone and Projects ###
- [ ] Select **Milestone** as the next official version or **Backlog of Development Ideas**
- [ ] For the next official version, select the **MET-X.Y.Z Development** project
- [ ] 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.
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/sub-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ This is a sub-issue of #*List the parent issue number here*.
- [ ] Select **requestor(s)**

### Milestone and Projects ###
- [ ] Select **Milestone** as the next official version or **Backlog of Development Ideas**
- [ ] For the next official version, select the **MET-X.Y.Z Development** project
- [ ] 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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Consider breaking the task down into sub-issues.
- [ ] Select **requestor(s)**

### Milestone and Projects ###
- [ ] Select **Milestone** as the next official version or **Backlog of Development Ideas**
- [ ] For the next official version, select the **MET-X.Y.Z Development** project
- [ ] 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.
Expand Down
21 changes: 20 additions & 1 deletion .github/jobs/set_job_controls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ elif [ "${GITHUB_EVENT_NAME}" == "push" ]; then
input_data_version=${branch_name:6}
fi

# check for main_vX.Y in the branch name
elif [[ "${branch_name}" =~ .*(main_v)([0-9]+\.[0-9]+).* ]]; then

truth_data_version=${BASH_REMATCH[1]}${BASH_REMATCH[2]}
input_data_version=${BASH_REMATCH[2]}

fi

# check commit messages for skip or force keywords
Expand Down Expand Up @@ -87,14 +93,27 @@ elif [ "${GITHUB_EVENT_NAME}" == "push" ]; then

elif [ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]; then

branch_name=`cut -d "/" -f3 <<< "${GITHUB_REF}"`

# check for main_vX.Y in the branch name
if [[ "${branch_name}" =~ .*(main_v)([0-9]+\.[0-9]+).* ]]; then

truth_data_version=${BASH_REMATCH[1]}${BASH_REMATCH[2]}
input_data_version=${BASH_REMATCH[2]}

fi

if [ "${force_tests}" == "true" ]; then

run_diff=true

fi

fi

# if updating truth or running diff, run unit tests
if [ "$run_update_truth" == "true" ] || [ "$run_diff" == "true" ]; then
if [ "$run_update_truth" == "true" ] ||
[ "$run_diff" == "true" ]; then

run_unit_tests=true

Expand Down
23 changes: 23 additions & 0 deletions docs/Users_Guide/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ When applicable, release notes are followed by the GitHub issue number which des
enhancement, or new feature (`MET GitHub issues <https://github.com/dtcenter/MET/issues>`_).
Important issues are listed **in bold** for emphasis.

MET Version 11.1.1 release notes (20240621)
-------------------------------------------

.. dropdown:: Bugfixes

* Bugfix: Refine support for coordinate dimensions in CF-compliant NetCDF files (`#2638 <https://github.com/dtcenter/MET/issues/2638>`_).
* Bugfix: Fix support for NSIDC v4 Climate Data Record data on Polar Stereographic grids in CF-compliant NetCDF files (`#2652 <https://github.com/dtcenter/MET/issues/2652>`_).
* Bugfix: Fix the Point-Stat CNT header line typo causing duplicate SI_BCL column names (`#2730 <https://github.com/dtcenter/MET/issues/2730>`_).
* Bugfix: Fix MET to compile without the optional --enable-python configuration option (`#2760 <https://github.com/dtcenter/MET/issues/2760>`_).
* Bugfix: Fix the parsing of level values for GRIB2 template 4.48 data (`#2782 <https://github.com/dtcenter/MET/issues/2782>`_).
* **Bugfix: Fix the TC-Diag and TC-RMW tools to correctly handle the range and azimuth settings in range/azimuth grids** (`#2833 <https://github.com/dtcenter/MET/issues/2833>`_).
* **Bugfix: Fix TC-RMW to correct the tangential and radial wind computations** (`#2841 <https://github.com/dtcenter/MET/issues/2841>`_).
* Bugfix: Fix Ensemble-Stat's handling of climo data when verifying ensemble-derived probabilities (`#2856 <https://github.com/dtcenter/MET/issues/2856>`_).
* Bugfix: Update the logic of -qc option for ADP at point2grid (`#2867 <https://github.com/dtcenter/MET/issues/2867>`_).
* Bugfix: Some AOD data was filtered out without -qc option with point2grid (`#2884 <https://github.com/dtcenter/MET/issues/2884>`_).
* Bugfix: Fix inconsistent handling of point observation valid times processed through Python embedding (`#2897 <https://github.com/dtcenter/MET/issues/2897>`_).
* Bugfix: Fix PBL derivation bug in main_v11.1 by porting over fix from develop (`#2902 <https://github.com/dtcenter/MET/issues/2902>`_).

.. dropdown:: Enhancements

* **Eliminate the use of temporary files in the vx_config library** (`#2691 <https://github.com/dtcenter/MET/issues/2691>`_).
* Enhance Point2Grid to support modified quality control settings for smoke/dust AOD data in GOES-16/17 as of April 16, 2024 (`#2853 <https://github.com/dtcenter/MET/issues/2853>`_).

MET Version 11.1.0 release notes (20230731)
-------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/Users_Guide/tc-diag.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Originally developed for the Statistical Hurricane Intensity Prediction Scheme (

TC-Diag is run once for each initialization time to produce diagnostics for each user-specified combination of TC tracks and model fields. The user provides track data (such as one or more ATCF a-deck track files), along with track filtering criteria as needed, to select one or more tracks to be processed. The user also provides gridded model data from which diagnostics should be computed. Gridded data can be provided for multiple concurrent storms, multiple models, and/or multiple domains (i.e. parent and nest) in a single run.

TC-Diag first determines the list of valid times that appear in any one of the tracks. For each valid time, it processes all track points for that time. For each track point, it reads the gridded model fields requested in the configuration file and transforms the gridded data to a range-azimuth cylindrical coordinates grid. For each domain, it writes the range-azimuth data to a temporary NetCDF file.
TC-Diag first determines the list of valid times that appear in any one of the tracks. For each valid time, it processes all track points for that time. For each track point, it reads the gridded model fields requested in the configuration file and transforms the gridded data to a range-azimuth cylindrical coordinates grid, as described for the TC-RMW tool in :numref:`tc-rmw`. For each domain, it writes the range-azimuth data to a temporary NetCDF file.

.. note:: The current version of the tool does not yet include the capabilities described in the next three paragraphs. These additional capabilities are planned to be added in the MET v12.0.0 release later in 2023.

Expand Down
2 changes: 1 addition & 1 deletion docs/Users_Guide/tc-rmw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TC-RMW Tool
Introduction
============

The TC-RMW tool regrids tropical cyclone model data onto a moving range-azimuth grid centered on points along the storm track provided in ATCF format, most likely the adeck generated from the file. The radial grid spacing may be set as a factor of the radius of maximum winds (RMW). If wind fields are specified in the configuration file the radial and tangential wind components will be computed. Any regridding method available in MET can be used to interpolate data on the model output grid to the specified range-azimuth grid. The regridding will be done separately on each vertical level. The model data files must coincide with track points in a user provided ATCF formatted track file.
The TC-RMW tool regrids tropical cyclone model data onto a moving range-azimuth grid centered on points along the storm track provided in ATCF format, most likely the adeck generated from the file. The radial grid spacing can be defined in kilometers or as a factor of the radius of maximum winds (RMW). The azimuthal grid spacing is defined in degrees clockwise from due east. If wind vector fields are specified in the configuration file the radial and tangential wind components will be computed. Any regridding method available in MET can be used to interpolate data on the model output grid to the specified range-azimuth grid. The regridding will be done separately on each vertical level. The model data files must coincide with track points in a user provided ATCF formatted track file.

Practical information
=====================
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
project = 'MET'
author = 'UCAR/NCAR, NOAA, CSU/CIRA, and CU/CIRES'
author_list = 'Jensen, T., J. Prestopnik, H. Soh, L. Goodrich, B. Brown, R. Bullock, J. Halley Gotway, K. Newman, J. Opatz'
version = '11.1.0'
version = '11.1.1'
verinfo = version
release = f'{version}'
release_year = '2023'
release_date = f'{release_year}-07-31'
release_year = '2024'
release_date = f'{release_year}-06-25'
copyright = f'{release_year}, {author}'

# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion internal/scripts/environment/development.seneca
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export MET_TEST_INPUT=${MET_PROJ_DIR}/MET_test_data/unit_test
export MET_FONT_DIR=${MET_TEST_INPUT}/fonts

# Define Rscript to use a version with the ncdf4 package 1.17 or later
export MET_TEST_RSCRIPT=/nrit/ral/R-4.3.1/bin/Rscript
export MET_TEST_RSCRIPT=/nrit/ral/R-4.4.0/bin/Rscript

# Define runtime Python version
export MET_TEST_MET_PYTHON_EXE=${MET_PYTHON_BIN_EXE}
Expand Down
3 changes: 2 additions & 1 deletion src/basic/vx_util/util_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
////////////////////////////////////////////////////////////////////////

// Released versions of MET
static const char met_version_11_1_1[] = "V11.1.1";
static const char met_version_11_1_0[] = "V11.1.0";
static const char met_version_11_0_0[] = "V11.0.0";
static const char met_version_10_1_0[] = "V10.1.0";
Expand All @@ -42,7 +43,7 @@ static const char met_version_1_1[] = "V1.1";

////////////////////////////////////////////////////////////////////////

static const char * const met_version = met_version_11_1_0;
static const char * const met_version = met_version_11_1_1;
static const char default_met_data_dir[] = "MET_BASE";
static const char txt_file_ext[] = ".txt";
static const char stat_file_ext[] = ".stat";
Expand Down
8 changes: 7 additions & 1 deletion src/libcode/vx_grid/earth_rotation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ M23 = clat*clon;
M33 = slat;
*/

set_np(lat_center, lon_center, lon_center - 180.0);
//
// MET #2841 define the rotation by subtracting 90 degrees
// instead of 180 to define TCRMW grids as pointing east
// instead of north.
//

set_np(lat_center, lon_center, lon_center - 90.0);

//
//
Expand Down
99 changes: 27 additions & 72 deletions src/libcode/vx_grid/tcrmw_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Ir.set_xyz(1.0, 0.0, 0.0);
Jr.set_xyz(0.0, 1.0, 0.0);
Kr.set_xyz(0.0, 0.0, 1.0);

Range_n = 0;
Range_n = 0;
Azimuth_n = 0;

Range_max_km = 0.0;
Expand Down Expand Up @@ -288,6 +288,7 @@ y = (lat_rot - RData.rot_lat_ll)/(RData.delta_rot_lat);

x = lon_rot/(RData.delta_rot_lon);

x = Nx - x; // MET #2841 switch from counterclockwise to clockwise

RotatedLatLonGrid::xy_to_latlon(x, y, lat, lon);

Expand All @@ -310,6 +311,8 @@ const double range_max_deg = deg_per_km*Range_max_km;

RotatedLatLonGrid::latlon_to_xy(lat, lon, x, y);

x = Nx - x; // MET #2841 switch from counterclockwise to clockwise

azi_deg = x*(RData.delta_rot_lon);

range_deg = range_max_deg - y*(RData.delta_rot_lat);
Expand All @@ -324,54 +327,23 @@ return;
////////////////////////////////////////////////////////////////////////


void TcrmwGrid::wind_ne_to_ra (const double lat, const double lon,
const double east_component, const double north_component,
double & radial_component, double & azimuthal_component) const
void TcrmwGrid::wind_ne_to_rt (const double azi_deg,
const double u_wind, const double v_wind,
double & radial_wind, double & tangential_wind) const

{

Vector E, N, V;
Vector B_range, B_azi;
double azi_deg, range_deg, range_km;


latlon_to_range_azi(lat, lon, range_km, azi_deg);

range_deg = deg_per_km*range_km;

E = latlon_to_east (lat, lon);
N = latlon_to_north (lat, lon);

V = east_component*E + north_component*N;


range_azi_to_basis(range_deg, azi_deg, B_range, B_azi);



radial_component = dot(V, B_range);

azimuthal_component = dot(V, B_azi);





return;
double rcos = cosd(azi_deg);
double rsin = sind(azi_deg);

if (is_bad_data(u_wind) || is_bad_data(v_wind)) {
radial_wind = bad_data_double;
tangential_wind = bad_data_double;
}
else {
radial_wind = rcos*u_wind + rsin*v_wind;
tangential_wind = -1.0*rsin*u_wind + rcos*v_wind;
}


////////////////////////////////////////////////////////////////////////


void TcrmwGrid::wind_ne_to_ra_conventional (const double lat, const double lon,
const double east_component, const double north_component,
double & radial_component, double & azimuthal_component) const

{

wind_ne_to_ra(lat, lon, east_component, north_component, radial_component, azimuthal_component);

return;

Expand All @@ -381,33 +353,17 @@ return;
////////////////////////////////////////////////////////////////////////


void TcrmwGrid::range_azi_to_basis(const double range_deg, const double azi_deg, Vector & B_range, Vector & B_azi) const
void TcrmwGrid::wind_ne_to_rt (const double lat, const double lon,
const double u_wind, const double v_wind,
double & radial_wind, double & tangential_wind) const

{

double u, v, w;


u = cosd(range_deg)*sind(azi_deg);

v = cosd(range_deg)*cosd(azi_deg);

w = -sind(range_deg);



B_range = u*Ir + v*Jr + w*Kr;

double range_km, azi_deg;

u = cosd(azi_deg);

v = -sind(azi_deg);

w = 0.0;


B_azi = u*Ir + v*Jr + w*Kr;
latlon_to_range_azi(lat, lon, range_km, azi_deg);

wind_ne_to_rt(azi_deg, u_wind, v_wind, radial_wind, tangential_wind);

return;

Expand All @@ -425,8 +381,9 @@ RotatedLatLonGrid::latlon_to_xy(true_lat, true_lon, x, y);

x -= Nx*floor(x/Nx);

x -= Nx*floor(x/Nx);
x = Nx - x; // MET #2841 switch from counterclockwise to clockwise

y -= Ny*floor(y/Ny);

return;

Expand All @@ -442,7 +399,9 @@ void TcrmwGrid::xy_to_latlon(double x, double y, double & true_lat, double & tru

x -= Nx*floor(x/Nx);

x -= Nx*floor(x/Nx);
x = Nx - x; // MET #2841 switch from counterclockwise to clockwise

y -= Ny*floor(y/Ny);

RotatedLatLonGrid::xy_to_latlon(x, y, true_lat, true_lon);

Expand Down Expand Up @@ -500,7 +459,3 @@ return;

////////////////////////////////////////////////////////////////////////





23 changes: 6 additions & 17 deletions src/libcode/vx_grid/tcrmw_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ class TcrmwGrid : public RotatedLatLonGrid {

void calc_ijk(); // calculate rotated basis vectors

void range_azi_to_basis(const double range_deg, const double azi_deg, Vector & B_range, Vector & B_azi) const;

TcrmwData TData;


Vector Ir, Jr, Kr;

int Range_n, Azimuth_n; // # of points in the radial and azimuthal directions
Expand Down Expand Up @@ -89,23 +86,15 @@ class TcrmwGrid : public RotatedLatLonGrid {

void xy_to_latlon(double x, double y, double & true_lat, double & true_lon) const;

void wind_ne_to_rt(const double azi_deg,
const double u_wind, const double v_wind,
double & radial_wind, double & tangential_wind) const;

void wind_ne_to_rt(const double lat, const double lon,
const double u_wind, const double v_wind,
double & radial_wind, double & tangential_wind) const;

void wind_ne_to_ra(const double lat, const double lon,
const double east_component, const double north_component,
double & radial_component, double & azimuthal_component) const;


//
// possibly toggles the signs of the radial and/or azimuthal components
//
// to align with the conventions used in the TC community
//

void wind_ne_to_ra_conventional (const double lat, const double lon,
const double east_component, const double north_component,
double & radial_component, double & azimuthal_component) const;

};


Expand Down
Loading

0 comments on commit 59a5f86

Please sign in to comment.