Python-Assisted Development of High-Performance Fortran Codes: A Hybrid Methodology Integrating Symbolic Mathematics and Large Language Models
The development of high-performance Fortran code for large-scale scientific simulations is inherently challenging: direct Fortran implementation demands substantial expertise in numerical methods, optimization and system architecture. Manual derivation of numerical schemes is error-prone and time-consuming. This paper advocates a four-stage development methodology involving Python prototyping and symbolic derivation. Systematic validation at each step of incremental transition from symbolic specification to Fortran code produces numerically correct maintainable code faster than by direct manual implementation without sacrificing the resultant performance or code quality. Large Language Models effectively accelerate Python prototyping and boilerplate generation but require rigorous verification of the generated Fortran code. We suggest practical implementation guidelines including validation strategies. Python prototyping and symbolic code generation provide effective instruments for developing efficient production-ready Fortran implementations.
Authors
- Roman Chertovskih (ORCID: https://orcid.org/0000-0002-5179-4344)
- Daniil Tolmachev
Institutions
- Universidade do Porto (PT)
- Institute of Earthquake Prediction Theory and Mathematical Geophysics (RU)
Publication Details
- Journal
- Computation
- Published
- 2026-04-06
- DOI
- https://doi.org/10.3390/computation14040086
- Primary Topic
- Computational Physics and Python Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00