Skip to content
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 #2187 main_v10.1 ao_sf #2189

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

JohnHalleyGotway
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway commented Jun 15, 2022

These changes fix this bug by defining two new NetCDF utility functions, get_var_add_offset_value() and get_var_scale_offset_value(), and then update the vx_data2d_met, vx_data2d_nccf, and vx_data2d_pinterp libraries to call them.

Expected Differences

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

    If yes, please describe:

  • 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

To be clear, here are the range of values before this fix:

DEBUG 4: Data plane information:
DEBUG 4:    plane min: -30620
DEBUG 4:    plane max: 215363

And after the fix:

DEBUG 4: Data plane information:
DEBUG 4:    plane min: -3.062
DEBUG 4:    plane max: 21.5363

Note that these ranges differ by a factor of 10000, which corresponds to the specified scale factor:

HDAY:scale_factor = 0.0001f ;
  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

  • Review the code changes.

  • Confirm that all GHA tests pass.

  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [No]
    None needed.

  • Do these changes include sufficient testing updates? [No]
    I chose NOT to add a new test for this case. I decided that it wasn't worth it since this is a custom data file that's still in the process of changing rather than an operational dataset.

  • Will this PR result in changes to the test suite? [No]

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

  • Please complete this pull request review by [Fri 6/17/22].

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)
    Select: Organization level software support Project or Repository level development cycle Project
    Select: Milestone as the version that will include these changes
  • After submitting the PR, select Linked issues with the original issue number.
  • 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.

Copy link
Collaborator

@hsoh-u hsoh-u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve. Main differences are conditions to apply add_offset or scale_factor (from both attributes,"add_offset" and "scale_factor", to any attributes.

@JohnHalleyGotway JohnHalleyGotway merged commit 1958e02 into main_v10.1 Jun 16, 2022
@JohnHalleyGotway JohnHalleyGotway deleted the bugfix_2187_main_v10.1_ao_sf branch June 16, 2022 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Fix NetCDF library code to process scale_factor and add_offset attributes independently.
2 participants