-
Notifications
You must be signed in to change notification settings - Fork 24
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
Bugfix: Fix MTD to run on any MET-supported grid projection #2979
Comments
…_netcdf_grid(...) and write_netcdf_proj(...) library utility functions. Note that these changes do compile but I haven't tested whether they actually fix the underlying problem. Also note that nc_utils_local.h/.cc can also likely be replaced with calls to common library functions.
@j-opatz, the change from using MTD-specific code for reading/writing grid information to/from NetCDF files to calling common library functionality was very easy and quick. Please see the code compiled for this bugfix branch:
Can you please test that version of MTD with the test data to see if the behavior has changed? |
…nd lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...).
I manually tested as described below to confirm that this set of changes works as expected.
Errors out with:
And it runs fine without error. |
…_netcdf_grid(...) and write_netcdf_proj(...) library utility functions. Note that these changes do compile but I haven't tested whether they actually fix the underlying problem. Also note that nc_utils_local.h/.cc can also likely be replaced with calls to common library functions.
…nd lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...).
…with calls to common library code. Also remove commented out code.
* Per #2979, remove nc_grid.h/.cc and replace it with calls to the read_netcdf_grid(...) and write_netcdf_proj(...) library utility functions. Note that these changes do compile but I haven't tested whether they actually fix the underlying problem. Also note that nc_utils_local.h/.cc can also likely be replaced with calls to common library functions. * Per #2979, remove references to nc_grid.o from the MTD test code. * Per #2979, the write_netcdf_proj(...) utility function adds the lat and lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...). * Per #2979, add this issue to the revision 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * #2884 No filtering by QC flags without -qc option (#2885) Co-authored-by: Howard Soh <[email protected]> * 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 <[email protected]> * 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 * bugfix #2936 point2grid for tripolar GFS input (#2945) * #2936 Support 1D lat/lon values * #2936 Change obs_type to TYPE_NCCF if FileType_NcCF is given from the config file --------- Co-authored-by: Howard Soh <[email protected]> * Bugfix #2958 main_v11.1 BAGSS SEDI CI (#2960) * Bugfix #2958 main_v11.1 ORSS (#2972) Co-authored-by: MET Tools Test Account <[email protected]> * Bugfix #2979 main_v11.1 MTD Grid (#2980) * Per #2979, remove nc_grid.h/.cc and replace it with calls to the read_netcdf_grid(...) and write_netcdf_proj(...) library utility functions. Note that these changes do compile but I haven't tested whether they actually fix the underlying problem. Also note that nc_utils_local.h/.cc can also likely be replaced with calls to common library functions. * Per #2979, remove references to nc_grid.o from the MTD test code. * Per #2979, the write_netcdf_proj(...) utility function adds the lat and lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...). * Per #2979, add this issue to the revision history. --------- Co-authored-by: George McCabe <[email protected]> Co-authored-by: Julie Prestopnik <[email protected]> Co-authored-by: John Halley Gotway <[email protected]> Co-authored-by: MET Tools Test Account <[email protected]> Co-authored-by: Howard Soh <[email protected]> Co-authored-by: Howard Soh <[email protected]> Co-authored-by: metplus-bot <[email protected]>
* Per #2979, remove nc_grid.h/.cc and replace it with calls to the read_netcdf_grid(...) and write_netcdf_proj(...) library utility functions. Note that these changes do compile but I haven't tested whether they actually fix the underlying problem. Also note that nc_utils_local.h/.cc can also likely be replaced with calls to common library functions. * Per #2979, remove references to nc_grid.o from the MTD test code. * Per #2979, insert a newline in unit.py output between the env vars and the command. * Per #2979, insert a newline in unit.py output between the env vars and the command. * Per #2979, the write_netcdf_proj(...) utility function adds the lat and lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...). * Per #2979, minor changes to is_eq() calls to fix compiler warning messages * Per #2979, for the develop branch, also replace nc_utils_local.h/.cc with calls to common library code. Also remove commented out code. * Per #2979, delete commented out code and make error/warning message formatting consistent. * Fixes for SonarQube --------- Co-authored-by: MET Tools Test Account <[email protected]>
* 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * #2884 No filtering by QC flags without -qc option (#2885) Co-authored-by: Howard Soh <[email protected]> * 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 <[email protected]> * 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 * bugfix #2936 point2grid for tripolar GFS input (#2945) * #2936 Support 1D lat/lon values * #2936 Change obs_type to TYPE_NCCF if FileType_NcCF is given from the config file --------- Co-authored-by: Howard Soh <[email protected]> * Bugfix #2958 main_v11.1 BAGSS SEDI CI (#2960) * Bugfix #2958 main_v11.1 ORSS (#2972) Co-authored-by: MET Tools Test Account <[email protected]> * Bugfix #2979 main_v11.1 MTD Grid (#2980) * Per #2979, remove nc_grid.h/.cc and replace it with calls to the read_netcdf_grid(...) and write_netcdf_proj(...) library utility functions. Note that these changes do compile but I haven't tested whether they actually fix the underlying problem. Also note that nc_utils_local.h/.cc can also likely be replaced with calls to common library functions. * Per #2979, remove references to nc_grid.o from the MTD test code. * Per #2979, the write_netcdf_proj(...) utility function adds the lat and lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...). * Per #2979, add this issue to the revision history. * Update config_options.rst (#2986) Updating to fix a typo in which "mesage_type_group_map" is mis-spelled. * Hotfix to main_v11.1 to set the MET_TEST_INPUT path on seneca after the change to the SEEPS filename. --------- Co-authored-by: George McCabe <[email protected]> Co-authored-by: Julie Prestopnik <[email protected]> Co-authored-by: John Halley Gotway <[email protected]> Co-authored-by: MET Tools Test Account <[email protected]> Co-authored-by: Howard Soh <[email protected]> Co-authored-by: Howard Soh <[email protected]> Co-authored-by: Jonathan Vigh <[email protected]> Co-authored-by: metplus-bot <[email protected]>
Describe the Problem
This issue arose via this dtcenter/METplus#2691 GitHub discussion.
Currently the MTD tool utilizes a specialized code to create output netCDFs (the write_nc_grid function). During the code creation, support was only given to a small subset of grid projections ( lat/lon, lambert conformal, and polar stereographic).
As a result, passing in any of the other MET-supported grid projections (for example, rotated lat/lon) and requesting output in those same projections results in an error:
Expected Behavior
Because MET and METplus as a whole support more grid projections than what write_nc_grid supports, users should be able to pass any of the supported grid projections and receive output in their desired (and supported) grid projections.
We should update MTD's logic to use the common library code write_netcdf_proj function which would fix this issue (ie support all METplus supported projections).
This bugfix should be applied to the develop branch, as well as a 11.1 bugfix patch.
Environment
Describe your runtime environment:
*1. Machine: Seneca
*2. OS: Linux
*3. MET-12.0 NB09232024
To Reproduce
Describe the steps to reproduce the behavior:
*1. Use input data not in one of the 3 listed projections: lat/lon, lambert conformal, or polar stereographic
*2. Call the MTD tool
Note: @j-opatz can provide testing data and configuration file as needed.
Relevant Deadlines
List relevant project deadlines here or state NONE.
Funding Source
2782544 (NOAA Base FY24)
Define the Metadata
Assignee
Labels
Milestone and Projects
Define Related Issue(s)
Consider the impact to the other METplus components.
Bugfix Checklist
See the METplus Workflow for details.
Branch name:
bugfix_<Issue Number>_main_<Version>_<Description>
Pull request:
bugfix <Issue Number> main_<Version> <Description>
Select: Reviewer(s) and Development issue
Select: Milestone as the next bugfix version
Select: Coordinated METplus-X.Y Support project for support of the current coordinated release
Branch name:
bugfix_<Issue Number>_develop_<Description>
Pull request:
bugfix <Issue Number> develop <Description>
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
The text was updated successfully, but these errors were encountered: