Papers
Topics
Authors
Recent
Search
2000 character limit reached

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

Published 30 Oct 2026 in cs.DC | (2610.41313v1)

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 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×1.71\times on GH200 and 1.54×1.54\times on MI300A. The CUDA build achieved a GPU kernel-time speedup of 1.38×1.38\times on GH200. After normalization by peak memory bandwidth, the HIP build on MI300A achieved 0.96×0.96\times the kernel performance of the Fortran/OpenACC baseline.

Summary

  • The paper demonstrates the feasibility of migrating a complex scientific application, NICAM, from Fortran/OpenACC to C++/Kokkos using an AI coding agent, resulting in a 1.71× application speedup on GH200.
  • The migration process involved iterative testing and human oversight, with a robust verification protocol ensuring numerical consistency and performance improvements, achieving 140,000 lines of code converted.
  • This study highlights the role of human supervision and architecture-aware performance tuning, as well as the need for further optimization and comprehensive testing for broader applications.

The paper examines whether an AI coding agent can support the application-scale migration of a mature scientific code from Fortran/OpenACC to C++/Kokkos without sacrificing numerical behavior or accelerator performance. The case study is NICAM, the Nonhydrostatic Icosahedral Atmospheric Model, whose development spans more than two decades and combines a nonhydrostatic atmospheric dynamical core with coupled physical parameterizations. The authors use Claude Code, primarily with the Fable 5 model, as a code-generation and software-engineering agent under continuous human direction and review (2610.41313).

The central claim is deliberately narrower than autonomous software development: a coding agent can perform a substantial direct Fortran-to-Kokkos migration, but only within a workflow that constrains scope, exposes numerical references, enforces iterative compilation and testing, and retains human responsibility for architectural and scientific validation. The resulting port covers approximately 140,000 analyzed lines of Fortran and produces approximately 35,000 lines of C++/Kokkos model source. It includes the dynamical core and seven physics packages: NSW6 cloud microphysics, MSTRNX radiation, Louis surface fluxes, MYNN2 turbulence, McFarlane orographic gravity-wave drag, MATSIRO land-surface processes, and a mixed-layer ocean with sea ice.

Application and migration objectives

NICAM is an appropriate stress test for agent-assisted migration because its computational structure is heterogeneous. The code contains numerical operators, nonhydrostatic dynamics, communication routines, state management, initialization and restart infrastructure, and physical parameterizations with distinct data dependencies. Its original accelerator implementation uses OpenACC, while the target implementation uses Kokkos execution policies, Kokkos::View data structures, and CUDA and HIP backends.

The migration pursued three objectives. First, it sought to obtain a standalone C++/Kokkos implementation rather than a transitional mixed-language executable. Second, it aimed to retain enough of the original organization that corresponding Fortran and C++ components remained identifiable during verification and maintenance. Third, it evaluated whether the common Kokkos implementation could execute effectively on NVIDIA GH200 and AMD MI300A systems.

The target application replaces Fortran namelists with YAML configuration parsed through the header-only fkYAML library. It retains the selected physics-package identifiers and rejects unported configuration branches explicitly. This is an important engineering choice: the port is not presented as a complete translation of every NICAM capability, but as a production configuration with a clearly delimited supported feature set.

Human-directed agentic workflow

The workflow is organized as an iterative milestone process. The human first defines the objective, environmental constraints, file-access rules, build requirements, and numerical assumptions. Claude Code then inspects the Fortran source in planning mode, proposes a dependency-aware migration plan, and records the plan in a progress document. Development proceeds module by module only after the human approves the plan.

The agent translates Fortran modules into C++ classes within the nicam namespace. Model state is represented by Kokkos Views owned by class instances, making data lifetime explicit. Before device execution, shallow local View handles are captured by value in KOKKOS_LAMBDA bodies rather than capturing host-side objects or pointers. This design corresponds well to Kokkos’s host/device execution model and also enables isolated unit tests in which only the objects required by a routine are instantiated.

The translation maps Fortran modules and implicit use-based dependencies to explicit C++ interfaces. OpenACC compute regions become Kokkos::parallel_for calls, Fortran arrays become Views, and nested loops are expressed through multidimensional execution policies. Kokkos::LayoutLeft preserves the original Fortran-oriented memory ordering, with the horizontal index contiguous in memory. The implementation also uses C++ templates to reduce duplication between single- and double-precision variants, although the reported experiments use double precision.

The agent used existing OpenACC annotations as evidence about parallel regions and data movement, but the authors did not treat source directives as authoritative optimization specifications. In one example, the agent attempted to carry Fujitsu-specific prefetching directives into the new implementation. Those changes were removed because they were not justified by the intended initial port. This episode demonstrates that source annotations can guide translation while still requiring semantic interpretation and architectural review.

The workflow’s strongest feature is its separation of translation from acceptance. Each milestone requires component-level tests, regression testing against previously translated components, short integrated runs, and human review of source organization and call order. The agent generated code and tests, but the human reviewed structural decisions and numerical results. The paper reports that code generation generally proceeded faster than human inspection, making review capacity rather than translation capacity the practical bottleneck.

Layered numerical verification

The validation protocol contains three tiers designed to address different failure modes.

The first tier uses reference dumps generated by the original Fortran implementation. Before translating a routine, the authors save its inputs and outputs from a reference execution. The corresponding C++/Kokkos test supplies the same inputs and compares the translated outputs against the saved results. The default criterion is a relative error no larger than 10−1310^{-13} or an absolute error no larger than 10−1210^{-12}; many quantities agree at approximately 10−1510^{-15}. Exceptions are permitted for ill-conditioned intermediate quantities, but their downstream effects must still satisfy strict checks.

This procedure provides rapid feedback for local translation errors, but it cannot validate the production dataflow by itself. The paper gives a concrete failure case: all unit tests for the physics packages passed, yet an integrated run showed a systematic discrepancy in surface downward longwave radiation. The unit test supplied surface temperature directly from a reference dump, whereas the coupled model had to reconstruct that temperature during initialization. The translated code omitted this reconstruction. Thus, routine-level testing had bypassed an error in the producer of a routine’s inputs. The integrated test exposed and enabled correction of the defect.

The second tier therefore compares 30- or 60-step coupled model runs with the Fortran reference. It examines model fields together with energy and mass budgets, initialization, coupling, and repeated execution. This tier is particularly important for a legacy climate model because correctness depends not only on the local algebra of a routine but also on the ordering and coupling of state transformations.

The third tier addresses the fact that chaotic atmospheric simulations should not be expected to remain trajectory-identical after small floating-point perturbations. The authors generated two 100-member ensembles by applying independent uniform temperature perturbations in the interval [−10−10,10−10][-10^{-10},10^{-10}] K to identical initial states. Each implementation used the same perturbed initial states and ran for 10 model days. Diagnostics were summarized over model days 5–10 and compared through zz-scores computed relative to the Fortran ensemble.

Across 59 quantities, including energy and mass budgets, surface fluxes, and global means and standard deviations of atmospheric fields, the two implementations showed strong distributional agreement. Of the 5,900 member–quantity scores in each ensemble, 95.3% fell within ∣z∣≤2|z| \leq 2 for both implementations. The median number of quantities outside this interval was two per member in each ensemble. These results support statistical consistency for the tested configuration and time horizon, rather than bitwise identity or universal physical equivalence.

The qualification is important. The ensemble procedure is inspired by CESM ensemble-consistency testing but does not implement the full principal-component-based acceptance procedure. The simulations cover only 10 days, the diagnostics are restricted to 59 quantities, and the unit-test inputs are not claimed to cover boundary cases systematically. The results therefore establish evidence of consistency, not an exhaustive correctness proof.

Performance portability and measured speedups

Performance evaluation used Miyabi-G, equipped with an NVIDIA GH200, and Sirius, equipped with AMD MI300A accelerators. The Kokkos implementation was compiled with CUDA on GH200 and HIP on MI300A. The Fortran/OpenACC baseline was evaluated on GH200 using NVIDIA’s Fortran compiler and OpenACC support.

For a 120-step run of the gl07rl00Az78 configuration, the Fortran/OpenACC baseline required 81.0 seconds. The CUDA Kokkos build required 47.3 seconds on GH200, while the HIP build required 52.6 seconds on MI300A.

Implementation Platform Application time Speedup relative to Fortran/GH200
Fortran/OpenACC GH200 81.0 s 1.00×
Kokkos/CUDA GH200 47.3 s 1.71×
Kokkos/HIP MI300A 52.6 s 1.54×

The 1.71× application speedup on GH200 and 1.54× speedup on MI300A are stronger than the kernel-only improvements because the Kokkos implementation reduces staging and synchronization overhead. The original Fortran implementation repeatedly gathers state from global arrays into per-region work arrays and uses explicit OpenACC waits at those boundaries. The port instead retains prognostic state in device-resident full-domain arrays and performs more operations in place.

Kernel-level measurements provide a more controlled comparison. Accumulated GPU kernel execution time per model step was 441.6 ms for Fortran/OpenACC, 320.6 ms for Kokkos/CUDA on GH200, and 349.1 ms for Kokkos/HIP on MI300A. These correspond to kernel-time speedups of 1.38× and 1.27×, respectively.

