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/eckit geo #275

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Feature/eckit geo #275

wants to merge 2 commits into from

Conversation

pmaciel
Copy link
Member

@pmaciel pmaciel commented Nov 20, 2024

This is an integration of the eckit::geo grids and iterators into eccodes. This needs to be switched at configuration time with both:

  • CMake variables ENABLE_GEOGRAPHY=ON and ENABLE_ECKIT_GEO=ON (configuration time), and
  • env variable ECCODES_ECKIT_GEO=1 (runtime)

in which case any request for a eccodes "geo iterator" will create a eckit::geo:Grid and iterate from it -- that is, there only one eckit::geo-based iterator, which should support all GRIB grids.

This version already supports the corrections to known GRIB problems from a yaml, and some other corrections hardcodes, as fixed in mir (the "GribSpec" class is imported from MIR's "GribInput").

Also, note that not all grids are supported or tested just yet, though the regular_ll, regular_gg, reduced_gg, HEALPix, and similar should work minus some fixes. The projection-based grids not so, there's no link to the "ProjectionSpec" yet.

@pmaciel
Copy link
Member Author

pmaciel commented Nov 20, 2024

I've changed the code to minimise the intrusion in the original code. The building of eckit::geo-based iterators is now placed at the earliest possible call.

@pmaciel
Copy link
Member Author

pmaciel commented Nov 20, 2024

Before anyone asks (!) the change in grib_tools.cc is to call eckit::Main::initialise, a requirement, compiled out in case of disabled feature. It also supports puture packing from eckit (when that happens.)

@shahramn
Copy link
Collaborator

We won't need to call:
eckit::Main::initialise(argc, argv);
in the tools. As the tools will not need to change.
We are only changing the implementation of the src/geo_iterators

@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.74%. Comparing base (8df839f) to head (e84b3d9).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #275   +/-   ##
========================================
  Coverage    87.74%   87.74%           
========================================
  Files          808      808           
  Lines        62092    62093    +1     
  Branches     11024    11024           
========================================
+ Hits         54484    54485    +1     
  Misses        7608     7608           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@pmaciel
Copy link
Member Author

pmaciel commented Nov 21, 2024

We won't need to call: eckit::Main::initialise(argc, argv); in the tools. As the tools will not need to change. We are only changing the implementation of the src/geo_iterators

This is a requirement on using eckit, and is part of its design. Main holds a singleton to access command-line options, and "resources" (specially formatted arguments and environment variables), and is responsible for initialising low-level infrastructure like logging channels. The natural place for it to be is right next to the main() function, hence the change.

But well pointed, I added an initialisation if you trigger the eckit::geo functionality not from a tool that it will do a blng initialisation (ie. initialise eckit, regardless.) We don't have a use for that just yet, but will soon.

@pmaciel
Copy link
Member Author

pmaciel commented Nov 21, 2024

Note that this version already supports ORCA and FESOM grids (!), among other functionality that is difficult to check at the moment, so I can call grib_get_data on a GRIB and it will download the necessary files and run properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants