The reviewed record of science sign in
Pith

arxiv: 2606.11356 · v1 · pith:OYPSRYLX · submitted 2026-06-09 · physics.ao-ph · cs.DC· cs.SE· physics.comp-ph

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

Reviewed by Pith T0 review T1 audit T2 compute T3 formal T4 kernel 2026-06-27 10:33 UTCgrok-4.3pith:OYPSRYLXrecord.jsonopen to challenge →

classification physics.ao-ph cs.DCcs.SEphysics.comp-ph
keywords ocean modelcode portinglarge language modelsFortran translationperformance portabilityKokkosFESOM2GPU acceleration
0
0 comments X

The pith

An LLM ported a complete Fortran ocean model to C++/Kokkos while preserving its physics through two-stage literal translation and validation.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper demonstrates that an LLM, guided by domain experts, can translate the full FESOM2 ocean-sea-ice model (about 74,000 lines of Fortran) first to a clean C reference and then to C++/Kokkos for performance portability across CPUs and GPUs. The process relied on strictly literal translation without improvements, a two-stage separation of numerics reproduction from parallelism introduction, and validation against stage-specific criteria such as long-term simulation statistics over five years. This establishes that such porting can be completed in weeks while achieving bit-for-bit identity on CPU and statistical closeness on GPU, enabling production-level performance on accelerators. A sympathetic reader cares because legacy geophysical codes face hardware modernization challenges, and this shows a practical path that maintains physical fidelity.

Core claim

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. 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, delivering 1.6--3.7 times speedup on A100 GPU nodes for eddy-rich meshes up to 7.4 million surface vertices.

What carries the argument

The two-stage translation process separating reproduction of numerics (Fortran to clean C) from introduction of parallelism (C to Kokkos), enforced by strictly literal translation and stage-specific acceptance criteria.

If this is right

  • The C reference version matches the Fortran original in long-term statistics over five years of simulation.
  • The Kokkos version achieves bit-for-bit identity with the C reference when run on CPU.
  • On GPU the Kokkos version remains statistically close to the reference over multi-year integrations.
  • For meshes up to 7.4 million surface vertices a single A100 GPU node delivers 1.6 to 3.7 times the speed of a CPU node, reaching 1-2 simulated years per day.
  • The entire port of the 74,000-line core model was completed in weeks using the described practices.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • The same staged literal-translation-plus-validation workflow could shorten porting times for other large legacy codes in ocean and climate modeling.
  • If the statistical equivalence holds for common metrics but not for tail events, additional targeted tests on extremes would be needed before production use.
  • The separation of numerics fidelity from parallelism introduction may generalize to ports involving other accelerator languages beyond Kokkos.

Load-bearing premise

That matching long-term simulation statistics over five years plus bit-for-bit identity on CPU and statistical closeness on GPU is enough to ensure all physical behaviors, including rare or extreme events, stay unchanged after the translation.

What would settle it

A multi-year simulation on the same mesh and forcing where a specific rare extreme event, such as an unusual eddy trajectory or sea-ice breakup pattern, occurs differently in the Kokkos version compared to the original Fortran despite overall statistics matching.

Figures

Figures reproduced from arXiv: 2606.11356 by Dmitry Sidorenko, Nikolay V. Koldunov, Sebastian Beyer, Sergey Danilov, Suvarchal K. Cheedela, Thomas Jung.