The largest GH200 reductions occur in the dynamical core, where the kernel-time contribution decreases from 243.3 to 178.9 ms per step. The port also reduces “get/set variables” time from 15.3 to 4.3 ms and surface-flux/turbulence time from 58.8 to 28.5 ms. The latter improvement follows fusion of adjacent computations, which reduces launch and intermediate-memory overhead but produces larger kernels that may be more difficult to inspect and maintain. Performance is not uniformly improved: the amortized MSTRNX radiation cost increases from 41.9 to 46.3 ms on GH200.

The results also expose the distinction between portability and portability without tuning. The MI300A has higher nominal peak memory bandwidth and FP64 throughput than the GH200, yet its unnormalized application and kernel times are slower. The HIP build reuses CUDA-oriented MDRange tile sizes, which the authors identify as a likely source of inefficiency. After normalizing by peak memory bandwidth, the MI300A HIP kernel performance is approximately 96% of the Fortran/OpenACC baseline on GH200. The paper also reports that the HIP build achieves approximately 70% of the CUDA Kokkos kernel performance after bandwidth normalization. These comparisons suggest that the shared implementation is viable across architectures, but not yet equivalently tuned for each backend.

Strong-scaling experiments on GH200 show that the Kokkos implementation remains faster over the tested ranges. For the 40-region, approximately 56-km configuration, increasing from one to ten nodes reduces Fortran execution time from 0.623 to 0.087 seconds per step and Kokkos execution time from 0.348 to 0.060 seconds per step. For the 640-region, approximately 14-km configuration, increasing from 16 to 40 GPUs reduces the corresponding times from 0.706 to 0.353 seconds and from 0.381 to 0.182 seconds. Both implementations depart from ideal scaling as local workload decreases, with a larger relative departure for Kokkos in the 40-region case. The port therefore preserves a performance advantage while exposing communication and launch overheads at smaller per-device workloads.

Agent consumption and human effort

The recorded agent usage totals 4.0248 billion tokens, with an estimated API list-price equivalent of approximately USD 5,589. Cache reads account for 96.5% of tokens and approximately 55.4% of the estimated cost; cache writes account for 3.2% of tokens and 33.8% of cost. The workflow generated 12.13 million output tokens over 23 active days.

The authors recorded 797 human instructions and 6,007 assistant messages, or an average of 7.5 assistant messages per instruction. These measurements include porting, code review, verification, test-kit generation, plotting, and data analysis. They do not represent total human labor: time spent exclusively on code review or cluster operations was not recorded. Consequently, the cost estimate is an accounting of agent consumption rather than a complete cost-benefit analysis of migration.

The paper also reports practical interruptions caused by subscription usage limits. The agent could generate implementation changes faster than the human could review them, and pauses sometimes raised concerns about whether sufficient context would be available when work resumed. The authors explicitly caution that the instruction counts reflect a conservative first application-scale workflow, including repeated requests for confirmation that might be reduced in a more mature process.

Limitations and open questions

The port does not cover all NICAM components or configuration branches. It targets one selected production configuration, and the unsupported branches are rejected rather than translated. The correctness evidence is correspondingly configuration-specific. The ensemble test covers 100 members per implementation and 10 model days, with diagnostics evaluated over days 5–10. It does not establish consistency for longer climate integrations, alternative resolutions, different physics selections, or data-assimilation workflows.

The component tests also rely on a limited collection of dumped reference inputs. As the initialization error demonstrates, direct routine comparison can miss defects in upstream data production and coupled execution. More systematic boundary-condition coverage is required before the testing strategy can support stronger claims about the complete application.

Performance portability remains incomplete. The HIP build inherits CUDA tile sizes, and the authors have not yet determined whether the remaining MI300A gap arises primarily from execution-policy choices, multidimensional index calculations, conditional branches, or other implementation details. Kernel fusion improves performance in some subsystems but can reduce readability and complicate maintenance. The paper therefore leaves open how to balance backend-specific optimization against preservation of a comprehensible common source.

Finally, the reported agent cost excludes human review time, which the authors identify as substantial. The study establishes that an agent can produce the translated implementation, but it does not quantify the total labor required to establish scientific trust in that implementation or compare it against a carefully designed manual migration. It also does not isolate the contributions of the underlying LLM, the Claude Code tool environment, Kokkos abstractions, source-code quality, or the extensive human-directed verification process.

Conclusion

The paper demonstrates a complete, application-scale migration of a selected NICAM production configuration from Fortran/OpenACC to C++/Kokkos using a human-directed coding agent. Approximately 140,000 lines of Fortran were analyzed and reduced to approximately 35,000 lines of C++/Kokkos source covering the dynamical core and seven physics packages. Layered validation found strong statistical agreement between 100-member Fortran and Kokkos ensembles, with 95.3% of 5,900 member–quantity scores within ∣z∣≤2|z| \leq 2 in both implementations.

