Searcharxiv⌕ 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

Morphology-based retrieval of local wave parameters and phase shifts in satellite-observed atmospheric disturbances

Currently available methods for processing atmospheric wave disturbances are often based on integral wavelet transform techniques, which efficiently estimate spectral data but are fundamentally limited by the uncertainty principle. To address this limitation, this work proposes a novel morphological approach based on partitioning spatial disturbance profiles into separate, well-defined wave segments. By focusing exclusively on the local waveform morphology of a central half-wave and its two adjacent out-of-phase counterparts, and taking the modified Morlet wavelet as a primary example of a model wave packet, we successfully reconstruct the complete set of local wave parameters directly from the amplitudes and positions of these three dominant half-waves. Consequently, the theory demonstrates good agreement with observations, confirming the high accuracy of the proposed waveform morphology approach in reconstructing the localized structure of atmospheric disturbances. When applied to evaluating the phase shift between different wave field components, the method reveals that this shift is a weighted combination of the classical monochromatic phase difference and a morphological one determined by the internal symmetry of the underlying wave packets. Although the classical factor yields the dominant contribution, the symmetry-related factor provides a moderate correction to it. The applicability and accuracy of the approach are verified using observational data gathered over several orbits of the low-Earth-orbit satellite Dynamic Explorer 2 as it passed over Earth's polar caps. The obtained results confirm that the observed disturbances correspond to medium-scale acoustic-gravity waves propagating at a small angle to the horizontal plane, demonstrating the broader methodological potential of the proposed technique for analyzing a wide range of wave phenomena.

physics.ao-ph↗

Deep learning in the abyss: a stratified Physics Informed Neural Network for data assimilation

The reconstruction of deep ocean currents is a major challenge in data assimilation due to the scarcity of interior data. In this work, we present a proof of concept for deep ocean flow reconstruction using a Physics-Informed Neural Network (PINN), a machine learning approach that offers an alternative to traditional data assimilation methods. We introduce an efficient algorithm called StrAssPINN (for Stratified Assimilation PINNs), which assigns a separate network to each layer of the ocean model while allowing them to interact during training. The neural network takes spatiotemporal coordinates as input and predicts the velocity field at those points. Using a SIREN architecture (a multilayer perceptron with sine activation functions), which has proven effective in various contexts, the network is trained using both available observational data and dynamical priors enforced at several collocation points. We apply this method to pseudo-observed ocean data generated from a 3-layer quasi-geostrophic model, where the pseudo-observations include surface-level data akin to SWOT observations of sea surface height, interior data similar to ARGO floats, and a limited number of deep ARGO-like measurements in the lower layers. Our approach successfully reconstructs ocean flows in both the interior and surface layers, demonstrating a strong ability to resolve key ocean mesoscale features, including vortex rings, eastward jets associated with potential vorticity fronts, and smoother Rossby waves. This work serves as a prelude to applying StrAssPINN to real-world observational data.

physics.ao-ph↗

A Graph Neural Network for Global Daily Fire Radiative Power Prediction at Medium-Range Lead Times

Skillful prediction of biomass-burning activity several days in advance is important for air-quality forecasting and aerosol prediction. Two operational constraints motivate this work. First, the GBBEPx satellite fire radiative power (FRP) product used to initialize NOAA's GEFS-Aerosols is available with about a 1.5-day latency, so each forecast cycle relies on the most recently available, but already outdated, fire observations. Second, these fire inputs are then held fixed throughout the subsequent 5-day operational forecast, or 7 days in the GSL experimental system, effectively assuming no evolution in fire activity. We develop a data-driven model that predicts global FRP one to seven days ahead from the most recent available observations. The model adapts a spatiotemporal graph neural network using reanalysis meteorology, land-cover and vegetation information, recent fire history, and GBBEPx FRP as the training target. It is trained on 2020-2022 data and evaluated for 2023-2024. The model reproduces the global seasonal cycle and substantially outperforms persistence. At 0.1$^\circ$ resolution, mean squared error is reduced by 32% at one-day lead and 43% at seven days in 2023, and by 24% and 40% in 2024. At 1$^\circ$ resolution, the critical success index ranges from 0.32 to 0.60. Detection skill declines only modestly with lead time, whereas intensity skill degrades more rapidly. Large fires are detected reliably, but their radiative power is systematically underestimated. These results demonstrate useful predictability of fire activity several days ahead and identify intensity calibration and small-fire placement as the main remaining challenges before predicted FRP can support operational aerosol forecasts.

physics.ao-ph↗