Skip to content

Integrate interpolation support from XIOS#1074

Draft
TomMelt wants to merge 4 commits into
developfrom
add-interpolation
Draft

Integrate interpolation support from XIOS#1074
TomMelt wants to merge 4 commits into
developfrom
add-interpolation

Conversation

@TomMelt

@TomMelt TomMelt commented May 6, 2026

Copy link
Copy Markdown
Contributor

Integrate interpolation support from XIOS

Fixes #979

Open Mailing list query with XIOS devs

  • I have created a MWE repo here
  • I have emailed XIOS user mailing list for support (see here)
  • I believe I have implemented all necessary features but I cannot get interpolation working

Task List

  • Linked an issue above that captures the requirements of this PR
  • Defined the tests that specify a complete and functioning change
  • Implemented the source code change that satisfies the tests
  • Commented all code so that it can be understood without additional context
  • No new warnings are generated or they are mentioned below
  • The documentation has been updated (or an issue has been created to do so)
  • Relevant labels (e.g., enhancement, bug) have been applied to this PR
  • This change conforms to the conventions described in the README

Change Description

This PR exposes the interpolation functionality of XIOS into nextsim.

Plan

  • Add new ERA5 fields which exist on the "Forcing" grid/domain
    • add a field_ref to this new field in the main nextsim code
<field id="tairEra5" grid_ref="HGridEra5" />
<field id="tair" field_ref="tairEra5" grid_ref="HGridEra5Interp" /> <!-- done at runtime instead -->
  • Add 2 new grids HGridEra5 and HGridEra5Interp
    • HGridEra5Interp will be same size as nextsim grid, but has the <interpolate_domain/> property set
    • because tair references field tairEra5 but exists on grid_ref="HGridEra5Interp" XIOS will interpolate at runtime
<grid id="HGridEra5">
  <domain domain_ref="era5"/>
</grid>

<grid id="HGridEra5Interp" name="HGridEra5Interp">
  <domain domain_ref="era5Interp">
    <interpolate_domain/>
  </domain>
</grid>
  • Add 2 new domains era5 and era5Interp
    • era5Interp will be the same size as the nextsim model domain, and era5 will match the Forcing data
    • we need to set name so that XIOS reads correct dims (I believe dims are labelled [dim_name]_[domain_name] which means if we didn't change the name manually it would be the same as the domain id leading to x_era5 rather than x_dim
    • We need 2 domains because we need one for the Forcing file grid, and the second in theory matches the size of the nextsim grid... but... it has the interpolate property set to true, which would break the existing nextsim grids which don't need interpolation e.g., restart files and initialization files.
<domain id="era5" name="dim" ni_glo="3" nj_glo="5" type="rectilinear" />
<domain id="era5Interp" name="dim" type="rectilinear" /> <!-- details set at runtime -->

Test Description

  • XiosForcingInterpolation_test.cpp tests XIOS interpolation from a low resolution grid (from file) to the higher resolution grid (in the test)

Documentation Impact

To be completed


Other Details

N/A

Note: it is currently just a copy of `XiosReadForcing_test.cpp`.
@TomMelt TomMelt self-assigned this May 6, 2026
@TomMelt TomMelt added enhancement New feature or request ICCS Tasks or reviews for the ICCS team labels May 6, 2026
@TomMelt TomMelt force-pushed the add-interpolation branch from 4bd8f1a to 3391f26 Compare May 6, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ICCS Tasks or reviews for the ICCS team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XIOS: Support forcing files on different grids

1 participant