Chapter 1 — Key Takeaways (Why Fortran?)
A one-page reference. This is a framing chapter, so the "takeaways" are arguments and facts, not syntax — the syntax starts in Chapter 2.
The two Fortrans
| FORTRAN 77 and earlier | Fortran 90 and later (what we teach) | |
|---|---|---|
| Written | ALL CAPS | Title case |
| Source form | fixed-form (columns matter) | free-form |
| Typing | implicit (by first letter) | implicit none + explicit |
| Organization | COMMON blocks, INCLUDE |
modules |
| Control flow | GOTO, arithmetic IF |
do/if/select case |
| Data structures | none | derived types, OOP |
| Memory | static | allocatable, dynamic |
| Parallelism | none in the language | coarrays (2008) |
Ask "which Fortran?" The gap between the two is larger than C-to-C++.
The timeline (memorize the bold ones)
1957 FORTRAN I · 1966 first standardized language · 1977 FORTRAN 77 (the classic) ·
1990 Fortran 90 (the modernization: free-form, arrays, modules) · 1995 Fortran 95 · 2003
(OOP, C interop) · 2008 (coarrays, submodules) · 2018 (our baseline) · 2023 (newest).
Why Fortran is fast (the two pillars)
| Pillar | What it means | Where we exploit it |
|---|---|---|
| First-class arrays | The language knows shape/bounds; whole-array ops (a = b + c) expose structure to the compiler |
Ch. 5, Ch. 27 |
| No aliasing | Procedure arguments assumed not to overlap → aggressive optimization (C needed restrict to catch up) |
Ch. 27 |
Why it persists (four forces)
- Speed for dense numerical computation.
- Legacy — an ocean of validated code (validation ≫ source).
- Domain fit — built for arrays, complex numbers, math intrinsics.
- Modern Fortran is genuinely good — modules, OOP, coarrays, C interop.
Honest claims (don't oversell)
| Slogan (avoid) | Honest version (use) |
|---|---|
| "Fortran runs every supercomputer." | "A large share of scientific application cycles on top machines is Fortran." (The OS is C/Linux.) |
| "Fortran is fast because it's low-level." | "Fortran is high-level; it's fast because the compiler can optimize array code freely." |
| "NumPy means you never need Fortran." | "NumPy is compiled C/Fortran; you need Fortran when the loop can't be a NumPy call — then Python is 50–100× slower." |
Where Fortran lives (and doesn't)
- Yes: weather (WRF), climate (CESM), CFD, quantum chemistry (VASP, Quantum ESPRESSO), nuclear, astrophysics, seismic processing, LAPACK/BLAS under NumPy/MATLAB/R.
- No: websites, mobile apps, quick scripts. Fortran is a specialist — know its boundary.
Key terms
high-level language · compiler · HPC (high-performance computing) · TOP500 · pointer aliasing · legacy code · free-form source · column-major order (met here, developed in Ch. 5).
The ethic
Never rewrite what you can refactor. Legacy scientific code is an inheritance — its validated numerics are worth more than the source. Modernize to preserve the science and improve the engineering.
Project piece added this chapter
Not code yet — a decision: choose your simulation domain (default: 2D heat equation) and write a
2–3 sentence problem statement into heat-solver/README.md. The program itself begins in Chapter 2.