The port also improved measured performance relative to the GH200 Fortran/OpenACC baseline: 1.71× in application time on GH200, 1.54× on MI300A, and 1.38× and 1.27× in kernel time for CUDA and HIP, respectively. These results support the feasibility of agent-assisted modernization, but specifically under human supervision, reference-driven testing, and architecture-aware performance analysis. The unresolved questions concern broader configuration coverage, longer integrations, systematic boundary-case testing, MI300A-specific tuning, and the full human cost of establishing correctness.

Whiteboard

Explain it Like I'm 14

1. What is this paper about?

This paper explains how researchers used an AI coding agent to help move a large climate-science computer program from Fortran to C++ with Kokkos.

The program is called NICAM, which stands for Nonhydrostatic Icosahedral Atmospheric Model. NICAM is used to simulate Earth’s atmosphere, including things such as wind, clouds, rain, temperature, and energy.

The researchers wanted NICAM to work well on different kinds of powerful computers, especially:

  • NVIDIA GPUs, which use CUDA
  • AMD GPUs, which use HIP

Kokkos helps programmers write one version of a program that can run on both types of GPUs.

The migration was assisted by Claude Code, an AI tool that can read code, write new code, compile programs, run tests, and fix some errors. However, people still guided the AI and carefully checked its work.

2. What questions did the researchers ask?

The main question was:

Can an AI coding agent help humans successfully move a very large, complicated climate model from old Fortran code to modern C++/Kokkos code?

The researchers also wanted to know:

  1. Does the new program produce scientifically trustworthy results? In other words, does it behave like the original Fortran program?
  2. Does the new program run quickly? The researchers tested whether the C++/Kokkos version could be faster than the original.
  3. Can the new program work on both NVIDIA and AMD GPUs?
  4. How much human checking is still needed?
  5. How much computer usage and money did the AI-assisted process require?

3. How did they do the research?

Moving the code

The original NICAM program contained about 140,000 lines of Fortran code. The researchers used Claude Code to translate the important parts into about 35,000 lines of C++/Kokkos code.

The port included:

  • The model’s main atmospheric calculations, called the dynamical core
  • Cloud and rain calculations
  • Radiation
  • Surface heat and water exchanges
  • Turbulence
  • Land processes
  • Ocean and sea-ice processes

The AI worked on the program one section at a time. Humans first made a plan, then the AI translated a section, built it, tested it, and revised it when needed.

What are Kokkos and GPU backends?

A GPU is a processor designed to perform many calculations at the same time. This is useful for climate models because they must calculate conditions at many places in the atmosphere.

Kokkos acts somewhat like a universal adapter. Scientists can write the main program once, and Kokkos helps it run on different types of computer hardware.

  • CUDA is the software system used to run programs on NVIDIA GPUs.
  • HIP is the software system used to run programs on AMD GPUs.

Testing the new program

The researchers used three levels of testing.

1. Testing individual pieces

They gave a translated routine exactly the same input as the original Fortran routine and compared the outputs.

This is similar to testing one part of a machine separately to see whether it works correctly.

2. Testing short complete runs

They ran the whole model for 30 or 60 time steps and compared it with the Fortran version.

This helped catch problems that individual tests might miss. For example, one test found that the new program was calculating surface radiation incorrectly because a needed initialization step had been left out.

3. Testing groups of simulations

Weather and climate models are very sensitive to tiny changes. Two versions may not produce exactly the same weather pattern after several days, even if both are correct.

To handle this, the researchers created 100 simulations, or an ensemble, with tiny differences in their starting temperatures. They ran the same 100 starting conditions using both the Fortran and Kokkos versions.

Instead of asking whether every cloud and wind pattern matched exactly, they compared the overall statistics, such as:

  • Average energy
  • Amount of water and rainfall
  • Global average temperature
  • Average wind speeds
  • Mass and energy balances

This is like comparing two groups of students by their overall test-score patterns rather than expecting every student to receive exactly the same score.

Measuring speed

The researchers tested the programs on two powerful supercomputers:

  • An NVIDIA GH200 system called Miyabi-G
  • An AMD MI300A system called Sirius

They measured how long each version took to complete the same atmospheric calculations.

4. What did they find?

The new program was scientifically consistent

The C++/Kokkos version produced results that were statistically similar to the original Fortran version.

The researchers examined 59 different quantities across two groups of 100 simulations. About 95.3% of the results fell within the expected range for both versions.

This does not mean every number was exactly identical. Small differences are normal because the two programs may perform calculations in a different order. What matters is that the differences did not change the overall behavior of the climate model.

The new program was faster

Compared with the original Fortran/OpenACC version on the NVIDIA computer:

  • The Kokkos version on NVIDIA was 1.71 times faster
  • The Kokkos version on AMD was 1.54 times faster

For example, if the original program took about 81 seconds, the NVIDIA Kokkos version took about 47 seconds.

