Skip to content

Prevent periodic halo double-counting in conservative spherical polygon interpolation (H32 NodeColumns → H64)#364

Draft
Copilot wants to merge 4 commits into
developfrom
copilot/fix-halo-issue-periodic-boundary
Draft

Prevent periodic halo double-counting in conservative spherical polygon interpolation (H32 NodeColumns → H64)#364
Copilot wants to merge 4 commits into
developfrom
copilot/fix-halo-issue-periodic-boundary

Conversation

Copy link
Copy Markdown

Copilot AI commented May 15, 2026

Large source halos in conservative-spherical-polygon interpolation could include geographically identical periodic halo polygons in addition to owned source polygons, producing inflated target values near the periodic boundary (notably for H32 NodeColumns remapped to H64). This change removes that duplicate-path contribution and adds a focused regression for constant-field preservation in the affected configuration.

  • Source KD-tree deduplication path (NodeColumns)

    • Updated source polygon candidate selection in ConservativeSphericalPolygonInterpolation::build_source_kdtree(...).
    • For node-based source data, halo classification now uses node_halo || node_ghost when deciding whether a node should go through remote (partition, remote_index) deduplication.
    • This aligns node-based behavior with cell-based halo handling and prevents periodic halo duplicates from being inserted as distinct source contributors.
  • Regression coverage for the reported case

    • Added regression_halo_periodic_source_nodecolumns in test_interpolation_conservative.cc.
    • Targets Grid("H32") -> Grid("H64") with src_cell_data=false, tgt_cell_data=true.
    • Verifies non-halo target cells preserve constant input values across multiple constants (0.0, -2.5, 1.0), guarding against periodic-boundary amplification regressions.
  • Representative change

    // NodeColumns source: treat halo nodes like ghosts for deduplicated source selection
    if (consider_src(node_part(inode), node_ridx(inode), node_halo(inode) || node_ghost(inode))) {
        ...
    }

💣💥☠️ Static Analyzer Report ☠️💥💣
https://sites.ecmwf.int/docs/atlas/static-analyzer/PR-364

Copilot AI changed the title [WIP] Fix large halo issue in ConvexSphericalPolygonInterpolation Prevent periodic halo double-counting in conservative spherical polygon interpolation (H32 NodeColumns → H64) May 15, 2026
Copilot AI requested a review from sbrdar May 15, 2026 09:00
Copilot finished work on behalf of sbrdar May 15, 2026 09:00
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.

[ConvexSphericalPolygonInterpolation] A large enough halo causes wrong values at the periodic boundary

2 participants