SciGroveBeta
Environment

An Ocean Model Ported by a Large Language Model: Experience and Lessons from FESOM2 (Fortran to C to C++/Kokkos)

Nikolay V. Koldunov, Suvarchal K. Cheedela, Sergey Danilov, Dmitry Sidorenko, Sebastian Beyer, Thomas Jung

Featured June 20, 2026

This analysis was generated by SciGrove. Upload your own PDFs or enter a DOI — and get the same AI breakdown on any paper.

Get started

AI-generated analysis — This is SciGrove's AI interpretation of the paper, not peer-reviewed content. Always refer to the original paper.

Simply

Scientists used an AI coding assistant to translate a huge Fortran ocean model into a modern C++/GPU version, making it run much faster on powerful new computers while keeping its science perfectly accurate through two careful translation steps and many checks.

In depth
The paper demonstrates that an LLM-assisted approach can successfully port a complex, production-grade geophysical model, FESOM2, from Fortran to a modern, GPU-capable C++/Kokkos framework. This was achieved by employing a two-stage translation process (Fortran to C, then C to C++/Kokkos) combined with a strict literal translation rule and a comprehensive tiered validation ladder to preserve scientific fidelity and achieve production-relevant performance on accelerators.

Key Takeaways

  • 1
    An LLM-assisted two-stage porting process (Fortran → C → C++/Kokkos) successfully translates a 74,000-line ocean model to GPUs while preserving physics.
  • 2
    Strict literal translation and a tiered validation ladder are crucial practices for ensuring scientific fidelity and debugging LLM-generated code.
  • 3
    The ported model achieves production-relevant speedups (1.6–3.7x faster on GPU) and demonstrates portability across diverse GPU architectures (NVIDIA, AMD).

Conceptual Flow

HIGH LEVEL
1
LLM-Assisted Two-Stage Code Porting

The paper's method uses an AI to first turn old code into a simple version, then makes that simple version work on new fast computers, checking carefully at each step.

Old Fortran Code
AI Translates
Clean C Code
GPU-Ready Code
2
Preserving Physics, Boosting Speed

The AI-translated ocean model runs much faster on new hardware like GPUs, without changing the science, making climate predictions quicker and more efficient.

Original Speed
Original Accuracy
New Code Runs
Much Faster Speed
Same High Accuracy