When looking only at the time spent in GPU calculations:

  • The NVIDIA CUDA version was 1.38 times faster
  • The AMD HIP version was 1.27 times faster

The speed improvements came partly from reducing unnecessary data movement and waiting. The new version often worked directly with complete data arrays instead of repeatedly copying smaller pieces of data.

It worked on both NVIDIA and AMD hardware

The same general C++/Kokkos code could be compiled for both CUDA and HIP.

This is important because scientific organizations may use different kinds of supercomputers. They do not want to rewrite the entire program every time they buy a new type of machine.

The AMD version was not quite as efficient as the NVIDIA version. The researchers believe this was partly because the AMD version used settings originally chosen for NVIDIA GPUs. More tuning could probably improve its performance.

The AI did not work alone

Claude Code wrote the C++/Kokkos model code, but human researchers:

  • Decided what should be translated
  • Created rules and goals
  • Reviewed the AI’s plans
  • Checked the program structure
  • Compared results
  • Investigated errors
  • Approved each stage

One important error was found only during a complete model run, even though the smaller tests had passed. This shows that AI-generated code still needs careful human testing.

The researchers recorded about 4 billion cached tokens and estimated that the work would cost about $5,589 at standard API prices. They also sent 797 instructions to the AI during the recorded workflow.

5. Why is this important?

Large scientific programs are often decades old. Rewriting them by hand can take many years and require experts who understand both the science and several programming languages.

This research suggests that an AI coding agent can greatly speed up part of that work. It can act like a very fast programming assistant that:

  • Reads old code
  • Writes new code
  • Runs tests
  • Finds some mistakes
  • Repeats the process many times

The new Kokkos version also makes NICAM more flexible. In the future, researchers may be able to run it efficiently on many types of processors without maintaining a completely separate program for each machine.

However, the paper also shows that AI is not a replacement for scientific experts. Humans still need to check whether the calculations make sense, design good tests, and find errors that simple tests miss.

Conclusion

The paper demonstrates that an AI-assisted approach can help modernize a very large climate model. The researchers successfully moved an important part of NICAM from Fortran to C++/Kokkos, tested it on NVIDIA and AMD supercomputers, and showed that it produced results similar to the original while running faster.

The biggest possible impact is that other old scientific programs might be modernized more quickly and made ready for future supercomputers. Still, the safest approach is a partnership: AI can do much of the repetitive coding, while human scientists provide judgment, testing, and responsibility for the final results.

Practical Applications

Immediate Applications

  • HPC climate-model modernization: Research institutions and meteorological agencies can use the demonstrated human-in-the-loop workflow to begin migrating large Fortran climate, weather, ocean, and environmental models to C++/Kokkos. The workflow—planning, module-by-module translation, compilation, reference testing, integration testing, and human review—is deployable now for selected production configurations.
    • Potential tools/workflows: Agent-assisted migration pipelines, source-to-source translation assistants, compiler/test orchestration, and progress-tracking artifacts such as module maps and migration logs.
    • Dependency: The legacy code should have reasonably consistent data structures, maintainable organization, and usable compiler directives or documentation. Expert review remains necessary.
  • Cross-vendor deployment of atmospheric simulations: The C++/Kokkos NICAM implementation can be deployed on NVIDIA CUDA and AMD HIP systems from a shared source base. This supports climate centers and universities operating heterogeneous clusters without maintaining separate NVIDIA- and AMD-specific implementations.
    • Sectors: Weather forecasting, climate science, environmental modeling, and national laboratories.
    • Practical benefit: The port achieved a 1.71× application speedup on an NVIDIA GH200 relative to the Fortran/OpenACC baseline and ran on AMD MI300A with a 1.54× speedup relative to that baseline.
    • Dependency: Performance is not automatically equivalent across architectures. The MI300A build reused CUDA-oriented tile sizes and may require architecture-specific tuning.
  • Faster ensemble climate experiments: The validated port can support larger or more frequent ensemble simulations for uncertainty quantification, sensitivity analysis, data assimilation research, and extreme-weather studies.
    • Potential workflow: Launch many perturbed NICAM members across NVIDIA or AMD GPU partitions, using the C++/Kokkos implementation as a common executable.
    • Dependency: The reported consistency was demonstrated for 100-member ensembles, 59 quantities, and 10-day simulations. Longer integrations, additional diagnostics, and broader initial conditions require further validation.
  • Regression testing for scientific software: The paper’s three-tier validation protocol can be adopted immediately by scientific software teams:
    • component-level comparisons against dumped reference inputs and outputs;
    • short coupled integration tests checking fields and conservation budgets; and
    • ensemble or distributional comparisons when bitwise reproducibility is inappropriate.
    • Sectors: Computational physics, chemistry, computational fluid dynamics, biology, and engineering simulation.
    • Potential product: A reusable scientific-model continuous-integration system that runs reference tests on CPU, CUDA, HIP, and other backends.
    • Dependency: Reference data must be representative. The paper notes that isolated unit tests can miss errors in initialization or data-production pathways.
  • Modernization of other legacy scientific codes: The same workflow can be applied to legacy Fortran applications in ocean modeling, plasma physics, molecular dynamics, computational fluid dynamics, and energy systems.
    • Evidence from the paper: Related work has already applied similar approaches to FESOM2 and ORB5, while NICAM demonstrates application-scale migration involving approximately 140,000 lines of Fortran.
    • Dependency: Results should not be generalized to arbitrary codebases. Highly irregular control flow, undocumented numerical assumptions, weak test coverage, or extensive global state may substantially increase human effort.
  • Improved scientific software maintainability: Converting implicit Fortran dependencies into explicit C++ interfaces and representing state with Kokkos Views can make ownership, lifetime, data movement, and module dependencies easier to inspect.
    • Potential workflow: Use class-based modules, explicit dependency injection, device-resident state arrays, and backend-independent execution policies when adding new physics or diagnostics.
    • Dependency: C++ complexity, template behavior, and kernel fusion can create new maintenance challenges. The paper specifically notes that fused kernels may be faster but harder to review.
  • Simplified runtime configuration and experiment management: The YAML-based configuration layer can be used immediately to manage model resolution, time integration, and physics-package choices in scripts and workflow systems.
    • Sectors: Academic research, operational forecasting, and reproducible computational experiments.
    • Potential tools: YAML-driven parameter sweeps, workflow schedulers, containerized model runs, and automated experiment registries.
    • Dependency: Only the selected configuration and explicitly supported options are available; unported branches are rejected rather than silently supported.
  • Education and training in performance-portable computing: The translated NICAM code, Fortran-to-Kokkos comparisons, and validation procedure can serve as teaching material for courses and workshops on HPC, GPU programming, numerical methods, and software engineering.
    • Practical activities: Students can translate individual kernels, compare OpenACC and Kokkos implementations, measure memory movement, and construct reference-based tests.
    • Dependency: The full production model may be too large for introductory use; smaller kernels or the dry dynamical core are more suitable.
  • Institutional planning for AI-assisted software engineering: HPC centers can use the reported token consumption, estimated API cost of approximately USD 5,589, and 23 active workflow days as an initial budgeting reference for similar migration projects.
    • Dependency: The estimate includes porting, analysis, plotting, and data-generation tasks, and does not include unrecorded human review time, cluster costs, or the cost of correcting failures after deployment. Actual costs may vary substantially.
  • Policy and funding decisions for sustainable scientific infrastructure: Funding agencies and research organizations can prioritize performance-portable rewrites of strategically important legacy applications rather than maintaining separate architecture-specific forks.
    • Practical implication: Shared Kokkos implementations can reduce dependence on a particular accelerator vendor and extend model usability across national supercomputing systems.
    • Dependency: Portability must be evaluated alongside performance, numerical reliability, developer expertise, licensing, and long-term Kokkos/backend support.

Long-Term Applications

  • Reusable autonomous migration agents for scientific software: The workflow could evolve into a semi-automated platform that performs dependency analysis, translates modules, invokes compilers, generates tests, runs benchmarks, and proposes fixes across an entire codebase.
    • Potential product: A domain-aware “scientific code modernization agent” with specialized roles for translation, numerical verification, performance tuning, and documentation.
    • Required development: Formal dependency graphs, stronger boundary-case generation, persistent project memory, reproducible tool execution, and safeguards against incorrect numerical transformations.
    • Key assumption: Human experts will remain responsible for approving algorithmic equivalence and scientific validity.
  • Automated ensemble-based acceptance testing: The paper’s z-score comparison could become a general tool for validating compiler changes, GPU backends, precision changes, parallel decomposition, and model rewrites in chaotic simulations.
    • Sectors: Weather, climate, oceanography, wildfire prediction, turbulence modeling, and data assimilation.
    • Potential workflow: Every software release generates matched perturbed ensembles and automatically evaluates distributions of conservation metrics, global means, variability, and application-specific diagnostics.
    • Required development: More rigorous acceptance criteria, principal-component or multivariate tests, longer simulations, and methods for distinguishing numerical drift from scientifically meaningful changes.
  • Operational weather and climate forecasting on mixed accelerator fleets: Once additional NICAM components and configurations are ported and validated, a single codebase could support operational workloads across heterogeneous national or commercial clouds.
    • Potential applications: Global weather prediction, seasonal forecasting, climate projection, hazard assessment, and rapid scenario generation.
    • Required development: Porting all relevant physics and I/O paths, validating longer forecasts, improving multi-node scaling, and integrating operational data-assimilation pipelines.
    • Dependency: The current evidence covers one selected production configuration and relatively limited simulation durations.
  • Architecture-aware automatic performance tuning: Kokkos provides portability, but the results show that portable code still needs backend-specific optimization. Future systems could automatically explore tile sizes, layouts, execution policies, kernel fusion, memory placement, and MPI decompositions.
    • Potential tools: Auto-tuning frameworks coupled to Kokkos, hardware-performance-model-guided agents, and benchmark-driven optimization loops.
    • Expected benefit: Improve AMD performance toward or beyond the NVIDIA results while preserving one shared implementation.
    • Dependency: Automated tuning must preserve numerical behavior and avoid optimizing short benchmarks at the expense of large-scale or long-duration workloads.
  • Migration of broader energy and engineering applications: The approach could eventually modernize legacy simulators for energy-grid planning, renewable-energy forecasting, combustion, nuclear engineering, battery systems, and computational fluid dynamics.
    • Potential products: Portable GPU-enabled solvers, accelerator-ready digital twins, and simulation services deployable on different cloud and supercomputing platforms.
    • Dependency: These fields may contain stricter safety, certification, or regulatory requirements than climate research. Numerical equivalence alone may not establish suitability for operational or safety-critical use.
  • AI-assisted generation of scientific test suites: Agents could infer numerical invariants, conservation laws, boundary cases, and cross-module contracts from legacy code and generate tests before or during migration.
    • Potential workflow: Combine static code analysis, symbolic reasoning, reference-output generation, property-based testing, and ensemble testing.
    • Benefit: Address the paper’s limitation that current tests use a limited collection of dumped inputs and may not cover boundary conditions.
    • Dependency: Automatically inferred properties must be checked by domain experts; incorrect assumptions about conservation or valid ranges could produce misleading tests.
  • Research reproducibility and executable model archives: The combination of YAML configuration, containerized builds, backend-specific compilation, and recorded validation artifacts could support portable archival versions of scientific models.
    • Sectors: Academia, public research infrastructure, and policy-oriented climate assessment.
    • Potential tools: Reproducible model capsules containing source, compiler versions, Kokkos configuration, reference datasets, test results, and performance metadata.
    • Dependency: Long-term reproducibility depends on preserving compiler, library, hardware, input-data, and numerical-environment compatibility.
  • Workforce transformation in scientific computing: AI agents may allow domain scientists to contribute to modernization projects without becoming specialists in every target programming model, while HPC engineers focus on verification, architecture tuning, and system integration.
    • Long-term implication: Universities and research organizations may develop hybrid roles combining numerical analysis, software assurance, and AI-agent supervision.
    • Dependency: Training must address code review, numerical stability, floating-point behavior, security, intellectual property, and responsible use of generated code.
  • Policy frameworks for trustworthy AI-generated scientific code: As agent-assisted migration expands, organizations may establish formal governance requiring provenance records, human approvals, reproducible builds, independent validation, and documented performance comparisons.
    • Potential policy use: Procurement standards for AI-modernized public-sector models and certification requirements for software used in climate, energy, or environmental decisions.
    • Dependency: Standards must distinguish ordinary research software from operational or safety-critical systems and must account for uncertainty caused by non-bitwise numerical behavior.

