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

Feature #2565 nccf_laea #2616

Merged
merged 13 commits into from
Jul 24, 2023
Merged

Feature #2565 nccf_laea #2616

merged 13 commits into from
Jul 24, 2023

Conversation

JohnHalleyGotway
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway commented Jul 20, 2023

Expected Differences

This Pull Request consists of 3 main changes:

  1. Restore support for parsing LAEA grids from CF-compliant NetCDF files.
  2. Fix support for parsing LAEA grids from GRIB2 files.
  3. Add the configure and make logs to the output artifacts created by the MET compilation step of GHA.
  • 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

  • Describe testing already performed for these changes:

    Manually tested with CF-compliant NetCDF and GRIB2 inputs and confirmed that they work as expected.

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

    • Please review the code changes.
    • Please review the small change to the documentation.
    • Note the differences in the unit tests described below.
    • Download the artifacts from this GHA run and confirm that the logs now include the following:
MET-feature_2565_nccf_laea-PR_make_test.log
MET-feature_2565_nccf_laea-PR_make_install.log
MET-feature_2565_nccf_laea-PR_configure.log
  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes]

  • Do these changes include sufficient testing updates? [Yes]
    Added a new LAEA test for cf-compliant NetCDF data.

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

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

All the unit tests run without error but 2 differences are flagged.

  1. Add new output from plot_data_plane for CF-compliant NetCDF LAEA data.
ERROR: folder /data/output/met_test_truth missing 1 files
    plot_data_plane/air_temperature_laea_nccf.ps 

Screen Shot 2023-07-21 at 5 08 30 PM
Compare this to the plot of this data produced by panoply:
Screen Shot 2023-07-21 at 5 11 26 PM

  1. The plot_data_plane output for the existing GRIB2 LAEA data is modified:
COMPARING plot_data_plane/ukv_agl_temperature_laea_grib2.ps
file1: /data/output/met_test_truth/plot_data_plane/ukv_agl_temperature_laea_grib2.ps
file2: /data/output/met_test_output/plot_data_plane/ukv_agl_temperature_laea_grib2.ps

Old on the left and new on the right:
Screen Shot 2023-07-21 at 5 13 29 PM

The difference is an ever so subtle change in the orientation of the map outlines. They used to be tilted more left and are now more upright. This is caused by a fix to the central longitude value that's parse for this grid:
Old wrong value:

DEBUG 4:           central_lon: 10.0164

New correct value:

DEBUG 4:           central_lon: 2.5

That value of 2.5 is confirmed correct in the output from wgrib2 (ignore the difference in sign... that's degrees east vs west):

	Lambert Azimuthal Equal Area grid: (1042 x 970) input WE:SN output WE:SN res 48
	Lat1 44.517153 Lon1 2164.600777 Cen Lon -2.500000 Std Par 54.900000
	Dx 2000.000000 m Dy 2000.000000 m mode 48

Note that I submitted this as an issue in the grib2c GitHub repo:
NOAA-EMC/NCEPLIBS-g2c#427

  • Please complete this pull request review by [Monday 7/24/23].

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 Development issue 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.

… from CF-compliant NetCDF files. Note that the GRIB2 parameters remain the primary method for defining LAEA grids. Randy uses the NetCDF parameters to instantiate the GRIB2 data structure.
… adopting this as the standard way of initializing an LAEA grid.
…c to dump the grid data structs that are parsed, just like we do for other file formats (GRIB2, MET NetCDF, ...)
…ide semi_major_axis and semi_minor_axis by 2.
…place the sample MetOffice data over the UK.
…rt-coming in the grib2c library in handling negative longitude values. Define and call a utility function to reprocess the bytes and check for negative values.
@JohnHalleyGotway JohnHalleyGotway added this to the MET 11.1.0 milestone Jul 20, 2023
@JohnHalleyGotway JohnHalleyGotway linked an issue Jul 20, 2023 that may be closed by this pull request
22 tasks

laea.nx = gfld->igdtmpl[7];
laea.ny = gfld->igdtmpl[8];
laea.lat_first = (double)gfld->igdtmpl[9] / 1000000.0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if it's worth it, particularly with the time crunch, but I was wondering if we should consider creating a variable for the 1000000.0 value, which is reused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point Julie. Thanks for mentioning that. I'd like to not make a change at this time because it would apply to about 40 lines of code in this file. I'd rather limit the changes to what's explicitly necessary for this issue during the official release testing time period to limit the lines of code I touch. But this would be good to consider as part of the changes to the vx_grid library's use of the proj library in the future.

Copy link
Collaborator

@jprestop jprestop left a comment

Choose a reason for hiding this comment

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

I reviewed the code changes, reviewed the small change to the documentation, noted the differences in the unit tests as described in the PR description, and downloaded the artifacts from this GHA run and confirmed that the logs now include the log output from all compilation steps. Thanks for getting that working, @JohnHalleyGotway. Having those logs will be very helpful. I approve this PR.

@JohnHalleyGotway JohnHalleyGotway merged commit 44cb1d4 into main_v11.1 Jul 24, 2023
@JohnHalleyGotway JohnHalleyGotway deleted the feature_2565_nccf_laea branch July 24, 2023 17:14
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
Status: Done
Development

Successfully merging this pull request may close these issues.

Bugfix: Refine support for LAEA grids via NetCDF and GRIB2 files
2 participants