arXiv Science⌕ Search

arXiv · 2610.12662

Evaluating LLMs for Translating Legacy Fortran Atmospheric Physics to GPU-Accelerated JAX

Abstract

Legacy Fortran physics packages in atmospheric models such as CESM, WRF, and E3SM pose a barrier to GPU modernization, while manual porting requires accelerator-programming expertise. We present LAFT (LLM-Assisted Fortran Translation), an agentic framework for converting Fortran atmospheric physics parameterizations into GPU-accelerated JAX while preserving numerical agreement with the Fortran reference. LAFT coordinates source-code analysis, translation, repair, runtime validation, and performance profiling. It combines a deterministic front end for metadata extraction and bridge generation, structured translation prompts, numerical validation, and profiling-guided feedback to identify inefficient execution patterns. The bridge handles array-layout conversion separately from scientific computation. We evaluate LAFT using the Kessler warm-rain microphysics scheme and four LLMs: Claude, GPT, Gemini, and Qwen. All four validated translations reproduce the Fortran reference outputs to near floating-point precision for the evaluated case, but their GPU performance differs substantially with execution design. The Gemini-generated implementation achieves up to a 357-fold speedup over serial Fortran in cached execution at 1,000,000 atmospheric columns, excluding compilation and host-device transfers. The results demonstrate that numerical agreement alone does not ensure efficient GPU execution and motivate combining numerical validation with hardware-aware performance analysis. LAFT provides a practical workflow for modernizing legacy atmospheric physics code through LLM-assisted translation, deterministic interface generation, automated validation and repair, and reproducible profiling.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Iris Linck, John Dennis, John Schreck, Karen Stengel, David John Gagne II. 2026-10-08. Evaluating LLMs for Translating Legacy Fortran Atmospheric Physics to GPU-Accelerated JAX. https://arxiv.org/abs/2610.12662

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

High-level, efficient ocean modeling at all scales with Oceananigans

We describe the user interface, governing equations, and numerical methods underpinning the ocean modeling software called "Oceananigans". Oceananigans development has been led by the Climate Modeling Alliance as part of a larger effort to build a trainable climate model with quantifiable uncertainty. Notably, Oceananigans is written in the Julia programming language, is optimized for GPUs, and can efficiently simulate all scales of ocean motion ranging from millimeter-scale turbulence in a small box to planetary-scale ocean circulation. We argue that this combination of capabilities is enabled by a design that combines a basic, easy-to-optimize, GPU-friendly structured finite volume algorithm exposed behind a high-level, programmable user interface. This design negotiates a dual mandate for highest-possible performance (to support state-of-the-art applications) and enhanced accessibility (to facilitate adoption and development). The dual mandate aims ultimately to accelerate the progress of Earth system science.

physics.ao-ph↗

Physical Processes Driving Year-to-Year Surface Temperature Variability Changes in a Warming Climate

Under anthropogenic greenhouse forcing, climate models project a decrease in year-to-year temperature variability in the mid-to-high latitudes and an increase in the tropics and subtropics. Here, we examine year-to-year temperature variability in the CESM Large Ensemble in concert with an idealized stochastic moist energy balance model (SMEBM) with effective surface heat capacity and local feedback parameter specified based on CESM. We find that the zonal-mean CESM variability change pattern largely persists after filtering out the impact of El Niño. The SMEBM largely captures this change pattern. In the SMEBM, changes in the mid-to-high latitudes are driven by changes in the effective heat capacity due to sea ice retreat, combined with changes in anomalous moist static energy convergence modulated by the polar-amplified time-mean temperature change. The CESM local feedback parameter evolves to be less stabilizing in the low latitudes, which causes tropical and subtropical variability to increase in the SMEBM.

physics.ao-ph↗