Systematic LLM Translation of Legacy Scientific Code to Differentiable Frameworks: Application to a Land Surface Model
Not on the map. Why?
Abstract (arXiv)
Differentiable programming offers transformative capabilities for scientific modeling, enabling gradient-based parameter estimation, sensitivity analysis, and data assimilation. Yet, migrating legacy codebases into differentiable frameworks remains a challenge. We present a five-phase LLM-based agentic pipeline that translates legacy Fortran into JAX: static dependency analysis determines module translation order from the full call graph; iterative compile-repair loops correct errors autonomously; and a Fortran reference oracle enforces numerical parity at the module level before integration and gradient verification. We instantiate and evaluate the pipeline on CLM-ml-v2, a 19,000-line Fortran land surface model, and analyze agent behavior across 73 module translation tasks. The resulting differentiable model computes the complete Jacobian in a single backward pass, recovers physical parameters in eight times fewer steps than gradient-free optimization, and achieves a 24 times wall-clock speedup over sequential Fortran at ensemble size N=2,048. Both the translated model and pipeline infrastructure are released as a reusable framework for differentiating other Earth system model components.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 16 of its 53 references that are in the map. First posted on arXiv 4 Jun 2026.
Builds on
16 of 53 references.
References · 16
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,568
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2015Automatic differentiation in machine learning: a surveycited by 855
- 2019Deep Equilibrium Modelscited by 615
- 2023Neural General Circulation Models for Weather and Climatecited by 239
- 2021Efficient and Modular Implicit Differentiationcited by 203
- 2018Deep learning to represent sub-grid processes in climate modelscited by 156
- 2022JAX-FLUIDS: A fully-differentiable high-order computational fluid dynamics solver for compressible two-phase flowscited by 36
- 2022Differentiable Programming for Earth System Modelingcited by 22
- 2024Leveraging Large Language Models for Code Translation and Software Development in Scientific Computingcited by 9
- 2025LLM-Assisted Translation of Legacy FORTRAN Codes to C++: A Cross-Platform Studycited by 7
- 2024Joint Parameter and Parameterization Inference with Uncertainty Quantification through Differentiable Programmingcited by 5
4 more
- 2024Proof-of-concept: Using ChatGPT to Translate and Modernize an Earth System Model from Fortran to Python/JAXcited by 5
- 2025From Legacy Fortran to Portable Kokkos: An Autonomous Agentic AI Workflowcited by 5
- 2024Fortran2CPP: Automating Fortran-to-C++ Translation using LLMs via Multi-Turn Dialogue and Dual-Agent Integrationcited by 4
- 2025Towards fully differentiable neural ocean model with Veroscited by 2
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2026An Ocean Model Ported by a Large Language Model: Experience and Lessons from FESOM2 (Fortran to C to C++/Kokkos)
- 2026Delegating Earth science model calibration to knowledge-guided LLM agents
- 2026GRAIL: AI translation for scientists application workflow on satellite data
- 2026Earth-o1: A Grid-free Observation-native Atmospheric World Model
- 2025Accelerating Earth Science Discovery via Multi-Agent LLM Systems
- 2026Earth Science Foundation Models: From Perception to Reasoning and Discovery
- 2024Fast, Scale-Adaptive, and Uncertainty-Aware Downscaling of Earth System Model Fields with Generative Machine Learning
- 2025Geo-OLM: Enabling Sustainable Earth Observation Studies with Cost-Efficient Open Language Models & State-Driven Workflows