Language reference

Fortran

Still the workhorse of HPC and scientific codebases, serving a different buyer entirely.

History & foundation

Origin

Fortran, short for Formula Translation, was completed in late 1954 and shipped to IBM 704 customers beginning in April 1957, making it the oldest language still in active production use anywhere on this site by more than a decade. John Backus led the IBM team that built it, alongside programmers including Richard Goldberg, Sheldon Best, Harlan Herrick, Roy Nutt, Lois Haibt, and David Sayre. Its founding goal was narrow and radical for the time: let scientists and engineers write numerical code in something closer to mathematical notation than machine instructions, and have a compiler produce code efficient enough that programmers would actually trust it over hand-written assembly.

Design goals

Fortran's defining bet, that a compiled high-level language could match hand-written assembly for numerical performance, is the reason it still exists: it wasn't chasing readability or general-purpose flexibility, it was chasing raw arithmetic throughput, and every major revision since has kept that priority while adding modern software engineering features around it. That is also why the reference benchmark used to rank every supercomputer on Earth, HPL, the benchmark behind the TOP500 list, is itself written in Fortran.

Standards timeline

  1. 1957 · FORTRAN

    First shipped to IBM 704 customers in April, after being completed in late 1954.

  2. 1958 · FORTRAN II

    IBM's first revision.

  3. 1977 · FORTRAN 77

    Widely adopted standard that defined the language for a generation of scientific code.

  4. 1991 · Fortran 90

    Major modernization: free-form source, modules, array operations, dynamic allocation.

  5. 1997 · Fortran 95

    Refinement of Fortran 90, officially published.

  6. 2004 · Fortran 2003

    Adds object-oriented programming and C interoperability.

  7. 2010 · Fortran 2008

    Adds coarrays for native parallel programming.

  8. 2018 · Fortran 2018

    Refines coarray and interoperability features.

  9. 2023 · Fortran 2023

    The current standard, with continued modularity and parallelism improvements.

#13 on TIOBE, 1.45%

Fortran's position and share on the TIOBE programming language popularity index, March 2026.

StatisticsTimes: Top Computer Languages 2026

HPL benchmark itself is Fortran

The High-Performance LINPACK benchmark used to rank every machine on the TOP500 supercomputer list is itself written in Fortran.

TOP500

Fortran history and figures compiled from public sources, cited above. Corrections welcome.

Runtime error codes

View all 54
Error 71: Integer divide by zeroIntel Fortran · gfortran

Condition

An integer division operation attempted to divide by zero.

Fix

Add an explicit check for a zero divisor before the division. Integer division by zero is not trapped as a floating-point exception, so compiler flags for floating-point traps will not catch it; the check has to be in the code.

Pending source verification. Not yet checked against official documentation.
Error 73: Floating divide by zeroIntel Fortran · gfortran

Condition

A floating-point division operation attempted to divide by zero.

Fix

Add an explicit check for a zero divisor before the division, or compile with floating-point exception trapping enabled (for example gfortran's -ffpe-trap=zero) during development so the program stops at the exact division rather than continuing with an Inf value.

Pending source verification. Not yet checked against official documentation.
Error 65: Floating invalidIntel Fortran · gfortran

Condition

An operation produced a value with no valid mathematical result, such as taking the logarithm or square root of a negative number.

Fix

Check the domain of the input to the function involved before calling it, particularly for values coming from a calculation or from external data rather than a literal constant.

Pending source verification. Not yet checked against official documentation.
Error 72: Floating overflowIntel Fortran · gfortran

Condition

A floating-point calculation produced a result larger than the largest value the type can represent.

Fix

Check for a value growing unbounded across loop iterations, which is the most common practical cause, and confirm the variable's precision (default REAL versus DOUBLE PRECISION) is sufficient for the magnitude the calculation actually needs.

Pending source verification. Not yet checked against official documentation.

Frequently asked

Is Fortran still used in 2026?+

Yes, extensively in scientific and high-performance computing. Fortran ranked 13th on the TIOBE index as of March 2026, and the HPL benchmark used to rank every TOP500 supercomputer is itself written in Fortran.

Is Fortran outdated?+

The language itself is not: the current standard is Fortran 2023, and it's actively maintained. What's true is that Fortran's buyer (scientific/HPC) is different from every other language on this site, so it isn't compared fairly against general-purpose languages.

Do I need a PhD to get a Fortran job?+

No. Most roles that specifically say Fortran require a relevant bachelor's degree (math, CS, physics, or a domain field like meteorology), not a doctorate, per practitioners discussing hiring in the Fortran community.

Does Fortran have pointers, and are they different from pointers in C?+

Yes, Fortran has had a POINTER attribute since Fortran 90, but it works differently from C: a Fortran pointer must point to a target explicitly marked TARGET or POINTER, and ordinary array arguments without that attribute are assumed by the compiler not to alias each other. C makes the opposite default assumption, which is why C added the restrict keyword in C99 to let programmers opt in to the same non-aliasing guarantee Fortran has by default.

Is Fortran actually faster than C, or is that outdated advice?+

It depends on how the code is written. Fortran's default assumption that array arguments don't alias lets compilers vectorize naive code that a naive C compiler has to generate conservative, slower instructions for. But a benchmark from 0xfab.ch showed that hand-optimized C (using a thread-private accumulator, without even adding restrict) matched Fortran's throughput and hit the hardware bandwidth ceiling, concluding the real limiting factor is the hardware and how memory-conscious the code is, not the language by itself.

What is DO CONCURRENT in Fortran, and why does it matter for GPUs?+

DO CONCURRENT is a loop construct, standard since Fortran 2008, that tells the compiler a loop's iterations have no dependencies and can run in any order or in parallel, using only standard Fortran syntax rather than an external library or pragma. NVIDIA's HPC SDK compiler (nvfortran) can offload DO CONCURRENT loops directly to a GPU with the -stdpar flag, and NVIDIA reported roughly a 13x speedup on a Jacobi solver moving from 40 CPU cores to a single A100 GPU with no other code changes.

What did the Fortran 2023 standard actually add?+

Fortran 2023 (formally ISO/IEC 1539-1:2023) was published on November 17, 2023 after about five years of committee work, and added a reduction clause for DO CONCURRENT, two new enumeration-type mechanisms (including one interoperable with C enums), inline conditional expressions using a new ? syntax, generic-programming primitives (typeof() and classof()), and lower-bound support in the C_F_POINTER interoperability routine.

Is there a free, open-source Fortran compiler, and is it production-ready?+

gfortran, part of the GNU Compiler Collection, is the mature, widely used free option. LLVM's Flang is a newer open-source alternative that has closed most of the performance gap (reported within roughly 10% of gfortran's geometric mean on SPEC CPU 2017) and passes SPEC2017 correctness checks, but its own documentation still states plainly that it is not yet ready for production use.

Does Fortran have a package manager like npm or pip?+

Yes: fpm, the Fortran Package Manager, built and maintained by the fortran-lang community, with a public package registry for sharing libraries. It's actively developed, with version 0.13.0 released in February 2026 adding build profiles and expanded compiler support, addressing what was for decades a real gap in Fortran's tooling compared to newer languages.

From the community

Real questions from public forum threads, with credit to who asked and who answered. Our answer restates the fix and links to the matching reference page where one exists.

I get a segmentation fault allocating an array that was never allocated before, even though the dimension variable has the right value. What am I missing?

Asked by SamuG on Fortran Discourse, ongoing thread

The actual bug was a shape mismatch in a later assignment, writing a 2x6x6 Kronecker product result into a 2x4x4 slice of an allocatable array. Because the target was allocatable rather than fixed-size, the compiler could not catch the mismatch at compile time, and -fcheck=all did not catch this particular overflow either.

SamuG (self-resolved)

More conformant compilers, such as Intel's ifx, NAG's nagfor, and LLVM's flang, report this specific kind of element-count mismatch explicitly instead of allowing a silent buffer overflow.

themos

Our answer

The crash pointed at the allocate statement, but the real bug was several lines later, in an assignment writing a larger result into a smaller allocatable slice. If a segfault appears at an allocation that looks correct, check every later use of that array for a shape mismatch, and consider testing the same code under a stricter compiler like NAG's, which tends to surface this class of bug with a real error message instead of a crash.

Full reference page →

Can Fortran actually lead to a job without a PhD in science, math, or CS, or is it just a hobby language at this point?

Asked by Hlora1337 on Fortran Discourse, January 2026

A PhD is not required to contribute to real Fortran codebases; the math helps, but in the end it is still code. Learning complementary languages like Python or Julia, plus iso_c_binding for interoperability, strengthens a CV, and consultancy work around large existing Fortran codebases is a real path.

jorgeg

Most roles that actually say Fortran programmer require a bachelor's degree, not a PhD, commonly in mathematics, computer science, physics, or meteorology for fields like national weather services.

fxm

Our answer

The consensus is that Fortran itself is rarely the credential that gets you hired, a relevant bachelor's degree plus demonstrated ability to work in an existing large codebase usually is, but that combination is a realistic path, not a hobbyist dead end. Given how much of climate modeling, aerospace, and HPC still runs on Fortran, being one of the few candidates who can actually read it is a real advantage once you clear that bar.

More on Fortran