scieee AI-readable full text Open interactive document viewer

Integrating XIOS into the nextSIM-DG next-generation sea ice model

Wallwork, Joseph G.

Abstract

nextSIM-DG is a next-generation sea-ice model written in C++, developed as part of the Scale-Aware Sea Ice Project (SASIP). This poster documents our team's work on integrating the XIOS (XML input-ouput server) library into nextSIM-DG, giving it the ability to read and write to files in an asynchronous, parallel and efficient manner. Whilst XIOS is written in C++, its primary user base is the climate modelling community, who typically couple to it through a Fortran interface. We evaluate the benefits brought by this integration, as well as discussing the challenges associated with such coupling efforts. These challenges include implementing new backends within code bases of considerable size, deciding how much of the library to integrate, and coupling to codes in an unintended manner.

Full text

L A T EXTikZposter Integrating XIOS into the nextSIM-DG next-generation sea ice model Joe Wallwork1, Tom Meltzer1, Tim Spain2, Marion Weinzierl1, Einar ´ Olason2 1Institute of Computing for Climate Science, University of Cambridge, U.K. 2Nansen Environmental and Remote Sensing Center, Bergen, Norway Integrating XIOS into the nextSIM-DG next-generation sea ice model Joe Wallwork1, Tom Meltzer1, Tim Spain2, Marion Weinzierl1, Einar ´ Olason2 1Institute of Computing for Climate Science, University of Cambridge, U.K. 2Nansen Environmental and Remote Sensing Center, Bergen, Norway Overview nextSIM-DG is developed as part of the Scale-Aware Sea Ice Project (SASIP). One of the main differences between nextSIM-DG and its predecessor – neXtSIM – is that it uses discontinuous Galerkin (DG) methods to better capture fractures in sea ice than with continuous elements. Ice concentration for different discontinuous finite element spaces. Image credit: Richter et al. (2023). XIOS provides a server-based approach for efficient input/output (I/O), which may be configured either using XML files or with API calls. It supports asynchronous I/O, as well as the NetCDF and HDF5 data formats commonly used by the geoscientific modelling community. Coupling to XIOS Both nextSIM-DG and XIOS are written in C++. Should be straightforward, right? Not quite. •XIOS’ primary user base is the weather and climate modelling community, whose codes are mostly written in Fortran. XIOS provides C bindings and a Fortran interface built from these using iso_c_binding. •Whilst we could make calls to XIOS’ C++ API directly in nextSIM-DG, there is a risk that code which isn’t in the public C interface might change, especially given the planned major version upgrade to XIOS3. •Our approach is to wrap the C bindings in nextSIM-DG. Coupling more generally Coupling geoscience models Earth system modelling requires coupling different model components together (e.g., ocean and atmosphere models). This often involves different grids, making it important to choose appropriate interpolation methods. Interpolation between model components can be achieved with OASIS. Tripolar and bipolar grids over the Northern Hemisphere. Image credit: Winkelbauer, et al. “StraitFlux–Precise computations of Water Strait fluxes on various Modelling Grids.” EGUsphere 2024 (2024): 1-26. Data considerations •Even if grids match, data is an important consideration. A sub-optimal implementation might copy data unnecessarily between grids =⇒pass pointers where possible. •Integrating tools directly into model data structures can be difficult. We found it simpler to map strings and arrays from XIOS’ C interface to C++ std::strings and std::vectors before wrapping in nextSIM-DG syntax. Summary Challenges •(Unexpected) multi-language problem. •Unintended usage. •How much of the API should we wrap? Key lessons •Use public interfaces where possible. •Avoid unnecessary copies / modify data in-place. •Start with standard data types before integrating model data types. References •Richter, et al. “The neXtSIM-DG dynamical core: A Framework for Higher-order Finite Element Sea Ice Modeling.” EGUsphere 2023 (2023): 1-31. •nextSIM-DG: github.com/nextsimhub/nextsimdg •XIOS: forge.ipsl.jussieu.fr/ioserver/wiki •OASIS: oasis.cerfacs.fr/en/home Acknowledgements This project is supported by Schmidt Sciences, LLC.