feat(grb): add binary grid file reader, support grid file in fmi (WIP) #2153
+383
−47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce a
GridFileReader
module with ability to load variables from a binary grid file. Use this from fmi packages, if a newGWFGRID
entry is provided in fmi package data, to facilitate an identical check to that introduced in #2149 for exchanges.This module generalizes the approach in
grb.f90
and replaces that module. The converter can use the new module.The tentative idea is to make the grid file optional for fmi for some time, then begin to require it, in the interest of catching user errors. At which point the
GridFileReader
could be modified to load the entire discretization, and we can do a robust grid comparison as discussed in #2149. For now, the reader loads headers and builds an index of the file at init time, after which variables can be read as necessary.Checklist of items for pull request
fprettify