SciGroveBeta
Climate

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 15, 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, old ocean simulation program into a new, faster language that works on modern supercomputers, making sure the weather predictions stayed perfectly accurate.

In depth
The paper demonstrates that Large Language Models (LLMs) can reliably port a complex, production-grade geophysical ocean model (FESOM2) from legacy Fortran to modern, GPU-capable C++/Kokkos. This was achieved through a two-stage translation process (Fortran to C, then C to C++/Kokkos) combined with a rigorous tiered validation ladder that ensured scientific fidelity and performance portability without degrading the model's physics.

Key Takeaways

  • 1
    LLM-assisted porting of a 74,000-line Fortran ocean model to C++/Kokkos is feasible, preserving scientific fidelity.
  • 2
    A two-stage translation (Fortran C C++/Kokkos) and literal translation rule are crucial for debugging and accuracy.
  • 3
    A tiered validation ladder ensures bit-for-bit agreement on CPU and statistical closeness on GPU, achieving production-relevant performance (1-2 simulated-years-per-day).

Conceptual Flow

HIGH LEVEL
1
Two-Stage LLM-Assisted Code Porting

The paper used an AI helper to first turn old code into a clean middle version, then made that middle version work fast on new supercomputers.

Old Fortran Code
AI Translates
Clean C Code
Fast C++/Kokkos Code
2
Preserving Physics, Boosting Speed

The new code accurately matched the old one's ocean predictions and ran much faster on powerful graphics cards.

Old Code's Predictions
Old Code's Speed
New Code Matches & Accelerates
Same Accurate Predictions
Much Faster Speed