A EN arXiv·Paper·

Migrating a Legacy Scientific Application with an AI Coding Agent: NICAM from Fortran to Kokkos

A · Strong evidence University of Tokyo and NIES researchers report an application-scale port of a production climate model with ensemble-based correctness testing, measured speedups on two GPU platforms, and full token cost and human instruction counts; one case, but unusually complete.

Summary based on the full text·Original: about 35 minutes to read

One of the Library's top reads

In short

A preprint (arXiv, 30 October 2026) by Xuanzhengbo Ren and Takashi Shimokawabe (University of Tokyo) and Hisashi Yashiro (National Institute for Environmental Studies, Japan). They used Claude Code, mostly with Fable 5, to port NICAM, a production atmospheric model accelerated with OpenACC, from Fortran to C++/Kokkos so it runs on both NVIDIA and AMD GPUs. The agent wrote all the C++ model code; humans set scope, reviewed plans and checked progress. Two 100-member ensembles show the port is statistically consistent with the original, and it runs faster on both platforms.

Key numbers

  • 140,000 to 35,000lines of Fortran ported into lines of C++/Kokkos by Claude Code under human review
  • 1.71× and 1.54×application speedup over the Fortran/OpenACC baseline on NVIDIA GH200 and AMD MI300A
  • 95.3%member-quantity scores within |z| ≤ 2 in both 100-member ensembles across 59 quantities
  • USD 5,589estimated API list-price cost of all tokens used over 23 active days
  • 797human instructions sent to the agent, with 6,007 assistant messages in reply

As reported by the source.

Read the original on arxiv.org

English·Web page·opens arxiv.org

What it reports

  • The port covers the dynamical core and seven physics packages of the selected production configuration.
  • Across 5,900 member-quantity scores per ensemble, 95.3% fall within two standard deviations in both implementations.
  • Application time over 120 steps: 81.0 s for Fortran/OpenACC on GH200, 47.3 s for Kokkos/CUDA on GH200, 52.6 s for Kokkos/HIP on MI300A.
  • GPU kernel-time speedups were 1.38× (CUDA) and 1.27× (HIP); normalised by memory bandwidth, the HIP build reached 96% of the Fortran baseline.
  • Token use: 12.13 million output tokens and 3.88 billion cache-read tokens, about USD 5,589 at list prices, under a subscription.
  • A surface-temperature initialisation error passed component tests and was caught only in integrated runs.
  • The main constraints were human review speed and the subscription's five-hour usage limits; the agent produced code faster than people could inspect it.

How they got it

Module-by-module translation with the Fortran code as numerical reference, structure kept for comparison. Three verification tiers: component tests against dumped Fortran inputs, short integration checks, and an ensemble consistency test scoring 59 quantities over model days 5-10 with leave-one-out statistics. Performance measured on the Miyabi-G (GH200) and Sirius (MI300A) clusters. Token counts and instruction counts were extracted from session logs; human hours were not recorded.

Limits

  • One application, which the authors describe as well structured with consistent data layouts; messier legacy code may port less smoothly.
  • Human effort is proxied by instruction count; days of review outside the agent sessions are not counted.
  • Unit tests cover a limited set of inputs and no systematic boundary cases.
  • MI300A performance still needs architecture-specific tuning.

Why it matters for companies

This is a costed, verified example of agent-assisted modernisation of a large legacy codebase: about USD 5,600 in tokens over 23 active days, with the result checked statistically against the original. The bottleneck was human review, not code generation. Firms with legacy Fortran, COBOL or similar estates should budget review capacity and reference-based tests first, and treat token cost as minor by comparison.

Summary based on the full text. Read the original for the full argument and data.Read the original on arxiv.org

Tags

Same week

All of Week 44