Skip to content

Add conservative limiters for the 'cons2' interpolation (field data colocation on nodes and cells supported!)#366

Open
sbrdar wants to merge 92 commits into
ecmwf:developfrom
sbrdar:feature/cons_interp_limiter_nodes_my
Open

Add conservative limiters for the 'cons2' interpolation (field data colocation on nodes and cells supported!)#366
sbrdar wants to merge 92 commits into
ecmwf:developfrom
sbrdar:feature/cons_interp_limiter_nodes_my

Conversation

@sbrdar

@sbrdar sbrdar commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Description

This addresses the issue #347 to a add mass-conserving limiter for over-/under-shoots after the 2nd order conservative interpolation 'cons2'.

Add analytical functions XStep and SlottedCylinder to test limiters. In addition, a non-conservative 'clip' limiter is added for comparison.

The selection of limiter is done by passing one of the options to ConservativeSphericalPolygonInterpolation: none, clip, zeroslope, ilmc.

Gradient computation based on (Tomita et al., 2001) is singled out as subroutines src_gradient_celldata and src_gradient_nodedata.

Some bugs are fixed in the matrix-free version of conservative interpolation. The existing unit test for cons. interpolation is updated to include tests for matrix-free and matrix conservative interpolations.

The conservative interpolation statistics is updated to include limiter mass change. These statistics are computed if, i.e. statistics.all is passed as an option to the cons2 interpolator.

Note that this PR replaces the previous PR #350 to extend it to all {CellColumns, NodeColumns} -> {CellColumns, NodeColumns} combinations. In addition, note that this PR replaces also #365 to include an implementation of the ilmc limiter (cf. "A mass-conserving and multi-tracer efficient transport scheme in
the online integrated Enviro-HIRLAM model" by B. Sørensen, E. Kaas, and U. S. Korsholm).The previous PRs will be discarded.

The tool sandbox/atlas-conservative-interpolation is completed with the following options

         --limiter=string (Use conservative limiter to prevent under-/overshoots of the 2nd order interpolation [none, zeroslope, clip])
         --limiter-output=string (Write mode in the target field [target, points, contribution])
         --limiter-detector-size=string (Control the size of the detector stencil before including neighbours source values [default 1 -> at least two source cells])

which can soon into app/atlas-interpolation.

The current limitation is that this implementation, albeit MPI-parallel, assumes that spherical polygons are indexed as source cells (not true when masked cells are present).

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

…n every run in the metadata -max_memory_in_bytes_per_task-
…ervation_error to fix the cons. interpolation unit test
…hange the intersection parameters of the source: src_iparam
sbrdar added 27 commits March 17, 2026 14:31
…rce points (= either cell or node) in order not to act multiple times on the same target points
…to which target CSP, and not which node to which target CSP. Now the zeroslope is identical to cons-1 when every point is limited.
…the number of source is insufficient, i.e. smaller than ATLAS_INTERPOLATION_DETECTOR or limiter_detector_
…ize-. The larger the detector size the less likely limiting is. The limiter output can be -target- (default: the limited field), -points- (which target points will be limited), -contribution- (only the field value contribution from the limiter)
…eparing for halo exchange and a parallel ILMC limiter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant