Why Consider Keeping Fortran Code?

Several servers Although Fortran may be considered by some developers to be a bit of an F-Word, it remains one of the most efficient programming languages for numerical computation and large-scale data processing. This discrepancy between what some people think and the actual reality is mainly due to lack of familiarity with Fortran standards later than Fortran 77.1 Modern Fortran is a surprisingly good, developer friendly, and capable language. And even though many developers no longer learn it in school, it is very easy for an experienced developer to read, understand, and contribute to Fortran codebases. 2

Additionally, its syntax and compiler optimizations are specifically designed for tasks that require intense arithmetic operations, tight memory control, and predictable performance. These characteristics make it particularly well-suited for high-performance computing (HPC) applications in aerospace, defense, and scientific research, and it remains the language of choice for researchers in these fields.

In fact, there is a good chance that your team is already using Fortran without knowing it! Some of the most popular libraries in Python, NumPy and SciPy, use Fortran in their backend. In fact, as of Jan 2025, the SciPy repo lists Fortran as over 9% of it's source code! You can also drill down further and look at the specific Fortran files for Numpy and SciPy.3 4

Some Benefits of Fortran:

  • Performance: Fortran consistently delivers superior execution speed for numerically intensive tasks, outperforming many modern alternatives in large-scale simulations and computational workflows. 5
  • Stability: Decades of development and widely adopted mature compilers have made Fortran a reliable choice for critical systems that require consistent behavior under demanding conditions. 5
  • Backwards Compatibility: Adding to its stability, the ISO Fortran Standard guarantees backwards compatibility. 5 This is in stark contrast to a language like Python, that provides no such guarantee.6 This drastically lowers your cost of maintaining the software. Once Fortran code is written, you can use it for decades without needing to rewrite it.
  • Proven Track Record: Fortran has been the backbone of mission-critical applications across industries, including aerospace and defense, where precision and reliability are non-negotiable.

These benefits can allow your team to achieve exceptional computational efficiency while relying on a time-tested technology. Rather than discarding these strengths in favor of a full rewrite, modernization strategies can focus on integrating Fortran into contemporary environments to balance performance with flexibility. We cover this approach in Approach 1 of our Fortran Modernization Process.

Maintaining Verified and Validated (V&V) Software Reduces Costs

Another major reason to retain Fortran codebases is the significant investment that organizations have already made in verification and validation (V&V). In sectors such as aerospace and defense, software often undergoes rigorous V&V processes to ensure compliance with safety standards, operational reliability, and regulatory requirements. These processes involve extensive testing, detailed documentation, and certification—all of which are time-intensive and costly to replicate.

Rewriting legacy Fortran code in a new language would require repeating the entire V&V process from scratch. Such efforts not only drive up costs but also introduce risks, such as the introduction of new bugs or errors.

The consequences of failing to properly verify and validate software have been demonstrated in high-profile incidents. For example, on February 25, 1991, during the Gulf War, a software error in the Patriot missile system led to a failure to intercept an incoming Iraqi Scud missile. The issue stemmed from a timing discrepancy caused by rounding errors in the software—a problem that might have been identified through more rigorous V&V processes. Tragically, this oversight resulted in the loss of 28 lives at the U.S. Army barracks in Dhahran, Saudi Arabia.7

Similarly, NASA’s Mars Climate Orbiter mission experienced a critical failure due to a mismatch between metric and imperial units in its software systems. This error caused the spacecraft to enter Mars' atmosphere at an incorrect trajectory, resulting in its destruction. Properly verified and validated software could have identified this discrepancy before deployment. 8

These examples illustrate the importance of retaining software that has already undergone rigorous verification and validation. By modernizing legacy Fortran systems while preserving their V&V status, organizations can avoid the significant costs and risks associated with re-certification. This approach not only safeguards operational reliability in mission-critical environments but also significantly reduces the likelihood of catastrophic failures resulting from undetected software issues.

References

  1. https://ieeexplore.ieee.org/document/4263269
  2. https://www.osti.gov/biblio/1970284
  3. https://github.com/search?q=repo%3Anumpy%2Fnumpy+language%3A%22Fortran+Free+Form%22&type=code
  4. https://github.com/search?q=repo%3Ascipy%2Fscipy++language%3AFortran&type=code
  5. https://ieeexplore.ieee.org/document/9736688
  6. https://ieeexplore.ieee.org/document/8701540
  7. https://www.gao.gov/products/imtec-92-26
  8. https://llis.nasa.gov/llis_lib/pdf/1009464main1_0641-mr.pdf