Claude Code Helped Port a 260,000-Line Fortran Weather Model to GPUs. Validation Was the Hard Part

Nagoya University researchers used an AI agent to move 162 kernels of the CReSS storm simulator to OpenACC on Nvidia GH200 hardware, for a 5.1x speedup. The agent's validation runs caught five kernels where tiny CPU/GPU numerical differences flipped results.
Claude Code Helped Port a 260,000-Line Fortran Weather Model to GPUs. Validation Was the Hard Part
Claude Code Helped Port a 260,000-Line Fortran Weather Model to GPUs. Validation Was the Hard Part

Porting decades-old scientific code to GPUs is the kind of tedious, high-stakes job AI coding agents are being pitched for. A new paper from researchers at Nagoya University and partner institutions shows it can work, with an important condition: most of the effort has to go into proving the new code still gives the same science.

The paper, “Validation-Centric AI-Assisted GPU Porting of a 250,000+ Line Legacy Weather Simulation Code,” posted to arXiv on Thursday by Tetsuya Hoshino and colleagues, describes porting CReSS, the Cloud Resolving Storm Simulator. The Fortran model has been developed since 1998 and used to study typhoons, heavy rainfall and other severe weather. It spans 599 Fortran 90 files, roughly 260,000 lines and 387 OpenMP parallel regions.

How the agent was used

The team used Claude Code with Opus 4.5 and 4.6. They didn’t ask it to rewrite the model. They had it run a validation workflow: extract each OpenMP region, build kernel benchmarks from data dumped out of a real typhoon simulation, apply OpenACC directives for the GPU, and compare every output element against the dumped reference before running application-level checks.

The result was numerically validated GPU versions of 162 kernels and a 5.1x application speedup. On the Miyabi supercomputer’s Nvidia GH200 nodes, median time per timestep fell from 9.51 seconds on the 72-core Grace CPU to 1.88 seconds on the H100 GPU. The authors note that’s below the roughly 8x memory-bandwidth gap between the two, so there’s headroom left.

Five kernels that didn’t match

The most useful finding is what validation caught. In five kernels, results differed between CPU and GPU, not because of porting bugs but because tiny floating-point and intrinsic-function differences were amplified by threshold checks or cancellation. In one, a temperature computed with exp() and log() came out at 233.16002 K on the CPU, just above a 233.16 K threshold, so a small GPU difference sent the code down a different branch. The team sent those cases back to the model’s developers.

Where agents struggled

The paper is candid about costs. Interactive jobs on Miyabi are limited to two hours, so the agent’s sessions kept ending, and it needed progress summaries to pick up where it left off. Small omissions in static analysis, such as a missed variable, could force another expensive simulation dump, so the team set up a compile-driven loop to catch those cheaply. The authors caution that these failure modes are tied to the models they used and may change with newer ones.

Their conclusion applies well beyond weather codes: AI-assisted GPU porting “requires not only code generation, but validation-centric workflow design.”

Subscribe for Updates

AIDeveloper Newsletter

The AIDeveloper Email Newsletter is your essential resource for the latest in AI development. Whether you're building machine learning models or integrating AI solutions, this newsletter keeps you ahead of the curve.

By signing up for our newsletter you agree to receive content related to ientry.com / webpronews.com and our affiliate partners. For additional information refer to our terms of service.

Notice an error?

Help us improve our content by reporting any issues you find.

Get the WebProNews newsletter delivered to your inbox

Get the free daily newsletter read by decision makers

Subscribe
Advertise with Us

Ready to get started?

Get our media kit

Advertise with Us