An Ocean Model Ported by a Large Language Model: Experience and Lessons from FESOM2 (Fortran to C to C++/Kokkos)
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) can translate and modify source code, and have been shown to do so for codes of different complexity. Whether they can port a complete, production geophysical model to a different language without degrading its physics has not been established. We demonstrate that LLM-assisted code translation can preserve the physics of a complete production ocean model while moving it into a modern performance-portable form. We report our experience using an agentic LLM coding assistant, directed by domain experts, to port the FESOM2 unstructured mesh ocean--sea-ice model (about 74000 lines of core Fortran) first to C and then to C++/Kokkos for performance portability across CPUs and GPUs. We describe the practices that proved necessary, what worked and what did not, and the failure modes that we encountered. Three practices mattered most: translating in two stages that separate reproducing the numerics (Fortran to a clean C reference) from introducing parallelism (C to Kokkos); requiring a strictly literal translation in which the assistant was not permitted to ``improve'' the source; and validating each stage against an acceptance criterion suited to it. The C port reproduces the original Fortran at the level of long-term simulation statistics over five years. The Kokkos port is bit-for-bit identical to the C reference on CPU and statistically close on GPU over multi-year runs. On eddy-rich meshes up to 7.4 million surface vertices a single A100 GPU node runs 1.6--3.7 times faster than a CPU node, reaching the 1-2 simulated-years-per-day required for production integrations. The result is more than a single GPU port: by following a clear validation procedure, an LLM moved a full Fortran ocean model into another language and onto accelerators while preserving its physics in a matter of weeks.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). First posted on arXiv 9 Jun 2026.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026A Fortran General-Purpose Transpiler: Proof of Conceptcited by 0
- 2026A Fortran General-Purpose Transpiler: Proof of Concept31 Jul 2026
Similar, not cited
Close in wording, no citation either way
- 2026Systematic LLM Translation of Legacy Scientific Code to Differentiable Frameworks: Application to a Land Surface Model
- 2026OceanPile: A Large-Scale Multimodal Ocean Corpus for Foundation Models
- 2025LLMComp: A Language Modeling Paradigm for Error-Bounded Scientific Data Compression (Technical Report)
- 2025LLM-Assisted Translation of Legacy FORTRAN Codes to C++: A Cross-Platform Study
- 2025Fine-tuning a Large Language Model for Automating Computational Fluid Dynamics Simulations
- 2026OceanCBM: A Concept Bottleneck Model for Mechanistic Interpretability in Ocean Forecasting
- 2025AtmosSci-Bench: Evaluating the Recent Advance of Large Language Model for Atmospheric Science
- 2026GRAIL: AI translation for scientists application workflow on satellite data