Figure 1
Figure 1. Figure 1: The two-stage porting workflow. Fortran is translated to a clean C reference (stage 1) [PITH_FULL_IMAGE:figures/full_fig_p008_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: The validation ladder; green tiers are bit-identical, orange tiers statistically close. A [PITH_FULL_IMAGE:figures/full_fig_p009_2.png] view at source ↗
Figure 3
Figure 3. Figure 3: Five-year-mean (1958–1962) difference, C port minus the Fortran reference, in sea [PITH_FULL_IMAGE:figures/full_fig_p009_3.png] view at source ↗
Figure 4
Figure 4. Figure 4: Five-year (1958–1962) difference, C port minus the Fortran reference. (a) global [PITH_FULL_IMAGE:figures/full_fig_p010_4.png] view at source ↗
Figure 5
Figure 5. Figure 5: Time per step for the five implementations across the four meshes (log–log. [PITH_FULL_IMAGE:figures/full_fig_p012_5.png] view at source ↗
Figure 6
Figure 6. Figure 6: Node-for-node Kokkos-GPU / Kokkos-CPU step-time ratio (below one means the GPU [PITH_FULL_IMAGE:figures/full_fig_p013_6.png] view at source ↗
Figure 7
Figure 7. Figure 7: The single Kokkos source on the NG5 mesh (7.4 million surface vertices), run unchanged [PITH_FULL_IMAGE:figures/full_fig_p014_7.png] view at source ↗
read the original abstract

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.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

1 major / 0 minor

Summary. The paper reports the LLM-assisted port of the full FESOM2 unstructured-mesh ocean–sea-ice model (~74 000 lines of core Fortran) first to a clean C reference and then to C++/Kokkos. A two-stage, strictly literal translation workflow is used, with stage-specific acceptance criteria: the C port reproduces the original Fortran on five-year bulk simulation statistics; the Kokkos port is bit-for-bit identical to the C reference on CPU and statistically close on GPU over multi-year runs. On meshes up to 7.4 million surface vertices the Kokkos version achieves 1.6–3.7× speedup on a single A100 GPU node relative to a CPU node, reaching production-relevant throughput.

Significance. If the reported validation holds, the work supplies a documented, reproducible example that an LLM, when directed by domain experts under a literal-translation discipline and explicit acceptance tests, can move an entire production geophysical model into a performance-portable language while preserving the tested aspects of its physics. The explicit enumeration of practices that succeeded (two-stage separation, literal translation, criterion-matched validation) and the concrete performance numbers on eddy-rich meshes constitute a practical contribution to the community facing legacy Fortran codes in climate modeling.

major comments (1)
  1. [Validation procedure / results] Validation criteria (abstract and results sections): the acceptance tests are limited to five-year means/variances for the C port and multi-year statistical closeness for Kokkos. Because ocean models are chaotic, these bulk statistics do not necessarily detect discrepancies that appear only in the tails of distributions or in infrequent regimes (extreme sea-ice loss, deep convection). The manuscript should either add extreme-value or process-specific diagnostics or explicitly qualify the claim of “preserving its physics” to the tested statistics.

Simulated Author's Rebuttal

1 responses · 0 unresolved

We thank the referee for the positive evaluation and the constructive comment on validation. We address the point directly below.

read point-by-point responses
  1. Referee: [Validation procedure / results] Validation criteria (abstract and results sections): the acceptance tests are limited to five-year means/variances for the C port and multi-year statistical closeness for Kokkos. Because ocean models are chaotic, these bulk statistics do not necessarily detect discrepancies that appear only in the tails of distributions or in infrequent regimes (extreme sea-ice loss, deep convection). The manuscript should either add extreme-value or process-specific diagnostics or explicitly qualify the claim of “preserving its physics” to the tested statistics.

    Authors: We agree that bulk statistics over five-year integrations cannot guarantee detection of discrepancies confined to distribution tails or infrequent regimes in a chaotic system. The manuscript already frames the C-port result as reproducing the Fortran 'at the level of long-term simulation statistics over five years' and the Kokkos port as 'statistically close on GPU over multi-year runs.' We will revise the abstract and the final paragraph of the conclusions to state explicitly that physics preservation is demonstrated only for the tested long-term bulk statistics. Adding dedicated extreme-value or process-specific diagnostics (e.g., sea-ice extent tails or convection indices) would require new multi-decadal ensembles and analysis outside the scope of documenting the LLM-assisted porting workflow; we therefore choose the qualification route rather than expanding the validation suite. revision: partial

Circularity Check

0 steps flagged

No circularity: empirical validation against independent Fortran reference

full rationale

The paper is an experience report on LLM-assisted porting of FESOM2, not a derivation. The claim that physics is preserved is supported by direct empirical comparisons (long-term statistics over five years for the C port; bit-for-bit CPU identity and statistical closeness on GPU for Kokkos) against the original Fortran code. No equations, fitted parameters renamed as predictions, self-definitional constructs, or load-bearing self-citations appear in the provided text. The validation procedure is external to the ported code itself and does not reduce to the inputs by construction.

Axiom & Free-Parameter Ledger

0 free parameters · 0 axioms · 0 invented entities

The central claim rests on the assumption that the chosen validation metrics (long-term statistics and bit-for-bit identity) are adequate proxies for physics preservation, and that the LLM can be constrained to literal translation without introducing undetected numerical changes. No free parameters, axioms, or invented entities are introduced.

pith-pipeline@v0.9.1-grok · 5911 in / 1237 out tokens · 27691 ms · 2026-06-27T10:33:21.432351+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 1 Pith paper

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Machine learning is revolutionizing weather forecasting -- the next step is a change in how we work

    physics.ao-ph 2026-06 unverdicted novelty 3.0

    Machine learning success in weather prediction will drive changes in development practices, data handling, verification, and service creation at weather centers.

Reference graph

Works this paper leans on

31 extracted references · 4 canonical work pages · cited by 1 Pith paper

  1. [1]

    Geoscientific Model Development , year =

    Danilov, Sergey and Sidorenko, Dmitry and Wang, Qiang and Jung, Thomas , title =. Geoscientific Model Development , year =

  2. [2]

    and Aizinger, Vadym and Rakowsky, Natalja and Scholz, Patrick and Sidorenko, Dmitry and Danilov, Sergey and Jung, Thomas , title =

    Koldunov, Nikolay V. and Aizinger, Vadym and Rakowsky, Natalja and Scholz, Patrick and Sidorenko, Dmitry and Danilov, Sergey and Jung, Thomas , title =. Geoscientific Model Development , year =

  3. [3]

    Geoscientific Model Development , year =

    Scholz, Patrick and Sidorenko, Dmitry and Gurses, Ozgur and Danilov, Sergey and Koldunov, Nikolay and Wang, Qiang and Sein, Dmitry and Smolentseva, Margarita and Rakowsky, Natalja and Jung, Thomas , title =. Geoscientific Model Development , year =

  4. [4]

    and Lebrun-Grand

    Trott, Christian R. and Lebrun-Grand. IEEE Transactions on Parallel and Distributed Systems , year =

  5. [5]

    Carter and Trott, Christian R

    Edwards, H. Carter and Trott, Christian R. and Sunderland, Daniel , title =. Journal of Parallel and Distributed Computing , year =

  6. [6]

    and Scogland, Thomas R

    Beckingsale, David A. and Scogland, Thomas R. W. and Burmark, Jason and Hornung, Rich and Jones, Holger and Killian, William and Kunen, Adam J. and Pearce, Olga and Robinson, Peter and Ryujin, Brian S. , title =. 2019 IEEE/ACM International Workshop on Performance, Portability and Productivity in HPC (P3HPC) , year =

  7. [7]

    and Sawyer, William and Lapillonne, Xavier and Adamidis, Panagiotis and Alexeev, Dmitry and Cl

    Giorgetta, Marco A. and Sawyer, William and Lapillonne, Xavier and Adamidis, Panagiotis and Alexeev, Dmitry and Cl. The. Geoscientific Model Development , year =

  8. [8]

    Operational numerical weather prediction with

    Lapillonne, Xavier and Hupp, Daniel and Gessler, Fabian and Walser, Andr. Operational numerical weather prediction with. Geoscientific Model Development , year =

  9. [9]

    and Appleyard, Jeremy and Ashworth, Mike and Ford, Rupert W

    Porter, Andrew R. and Appleyard, Jeremy and Ashworth, Mike and Ford, Rupert W. and Holt, Jason and Liu, Hedong and Riley, Graham D. , title =. Geoscientific Model Development , year =

  10. [10]

    IEEE Access , year =

    Jiang, Jinrong and Lin, Pengfei and Wang, Joey and Liu, Hailong and Chi, Xuebin and Hao, Huiqun and Wang, Yuzhu and Wang, Wu and Zhang, Linghan , title =. IEEE Access , year =

  11. [11]

    Caldwell, P. M. and Terai, C. R. and Hillman, B. and Keen, N. D. and Bogenschutz, P. and Lin, W. and Beydoun, H. and Taylor, M. and Bertagna, L. and Bradley, A. M. and others , title =. Journal of Advances in Modeling Earth Systems , year =

  12. [12]

    Donahue, A. S. and Caldwell, P. M. and Bertagna, L. and Beydoun, H. and Bogenschutz, P. A. and Bradley, A. M. and Clevenger, T. C. and Foucar, J. and Golaz, C. and Guba, O. and others , title =. Journal of Advances in Modeling Earth Systems , year =

  13. [13]

    and Asay-Davis, Xylar S

    Petersen, Mark R. and Asay-Davis, Xylar S. and Barthel, Alice M. and Begeman, Carolyn Branecky and Bishnu, Siddhartha and Brus, Steven R. and Jones, Philip W. and Kang, Hyun-Gyu and Kim, Youngsung and Mametjanov, Azamat and O'Neill, Brian J. and Overfelt, James R. and Ringel, Kieran K. and Smith, Katherine M. and Sreepathi, Sarat and Van Roekel, Luke P. a...

  14. [14]

    and Jacobsen, Doug and Jones, Philip W

    Ringler, Todd and Petersen, Mark and Higdon, Robert L. and Jacobsen, Doug and Jones, Philip W. and Maltrud, Mathew , title =. Ocean Modelling , year =

  15. [15]

    Geoscientific Model Development , year =

    H. Geoscientific Model Development , year =

  16. [16]

    Journal of Open Source Software , year =

    Ramadhan, Ali and Wagner, Gregory and Hill, Chris and Campin, Jean-Michel and Churavy, Valentin and Besard, Tim and Souza, Andre and Edelman, Alan and Ferrari, Raffaele and Marshall, John , title =. Journal of Open Source Software , year =

  17. [17]

    Unsupervised Translation of Programming Languages , booktitle =

    Rozi. Unsupervised Translation of Programming Languages , booktitle =. 2020 , note =

  18. [18]

    International Conference on Learning Representations , volume=

    Swe-bench: Can language models resolve real-world github issues? , author=. International Conference on Learning Representations , volume=

  19. [19]

    and Kucer, Michal and Biswas, Ayan and O'Malley, Daniel and Most, Alexander and Wanna, Selma Liliane and Sreekumar, Ajay , title =

    Ranasinghe, Nishath Rajiv and Jones, Shawn M. and Kucer, Michal and Biswas, Ayan and O'Malley, Daniel and Most, Alexander and Wanna, Selma Liliane and Sreekumar, Ajay , title =. Proceedings of the 1st Workshop on AI and Scientific Discovery , year =

  20. [20]

    arXiv preprint arXiv:2412.19770 , year =

    Chen, Le and Lei, Bin and Zhou, Dunzhi and Lin, Pei-Hung and Liao, Chunhua and Ding, Caiwen and Jannesari, Ali , title =. arXiv preprint arXiv:2412.19770 , year =

  21. [21]

    Baker, A. H. and Hammerling, D. M. and Levy, M. N. and Xu, H. and Dennis, J. M. and Eaton, B. E. and Edwards, J. and Hannay, C. and Mickelson, S. A. and Neale, R. B. and Nychka, D. and Shollenberger, J. and Tribbia, J. and Vertenstein, M. and Williamson, D. , title =. Geoscientific Model Development , year =

  22. [22]

    Doblas-Reyes, F. J. and Kontkanen, J. and Sandu, I. and Acosta, M. and Al Turjmam, M. H. and Alsina-Ferrer, I. and Andr\'es-Mart\'. The. Geoscientific Model Development , VOLUME =. 2026 , NUMBER =

  23. [23]

    Journal of the European Meteorological Society , volume =

    Implementing digital twin technology of the earth system in. Journal of the European Meteorological Society , volume =. 2025 , issn =. doi:https://doi.org/10.1016/j.jemets.2025.100015 , author =

  24. [24]

    Earth System Dynamics , volume=

    Earth's future climate and its variability simulated at 9 km global resolution , author=. Earth System Dynamics , volume=. 2025 , publisher=

  25. [25]

    and Pedruzo-Bagazgoitia, X

    Segura, H. and Pedruzo-Bagazgoitia, X. and Weiss, P. and M\"uller, S. K. and Rackow, T. and Lee, J. and Dolores-Tesillos, E. and Benedict, I. and Aengenheyster, M. and Aguridan, R. and Arduini, G. and Baker, A. J. and Bao, J. and Bastin, S. and Baulenas, E. and Becker, T. and Beyer, S. and Bockelmann, H. and Br\"uggemann, N. and Brunner, L. and Cheedela, ...

  26. [26]

    Toward modern

    Curcic, Milan and. Toward modern. arXiv preprint arXiv:2109.07382 , year=

  27. [27]

    Many cores, many models:

    Herten, Andreas , booktitle=. Many cores, many models:

  28. [28]

    and Urakawa, L

    Tsujino, H. and Urakawa, L. S. and Griffies, S. M. and Danabasoglu, G. and Adcroft, A. J. and Amaral, A. E. and Arsouze, T. and Bentsen, M. and Bernardello, R. and B\"oning, C. W. and Bozec, A. and Chassignet, E. P. and Danilov, S. and Dussin, R. and Exarchou, E. and Fogli, P. G. and Fox-Kemper, B. and Guo, C. and Ilicak, M. and Iovino, D. and Kim, W. M. ...

  29. [29]

    Overview of the

    Eyring, Veronika and Bony, Sandrine and Meehl, Gerald A and Senior, Catherine A and Stevens, Bjorn and Stouffer, Ronald J and Taylor, Karl E , journal=. Overview of the. 2016 , publisher=

  30. [30]

    John, Amal and Beyer, Sebastian and Athanase, Marylou and Sánchez-Benítez, Antonio and Goessling, Helge F. and Hossain, Akil and Aguridan, Razvan and Andrés-Martínez, Miguel and Gaya-Àvila, Aina and Cheedela, Suvarchal Kumar and Geier, Philipp and Ghosh, Rohit and Hadade, Ioan and Koldunov, Nikolay and Milinski, Sebastian and Nurisso, Matteo and Pedruzo-B...

  31. [31]

    2025 , type =

    Ehlert, Iris and Bockelmann, Hendryk and Feulner, Georg and Hoffmann, Lars and Hoose, Corinna and Jung, Thomas and Kollet, Stefan and Nowack, Peer and Potthast, Roland and Rehfeld, Kira and Schmidt, Hauke and Tegen, Ina and Zaehle, S. 2025 , type =