Glossary

  • Agentic workflow: A software-development process in which an AI agent autonomously performs multiple coordinated tasks under human direction. “Additional Key Words and Phrases: NICAM, Kokkos, agentic workflow, performance portability”
  • Amortization: The allocation of a cost across multiple operations or time steps. “For the kernel-time breakdown, the radiation update cost was amortized over its 60-step interval.”
  • APU (Accelerated Processing Unit): A processor that combines CPU and GPU components in a shared system. “Sirius uses AMD Instinct MI300A APUs”
  • Backend: An implementation layer that maps a programming abstraction onto a particular hardware or execution system. “Its CUDA and HIP backends provide a route to NVIDIA and AMD GPUs from a common source codebase”
  • Bandwidth normalization: Adjustment of performance measurements to account for differences in peak memory bandwidth between hardware platforms. “Figure 1(b) compares the CUDA and HIP builds after normalization by peak memory bandwidth”
  • Big-endian: A byte-ordering convention in which the most significant byte is stored first. “highlighted the original model’s big-endian input/output”
  • Cloud microphysics: The atmospheric-physics processes governing cloud particles, phase changes, and precipitation. “NSW6 cloud microphysics”
  • Coupled simulation: A simulation in which multiple interacting physical or computational subsystems are integrated together. “the statistical behavior of coupled simulations”
  • Data layout: The organization of multidimensional data in memory, affecting indexing and performance. “Kokkos addresses this goal through C++ abstractions for parallel execution, memory spaces, and multidimensional data layouts”
  • Device-resident: Stored in accelerator memory so that data can be accessed without repeated transfers from the host. “The prognostic state remains device-resident across time steps”
  • Dynamical core: The numerical component of an atmospheric model that solves the governing equations for fluid motion and thermodynamics. “The completed application combines NICAM’s nonhydrostatic dynamical core with seven physics packages”
  • Ensemble consistency testing: Statistical comparison of multiple simulations to determine whether two implementations exhibit compatible behavior. “Tier 3. Ensemble-inspired consistency testing.”
  • Execution policy: A specification of how a parallel operation is iterated and executed across an execution space. “the port exposes work across regions through a multidimensional Kokkos execution policy”
  • Fused computation: The combination of adjacent computational operations into a larger operation to reduce intermediate data movement and launch overhead. “The time spent in the ‘Surface flux + turbulence’ kernels decreases from 58.8 to 28.5 ms following the fusion of adjacent computations”
  • Global mean: The average value of a field over the entire modeled spatial domain. “the global means and standard deviations of model fields”
  • Gyrokinetic particle-in-cell: A plasma simulation method that combines gyrokinetic equations with particle-in-cell numerical techniques. “the Fortran ORB5 gyrokinetic particle-in-cell code”
  • Heterogeneous hardware: A computing system containing different types of processors or accelerators with distinct execution and memory characteristics. “Modernizing weather and climate models for heterogeneous hardware predates LLM-based code generation.”
  • HIP: AMD’s GPU programming platform and the Kokkos backend targeting AMD accelerators. “The CUDA build achieved a GPU kernel-time speedup of 1.38× on GH200.”
  • Host–device data transfer: Movement of data between the host processor’s memory and an accelerator’s memory. “Host-to-device copy at setup”
  • Ill-conditioned: Numerically sensitive or unstable, such that small input or rounding errors can cause relatively large output errors. “Exceptions for ill-conditioned intermediate quantities were documented”
  • Kernel: A parallel function launched for execution on a GPU or other accelerator. “The kernel-duration sums include only time spent executing GPU kernels”
  • Kokkos View: A multidimensional, memory-space-aware data structure provided by the Kokkos programming model. “The classes own model state arrays through Kokkos Views”
  • LayoutLeft: A Kokkos memory layout in which the leftmost array index varies fastest in memory. “LayoutLeft retains the Fortran array ordering with the horizontal index g contiguous in memory.”
  • Memory space: A Kokkos abstraction identifying the memory region in which data is allocated and accessed. “Kokkos addresses this goal through C++ abstractions for parallel execution, memory spaces, and multidimensional data layouts”
  • Multidimensional execution policy: A parallel-iteration specification over more than one index dimension. “the port exposes work across regions through a multidimensional Kokkos execution policy”
  • Nonhydrostatic: Describing a model that does not impose hydrostatic balance and can explicitly represent vertically accelerating atmospheric motions. “NICAM uses an icosahedral grid and nonhydrostatic equations to support global atmospheric simulations.”
  • Numerical parameterization: An approximate representation of unresolved physical processes within a numerical model. “These codebases combine numerical algorithms, physical parameterizations, communication routines, and input/output infrastructure.”
  • OpenACC: A directive-based programming model for accelerating applications on GPUs and other parallel processors. “The reference was evaluated on Miyabi-G.”
  • Prognostic variable: A model variable whose future value is calculated by integrating governing equations over time. “The prognostic state remains device-resident across time steps”
  • Reduction: A parallel operation that combines many values into a single result, such as a sum or maximum. “which can alter the order of floating-point operations in reductions”
  • Relative error: The magnitude of an error divided by the magnitude of a reference value. “The standard acceptance threshold was a relative error of at most 10−13”
  • Strong scaling: The reduction in execution time achieved by increasing processing resources while keeping the problem size fixed. “To assess performance beyond a single accelerator, we conducted strong-scaling experiments”
  • Tile size: The dimensions of a block of iteration space processed together to improve locality or accelerator efficiency. “The HIP build reuses the CUDA tile sizes in MDRange”
  • Trajectory: The time-evolving sequence of states produced by a simulation. “agreement between individual trajectories becomes difficult to interpret as the integration proceeds.”
  • Vertical implicit solver: A numerical solver that determines vertically coupled variables implicitly rather than using only previously known values. “the Fortran offload in the vertically implicit solver”
  • z-score: A standardized measure expressing a value’s distance from a reference mean in units of reference standard deviation. “Our test compares diagnostic quantities and their distributions directly using 𝑧-scores”
  • Zero-based indexing: An array-indexing convention in which the first element is assigned index zero. “Array indices are converted to zero-based indexing”

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 3 tweets with 2020 likes about this paper.