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

DevFeed: [Migrating a Legacy Scientific Application with an AI Coding Agent: NICAM from Fortran to Kokkos](<https://devfeed.tech/articles/migrating-a-legacy-scientific-application-with-an-ai-coding-agent-nicam-from-fortran-to-kokkos-111753.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.41313>)

Author: Xuanzhengbo Ren, Takashi Shimokawabe, Hisashi Yashiro

Published: 2026-11-02T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Distributed Computing](<https://devfeed.tech/sources/arxiv-distributed-computing.md>)

Topics: [Kokkos](<https://devfeed.tech/topics/kokkos.md>), [Fortran](<https://devfeed.tech/topics/fortran.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [legacy systems](<https://devfeed.tech/topics/legacy-systems.md>), [CUDA](<https://devfeed.tech/topics/cuda.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-coding](<https://devfeed.tech/tags/ai-coding.md>), [ai-coding-agent](<https://devfeed.tech/tags/ai-coding-agent.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [cs-dc](<https://devfeed.tech/tags/cs-dc.md>), [cuda](<https://devfeed.tech/tags/cuda.md>), [fortran](<https://devfeed.tech/tags/fortran.md>), [hip](<https://devfeed.tech/tags/hip.md>), [human-review](<https://devfeed.tech/tags/human-review.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [migration](<https://devfeed.tech/tags/migration.md>), [performance](<https://devfeed.tech/tags/performance.md>)

## AI overview

With Claude Code assistance and human review, the researchers ported NICAM's dynamical core and seven physics packages from about 140,000 lines of Fortran/OpenACC to 35,000 lines of C++/Kokkos. A 100-member ensemble comparison found the port statistically consistent with the original. Against the Fortran/OpenACC baseline on GH200, application speedups were 1.71x on GH200 and 1.54x on MI300A. The CUDA build's GPU kernel time was 1.38x faster on GH200; on MI300A, the HIP build reached 0.96x baseline kernel performance after peak-memory-bandwidth normalization. The reported results show application-level gains across both tested clusters, while normalized HIP kernel performance was near, but below, baseline.

## Source excerpt

arXiv:2610.41313v1 Announce Type: new Abstract: Migrating from Fortran to C++/Kokkos broadens access to hardware accelerators through backends such as CUDA and HIP while offering greater flexibility in software design. However, legacy Fortran applications often have large codebases, making manual porting time-consuming and costly. Recent advances in large language models (LLMs) and AI coding agents have made large-scale code migration increasingly feasible. In this study, we ported NICAM (Nonhydrostatic ICosahedral Atmospheric Model), a legacy Fortran climate model accelerated with OpenACC, to C++/Kokkos with the assistance of Claude Code. The agent translated the code directly from Fortran to C++/Kokkos under human review. Approximately 140,000 lines of Fortran were analyzed and ported into 35,000 lines of C++/Kokkos, covering the dynamical core and seven physics packages. A 100-member ensemble comparison with the original Fortran model showed that the port is statistically consistent with the original. Performance was evaluated on Miyabi-G, an NVIDIA GH200 cluster, and Sirius, an AMD MI300A cluster. Compared with the Fortran/OpenACC baseline on GH200, the port achieved application speedups of $1.71\times$ on GH200 and $1.54\times$ on MI300A. The CUDA build achieved a GPU kernel-time speedup of $1.38\times$ on GH200. After normalization by peak memory bandwidth, the HIP build on MI300A achieved $0.96\times$ the kernel performance of the Fortran/OpenACC baseline.