Add torus support for interpolation fields#954
Conversation
|
Mandatory Tests Please make sure you run these tests via comment before you merge!
Optional Tests To run benchmarks you can use:
To run tests and benchmarks with the DaCe backend you can use:
To run test levels ignored by the default test suite (mostly simple datatest for static fields computations) you can use:
For more detailed information please look at CI in the EXCLAIM universe. |
| ) | ||
| self.register_provider(cell_average_weight) | ||
| case _: | ||
| raise ValueError("TODO") |
There was a problem hiding this comment.
Probably assert_never is better. Here and elsewhere.
| ), | ||
| "domain_length": self._grid.global_properties.domain_length | ||
| if self._grid.global_properties.domain_length | ||
| else -1.0, |
There was a problem hiding this comment.
Ugly, but have to pass numeric values to factory.
| # TODO(msimberg): Exact result for torus without the following. 1e-16 error | ||
| # with the the following. Is it needed? | ||
| return _force_mass_conservation_to_c_bln_avg( | ||
| c2e2c0, | ||
| c_bln_avg, | ||
| cell_areas, | ||
| cell_owner_mask, | ||
| divavg_cntrwgt, | ||
| horizontal_start_level_3, | ||
| array_ns, | ||
| ) |
There was a problem hiding this comment.
I can't really judge if there are cases for torus where force_mass_conservation is actually required for some grids.
If not, we could leave it out, but the inaccuracy that it introduces is also minimal, so may be safer to leave it in.
| # TODO(msimberg): Rename again. This is arc length on a unit sphere for | ||
| # icosahedral grids and real distance for torus grids. |
There was a problem hiding this comment.
To do: renaming.
This difference is also visible in the rbf scale factor, where for icosahedral grids the factor is in radians and for toruses in meters(?).
I think we probably want to keep compatibility with icon fortran here so that the same scale factors can be used for both icon4py and icon fortran.
Based upon #953 #954 and #957 by @msimberg Adds torus support to geometry, RBF and interpolation. Also adds torus grids to all datatests --------- Co-authored-by: Mikael Simberg <[email protected]>
Best viewed as diff to #953, on which this is based: msimberg/icon4py@better-torus-support-geometry...msimberg:icon4py:better-torus-support-interpolation.