FORTRAN 77
The 1978 ANSI standard for Fortran that introduced structured programming features, the CHARACTER data type, and the file I/O model still recognizable in modern Fortran.
Created by ANSI X3J3 Committee
FORTRAN 77 is the 1978 ANSI standard revision of Fortran, formally designated ANSI X3.9-1978 and later adopted internationally as ISO 1539:1980. Although it carries “77” in its name — reflecting the year the draft was approved — the published standard appeared in April 1978. For more than a decade it was the dominant language of scientific and engineering computation, and its dialect remains the lingua franca of an enormous body of still-running numerical code.
History & Origins
By the late 1960s, FORTRAN 66 had standardized the language across vendors, but it lacked many features that programmers had come to expect from contemporaries like ALGOL 60 and PL/I. The ANSI X3J3 committee set out to modernize the language while preserving its enormous installed base.
The result, approved in 1977 and published the following year, was a careful balance: FORTRAN 77 retained the fixed-form source layout, six-character identifier limit (officially), and the overall punch-card heritage of FORTRAN 66, but it introduced features that brought it much closer to the structured programming style of the 1970s.
The Name “77”
Drafts and committee documents referred to the new standard by its expected approval year. When the document slipped into 1978 for formal publication, the “77” had already stuck — and so the language is universally known as FORTRAN 77 even though its standard number is X3.9-1978.
What FORTRAN 77 Added
Compared with FORTRAN 66, the 1978 standard introduced a substantial list of features that are now taken for granted:
Structured Control Flow
The block IF construct (IF ... THEN ... ELSE IF ... ELSE ... END IF) finally gave Fortran a structured conditional, reducing reliance on arithmetic IF statements and computed GOTOs.
The CHARACTER Data Type
Before FORTRAN 77, character data was awkwardly packed into integer or Hollerith variables. The new CHARACTER type, with declared lengths and a small set of intrinsic operations (substring, concatenation, lexical comparison via LGE, LGT, LLE, LLT), made text processing tractable for the first time in standard Fortran.
Modern File I/O
OPEN, CLOSE, and INQUIRE statements introduced a uniform model for connecting external files to logical unit numbers. List-directed I/O (READ *, ... / WRITE(*,*) ...) made simple input and output far less ceremonial.
PARAMETER, SAVE, and IMPLICIT
PARAMETERintroduced named constants.SAVEmade the lifetime of local variables explicit between calls.IMPLICIT(andIMPLICIT NONE, widely supported as an extension and standardized later) let programmers control or disable Fortran’s implicitI-Ninteger typing rule.
Generic Intrinsic Functions
Intrinsic functions like SQRT, LOG, and ABS became generic, dispatching on argument type rather than requiring DSQRT, CSQRT, and so on — though the type-specific names remained available.
Anatomy of a FORTRAN 77 Program
FORTRAN 77 is a fixed-form language. Each source line is divided into columns with specific meanings:
| Columns | Purpose |
|---|---|
| 1 | C or * in column 1 marks a comment line |
| 1–5 | Statement label (numeric) |
| 6 | Continuation character (any non-blank, non-zero) |
| 7–72 | Statement body |
| 73–80 | Ignored (historically for card sequence numbers) |
A canonical “Hello, World!” looks like this:
| |
The leading six spaces are not decoration — they are required by the column rules. Modern compilers like gfortran accept this source when invoked with -std=legacy or when the file is named with a .f or .for extension.
Design Philosophy
FORTRAN 77 was a conservative standard. The committee deliberately avoided breaking the vast investment in FORTRAN 66 code and skills: the new features were almost entirely additive, and most FORTRAN 66 programs compiled unchanged. This conservatism is the main reason FORTRAN 77 became so durable — institutions could adopt it incrementally without rewriting their libraries.
The flip side was that FORTRAN 77 inherited limitations that would not be addressed until Fortran 90:
- No dynamic memory allocation (no
ALLOCATABLEarrays) - No recursion in the standard (though many compilers permitted it as an extension)
- No modules; only
COMMONblocks for shared data - No derived types or pointers
- A six-character identifier limit in the standard (commonly relaxed in practice)
Evolution and Legacy
Fortran 90, published in 1991 as ISO/IEC 1539:1991, was a far more ambitious revision: free-form source, modules, array syntax, dynamic allocation, derived types, and recursion. It nonetheless preserved FORTRAN 77 as a strict subset, so legacy code continued to compile.
Subsequent standards — Fortran 95, 2003, 2008, 2018, and 2023 — have continued that tradition of backward compatibility. As a result, FORTRAN 77 source files written in the 1980s typically still compile and run today with modern toolchains such as gfortran, Intel’s ifx, NAG’s nagfor, and LLVM flang. Some obsolescent features (arithmetic IF, computed GOTO, fixed-form source itself) are flagged or require legacy modes, but they are not removed.
Current Relevance
FORTRAN 77 is no longer the language of choice for new projects, but its code is everywhere that numerical computing matters:
- LAPACK and the BLAS reference implementations originated in FORTRAN 77 and remain widely distributed in that form. High-performance vendor BLAS libraries (Intel MKL, OpenBLAS, BLIS) implement the same interfaces.
- NetLib hosts hundreds of FORTRAN 77 numerical packages (MINPACK, QUADPACK, FFTPACK, ODEPACK, SLATEC, EISPACK) that are still wrapped and called by modern scientific Python, R, and Julia code.
- Large climate, weather, and engineering codes contain substantial FORTRAN 77 subroutines, often interoperating with newer Fortran or C++ via wrapper layers.
Calling FORTRAN 77 from Python through SciPy, or from C via f2c and modern Fortran’s C interoperability, remains a common pattern in computational science.
Why It Matters
FORTRAN 77 is the standard that carried Fortran from its punch-card origins into the era of structured programming and made it the workhorse of computational science for the 1980s and much of the 1990s. Its careful conservatism — adding what was needed without breaking what existed — is the reason that code written for a VAX in 1985 can still be compiled and run, almost without modification, on a Linux laptop in 2026.
For anyone working with scientific libraries, legacy engineering code, or the deep history of high-performance computing, reading FORTRAN 77 is a basic literacy skill. It is the dialect in which an extraordinary amount of the world’s numerical infrastructure was written.
Timeline
Notable Uses & Legacy
LAPACK and LINPACK
The foundational dense linear algebra libraries used across scientific computing were originally written in FORTRAN 77; LAPACK's reference implementation remained Fortran 77 source for decades and is still widely distributed.
NetLib scientific libraries
The NetLib repository hosts a large collection of FORTRAN 77 numerical routines (BLAS, EISPACK, MINPACK, QUADPACK, FFTPACK) that remain in active use, often wrapped by higher-level languages like Python via SciPy.
NCAR Community Climate Model
Early generations of the NCAR Community Climate Model and related atmospheric codes were written in FORTRAN 77, and substantial portions of that code lineage remain embedded in current climate models.
Legacy engineering codes
Finite element analysis, computational fluid dynamics, and reservoir simulation codes from the 1980s and 1990s — many still in production at engineering firms — are predominantly FORTRAN 77.
SciPy numerical backends
Several routines exposed through SciPy (e.g., parts of scipy.optimize, scipy.integrate, scipy.special) wrap NetLib FORTRAN 77 code, compiled at install time.
Language Influence
Influenced By
Influenced
Running Today
Run examples using the official Docker image:
docker pull gcc:latestExample usage:
docker run --rm -v $(pwd):/app -w /app gcc:latest sh -c 'gfortran -std=legacy -o hello hello.f && ./hello'