Glossary

766 terms from Introduction to Fortran Programming

# A B C D E F G H I J K L M N O P Q R S T U V W X Z

#

(1) compile
the compiler translates each source file into an object file (machine code with references not yet resolved); **(2) link** — the linker combines the object file(s) with the libraries they need into a complete executable, resolving every reference; **(3) run** — the operating system loads and execute → Ch02
(1) precision
six decimals record only part of a double's ~15–16 significant digits, so the file is *not* a bit-exact record (round-trip loses information); and **(2) conversion time** — every value must be formatted to decimal on write and parsed back on read, far slower than copying raw bytes. At a **billion ce → Ch26
(`= huge(0_int32)`); line 2 prints
2147483648**. The phenomenon is → Ch13
An optimization mode in which the heavy optimization is deferred to the *link* step, where the whole program is visible at once, so the compiler can inline and analyze *across* source files (not just within one). Must be passed at both the compile and the link commands. Slower to build and harder to → Chapter 30 — Glossary (terms first-defined here)
-march=native
A flag telling the compiler to detect the exact CPU it is compiling *on* and emit code using every instruction that chip supports, most importantly its widest SIMD instruction set (e.g. AVX-512). Fast for vectorizable numerical code, but the resulting binary is not portable: on a different CPU lacki → Chapter 30 — Glossary (terms first-defined here)
-Ofast (and its caveats)
`-O3` + `-ffast-math`; relaxes IEEE, can change results. (Owned per outline.) - **-march=native** — build for this CPU's ISA; not portable. (Owned per outline.) - **-flto / link-time optimization** — cross-file optimization at link; both compile+link. (Owned per outline.) - **profile-guided optimiza → Chapter 30 — Continuity delta
.mod file
a compiler-generated file (e.g., `kinds.mod`) recording a module's public interface: the names, types, and signatures it exports. It is read by any unit that `use`s the module and must therefore exist before that unit is compiled. It is *not* the compiled code — the machine code lives in the `.o` fi → Ch08
100 minutes/day
over an hour and a half of pure waiting, and growing with the project. This is why → Ch02
12
then take the substring from `dot+1` to the end, `filename(13:)`, and `trim` off the padding blanks to get `'vtk'`. This is real filename parsing, and it is three intrinsics. → Introduction to Fortran Programming
2.8%
exactly the "three percent" they observed. The measurement was never mysterious; it was the arithmetic of the 80/20 rule. → Case Study 1: Chasing the Wrong Loop
28. †⭐⭐⭐ Flags policy (one page).
*Development build:* `-g -O0 -fcheck=all -fbacktrace` — catch mistakes early; debuggable. - *Release build:* `-O3 -march=native -flto`, checks removed — speed for real runs. - *`-Ofast` rule:* use only after the validation suite still passes at tolerance, and **record** that you used it — it relaxes → release, chosen by compiler identity:
2D heat-equation solver
modular, **validated** against an analytical solution, → Quiz Bank
3.0
text is about three times larger. → Ch07
before counting allocator bookkeeping per node, which makes the real gap worse. The list pays for a pointer (and padding) on every element; the array pays nothing beyond the data. → Ch11
62.5%
over a third of the machine is already wasted on this fixed problem. → Final Exam — Solutions
80% of the machine's peak
and your best blocked loop, perhaps 10–20%. That is an order-of-magnitude gap, and no reasonable amount of further hand-tuning closes it. Why does the library win so decisively? Three reasons, each a technique from this chapter taken to a level you should not attempt by hand: → Case Study 2: Optimizing a Matrix Multiply — and Learning to Call BLAS Instead
90% parallelizable
which sounds excellent. Then no matter how many processors you throw at it, you can never go faster than $$S_{\max} = \frac{1}{1 - 0.90} = \frac{1}{0.10} = 10\times.$$ Ten times, and not a hair more, even on a million cores. And you approach that ceiling slowly: on 8 processors, $$S(8) = \frac{1}{0. → Introduction to Fortran Programming
[CC BY-SA 4.0](LICENSE)
free to read, share, and adapt with attribution and share-alike. All code samples are additionally offered under the MIT license so you may reuse them in your own projects without restriction. → Introduction to Fortran Programming
`% time`
the fraction of total runtime spent *inside* this procedure. `laplacian_` is 78% of the program. This column alone usually tells you what to optimize. - **`self seconds`** — the raw seconds spent inside the procedure itself, not its callees. The flat profile is sorted by this. - **`cumulative second → Introduction to Fortran Programming
`-Ofast` / relaxed IEEE
`-O3` plus `-ffast-math`; permits reassociation and ignores parentheses. Can turn `(1e20 + -1e20) + 1` from `1.0` into `0.0`. Validate before trusting; connects to [Chapter 20](../../part-05-numerical-methods/chapter-20-floating-point/index.md). - **`-march=native`** — build for the exact host CPU's → Chapter 30 — Key Takeaways (Compiler Flags and Platform-Specific Optimization)
`-Ofast` changes results silently
no warning; can break compensated sums and cancellation-prone code. Validate against a strict build; record that you used it. - **`-march=native` in a shipped `Makefile`/`fpm.toml`** — builds a binary that may not run elsewhere. Put it behind an opt-in release profile. - **Timing a `-fcheck=all` bui → Chapter 30 — Key Takeaways (Compiler Flags and Platform-Specific Optimization)
`=>` moves the alias, `=` writes the value
confuse them and you corrupt data silently. Second, the rule that governs the whole chapter: → Introduction to Fortran Programming
`a`
`shared`: read-only; every thread safely reads the same one copy. - **`n`** — `shared`: read-only scalar bound. - **`j`** — `private`: it is the `!$omp do` loop index, made private automatically, but under `default(none)` you must name it. Each thread needs its own. - **`i`** — `private`: the **inne → Final Exam — Solutions
`abstract interface`
a named interface block that specifies the procedure's arguments and result but no body. Inside that interface body, the `import` statement is *required*: the interface is its own scoping unit, so it does not automatically see the `shape_t` type or the `dp` kind from the surrounding module, and `imp → Introduction to Fortran Programming
`c_ptr`
an opaque derived type interoperable with any C object pointer (`void *`, `double *`, and so on). A `type(c_ptr)` variable carries an address and nothing else. - **`c_funptr`** — the same idea for a C *function* pointer, used for callbacks. → Introduction to Fortran Programming
`class(...)`, not `type(...)`
get this wrong and nothing compiles. Second: **allocatable components give you value semantics** — `b = a` makes an independent deep copy and cleanup is automatic, which is exactly why you prefer them to pointer components for scientific data. → Introduction to Fortran Programming
`class`
a declaration (`class(base_t)`) making a variable, component, or dummy argument **polymorphic**: at run time it may hold `base_t` or any type that extends it. Its declared type (fixed, seen by the compiler) may differ from its dynamic type (the actual type held now). Contrast `type(base_t)`, which i → Ch10
`classof`
the polymorphic companion to `typeof`: `classof(x)` declares an entity polymorphic over the declared type of `x` (the `class(...)` analogue). Both `typeof` and `classof` are steps toward a full generics facility. → Ch39
`cpu_time`
The Fortran intrinsic subroutine `call cpu_time(t)` that returns the processor time (CPU-seconds) consumed by the program so far, as a real number. Only differences between two readings are meaningful; idle time (I/O waits, being descheduled) is not charged to it, and on most implementations it sums → Ch28
`default(none)`
it refuses to guess an attribute for any variable, so the unscoped `j` becomes a compile error instead of a silent runtime race. → Final Exam — Solutions
`do concurrent`
fast, **bit-for-bit identical** to Chapter 24, and ready to go parallel behind the same interface. Next, [Chapter 30](../chapter-30-compiler-flags/index.md) picks the flags that finish the job. → Chapter 29 — Key Takeaways (Optimization Techniques)
`do concurrent` (performance use)
A loop form in which the programmer asserts to the compiler that the iterations are independent and may execute in any order or simultaneously. It is an unchecked promise that frees the compiler to vectorize, reorder, unroll, or (with the right flags/compiler) parallelize; it does not by itself guar → Ch29
`elemental` with scalar-only args
both standard-conforming; verified against the rules (pure permits optional; elemental requires scalar dummies). No uncertainty, noted for the reviewer's awareness. → Chapter 6 — continuity delta
`EQUIVALENCE` is deliberate aliasing
the exact thing modern Fortran forbids to go fast (tie back to Chapter 1's no-aliasing advantage). Diagnose the *intent* (reuse / reshape / bit-reinterpret) before replacing it; each maps to a different modern construct (`allocatable` / `reshape` / `transfer`). - **Implicit typing has two edges:** t → Chapter 17 — Teaching Notes
`final`
a subroutine listed under `final ::` in a type's `contains` section, called automatically ("finalization") just before an object of that type is destroyed (by `deallocate`, scope exit, or before being overwritten in an intrinsic assignment). Fortran's destructor. Its dummy argument is `type(...)`, n → Ch10
`fortran-lang.org`
the community hub: learning resources, the package manager **fpm**, the **standard library (stdlib)**, an in-browser **playground**, and news. Start here. - **`fortran-lang.discourse.group`** — the friendly, active community forum. - **GCC / `gfortran` documentation** — the manual for the free compi → Appendix J: A Fortran Timeline and Resource Guide
`fortran-lang.org` playground
instant feedback is the fastest way to lock in loop semantics. 3. When a rule surprises you (the value of a `do` variable after the loop; why `real` `case` labels are forbidden), look it up in **Metcalf, Reid, and Cohen**. 4. Once you have written a few loops of your own, read **Dijkstra's letter** → Further Reading: Control Flow
`fortran-lang/setup-fpm@v5`
the action exists; the major-version tag should be confirmed against the current release before a real repo uses it (Tier 2 in bib). - Everything numeric above is hand-verified and I am confident in it. → Chapter 37 — Continuity delta
`h5py`
proof that the format is a clean, language-neutral interface. → Chapter 25 — Further Reading
`ifort`
the classic Intel Fortran compiler, decades old and long the gold standard for speed on Intel CPUs. Intel has announced its **deprecation** in favor of `ifx`; new work should target `ifx`. - **`ifx`** — the newer, LLVM-based Intel Fortran compiler, the go-forward tool. It shares Intel's optimizer he → Introduction to Fortran Programming
`index.md`
the chapter itself: the concepts, the worked code, the diagrams, and one increment of the running project. This is the part you read. 2. **`exercises.md`** — 25–35 graded problems (⭐ / ⭐⭐ / ⭐⭐⭐). They ask you to *type, compile, and run*; to *port* a Python or MATLAB snippet and compare speeds; to *f → How to Use This Book
`info`
the integer status argument returned last by every LAPACK computational routine. `info = 0` means success; `info < 0` means the `(-info)`-th argument had an illegal value (almost always a bug in the caller's argument list); `info > 0` reports a routine-specific numerical failure (for `dgesv`, an exa → Ch21
`integer`
a whole number, positive, negative, or zero, stored exactly. Loop counters, array indices, grid dimensions, step numbers. - **`real`** — a floating-point number with a fractional part, stored *approximately*. Temperatures, velocities, physical quantities. By default this is *single* precision, about → Introduction to Fortran Programming
`intent(in)`
read-only (the procedure may read but not write the argument); **`intent(out)`** — write-only (the argument arrives *undefined* and the procedure must set it); **`intent(inout)`** — read and write (a meaningful value comes in and may be modified in place). The free bug-catch: the compiler **enforces → Midterm Exam — Solutions
`intent(in/out/inout)`
a safety feature most languages lack. - **6.3** Optional and keyword arguments. - **6.4** `pure` and `elemental` procedures (and why they help the optimizer — foreshadow Ch.27). - **6.5** Internal procedures (`contains`) and recursion. - **6.6** Array arguments: **assumed-shape** vs explicit-shape v → Introduction to Fortran Programming — Master Outline
`intent(out)` wipes the incoming value
use `intent(inout)` if you need it (e.g., an accumulator). - **Using an absent optional** without a `present` guard — undefined behavior. - **Forgetting the `result` clause** on a recursive function — the name becomes ambiguous. - **`a(*)` in new code** — silently defeats bounds checking; use `a(:)` → Chapter 6 — Key Takeaways (Procedures)
`ipiv`
the integer pivot array (length `n`) that `dgesv` and the LU factorizations use to record the row interchanges made by partial pivoting; required as workspace-plus-output even when the caller never inspects it. → Ch21
`jobz`
`'N'` to compute eigenvalues only, `'V'` to compute eigenvectors as well. - **`uplo`** — `'U'` or `'L'`: which triangle of the symmetric `a` you filled (LAPACK reads only one). - **`n`, `a`, `lda`** — the order, the matrix, and its leading dimension, as before. On exit, if `jobz='V'`, `a` holds the → Introduction to Fortran Programming
`n`
the order of the system: $A$ is `n`×`n`. (Input.) - **`nrhs`** — the number of right-hand sides. You usually have one vector $\mathbf{b}$, so `nrhs = 1`; but LAPACK will solve for many right-hand sides at once if you pass $B$ as an `n`×`nrhs` matrix. (Input.) - **`a`** — the coefficient matrix $A$, → Introduction to Fortran Programming
`namelist` I/O
key/value input files, invaluable for scientific codes. - **7.5** Unformatted (binary) and stream I/O for large datasets. - **7.6** Error handling on I/O: `iostat`, `iomsg`. - **First-define:** edit descriptor, list-directed I/O, `namelist`, unformatted/stream I/O, `iostat`/`iomsg`. - **Project Chec → Introduction to Fortran Programming — Master Outline
`newunit=u`
runtime picks a free unit; never hard-code `open(17, ...)`. - **`status=`** — `'replace'` (create/overwrite), `'old'` (must exist), `'new'` (must not), `'scratch'` (temporary, auto-deleted). - **`action=`** — `'read'`, `'write'`, `'readwrite'`. - **Sequential** (default) = records in order. **Direct → Chapter 7 — Key Takeaways (I/O and Formatted Output)
`present(arg)`
the one new intrinsic this chapter: true if the caller supplied `arg`. - After the first keyword argument in a call, **all** following arguments must be keyword. - Never read an absent optional's value; forward an absent optional straight through if you must. → Chapter 6 — Key Takeaways (Procedures)
`restrict`
a C99 type qualifier by which a C programmer promises, per pointer, that the object it points to is accessed only through that pointer (i.e., it does not alias) — the manual, opt-in, per-pointer, easy-to-get-wrong equivalent of the non-aliasing Fortran guarantees automatically for every argument. Na → Ch27
`select type`
a construct that inspects a polymorphic object's dynamic type and runs a different block for each: a `type is (t)` guard matches the exact dynamic type `t`; a `class is (t)` guard matches `t` or any extension (most specific match wins); `class default` catches the rest. Inside a matched block the ob → Ch10
`stat`/`errmsg` is `iostat`/`iomsg` for memory
guard every `allocate`, test the integer, show the message, and `error stop` with a chosen code so failure is visible to the outside world. Second, **an initializer in a declaration confers an implicit `save`** — `integer :: n = 0` inside a procedure is set once and persists, not reset per call; ass → Introduction to Fortran Programming
`static`
the iteration range is divided into equal chunks *once, before the loop runs*, and dealt out > round-robin to threads; low overhead and reproducible, ideal for uniform work. **`dynamic`** — threads grab > a chunk of iterations, and when a thread finishes its chunk it comes back for another, at run t → Introduction to Fortran Programming
`sync all` is a sledgehammer
it makes *every* image wait for *every* other, even images that had nothing to exchange. When two specific images need to coordinate and the rest should keep working, use the scalpel: → Introduction to Fortran Programming
`system_clock` (the timing idiom)
The Fortran intrinsic `system_clock(count, count_rate, count_max)` that reports an integer tick `count` from a processor clock, the `count_rate` (ticks per second), and the `count_max` at which `count` wraps to zero. Wall-clock elapsed seconds = `real(count_end - count_start, dp)/real(count_rate, dp → Ch28
`system_clock` improvements
mentioned only glancingly in earlier drafting; ultimately I did NOT make a specific claim about it in the final text (avoided asserting details I was unsure of). 8. **C-interop F2023 additions** — described qualitatively ("C-string helpers, interoperable-type refinements") without naming specific pr → Chapter 39 — continuity delta
`timers.f90` / `timers`
`tic()` / `toc() result(seconds)` wrapping the `system_clock` idiom; module state is saved by design. Used to time the `step` loop and establish the **serial baseline per-step time** — the figure of merit Chapters 29, 30, and 38 drive down. gprof confirms the hot loop is the stencil in `laplacian`. → Chapter 28 — Key Takeaways (Profiling and Benchmarking)
`typeof`
a Fortran 2023 declaration type specifier, `typeof(x)`, that declares an entity to have the same declared type and type parameters as an existing entity `x`, without naming that type explicitly. → Ch39
`write_field_netcdf(field, filename, step, time)`
takes the Ch. 9 `field_t`, writes a self-describing, CF-labelled, `NF90_NETCDF4` snapshot. The scalable alternative to Ch. 7's text `write_field`; interchangeable at the call site (one bundled arg + filename). Because it is NetCDF-4 (HDF5 underneath), adding `chunksizes=`/`deflate_level=` later buys → Chapter 25 — Key Takeaways (Scientific Data Formats)
`write_vtk(field, filename, step)`
the canonical signature from `_style-bible.md §4` (VTK writer, in `heat_io`), kept verbatim. `field_t` components used as canonical (nx, ny, dx, dy, `u(:,:)`). No change to any existing public interface; `write_vtk` is a new addition. Filename comes from the caller (`frame_name(step)`); `step` is us → Chapter 26 — continuity delta
⭐ Foundational
one idea, short code, predict-then-run. - **⭐⭐ Applied** — combine the stencil, stepping, stability, and boundaries into working code. - **⭐⭐⭐ Challenge** — a derivation, a higher-order scheme, or an implicit method; expect to think. → Chapter 24 Exercises — Partial Differential Equations and Finite Differences
💡 Intuition
the mental model. **⚠️ Common Pitfall** — a mistake people actually make. > **🔗 Connection** — a link to another chapter or a real code. **🧩 Try It Yourself** — predict, then > compile. **🔄 Check Your Understanding** — quick retrieval questions. **🚪 Threshold Concept** — an idea > that changes how y → How to Use This Book
📖 Standard
read straight through; this chapter frames everything that follows. > - **🔧 Legacy** ("I inherited old code") — §1.1 and §1.4 are your orientation; the "punch-card" Fortran > you fear is defined in §1.1 and dismantled in [Part IV](../../part-04-legacy-fortran/_part-intro.md). > - **⚡ HPC** ("I need → Introduction to Fortran Programming
🔬 Scientist
this is your chapter; read all of it. §5.3–5.4 (whole-array operations and > intrinsics) will change how you write numerical code, and §5.6 (column-major) is why your code will be > fast. > - **📖 Standard** — read straight through; arrays are load-bearing for every chapter that follows. > - **🔧 Lega → Introduction to Fortran Programming

A

a 2D heat-equation solver.
**First edition — 2026.** → Introduction to Fortran Programming
A `real(dp)` is not a real number
it is one point on a finite, unevenly spaced grid of about $2^{64}$ values. Every literal and every result is snapped to the nearest grid point. Arithmetic on the grid is commutative but **not associative**, most decimals are not representable, and `==` is a trap. → Chapter 20 — Key Takeaways (Floating-Point Arithmetic)
A broken timer is worse than no timer
it produces confident nonsense. Read `count_rate`, use `int64` counters, subtract, divide. - **Compute the size of the prize before paying for it.** A routine that is 4% of the runtime caps the whole program's speedup at ~4%, no matter how clever the rewrite; the flat profile plus the formula $S = 1 → Case Study 1: Chasing the Wrong Loop
A genuine loop-carried dependence
the loop body reads a value written in a previous iteration (e.g. a recurrence `x(i) = x(i-1) + …` or a running sum). *Check:* does element `i` depend on element `i-1`? If so it is inherent; consider a different algorithm (prefix-sum, or a reduction the compiler recognizes). (2) **An aliasing worry → Ch27
A GPU punishes work that is:
**Small.** Too little work to cover the transfer and launch overhead — you spend more setting up the GPU than computing. - **Branchy or irregular.** Heavy data-dependent branching makes threads in a warp **diverge** — take different paths — and the hardware must run the paths serially, one after ano → Introduction to Fortran Programming
A GPU rewards work that is:
**Massively data-parallel.** Thousands of independent, identical operations — one per grid cell, per particle, per pixel. The GPU has thousands of cores; it needs thousands of independent work-items to fill them. This is the **data parallelism** of [Chapter 31](../chapter-31-why-parallel/index.md), → Introduction to Fortran Programming
A-stability
the property of an integrator that its numerical solution of $y' = \lambda y$ ($\operatorname{Re}\lambda < 0$) decays for every step size $h > 0$; backward Euler has it, explicit methods do not. → Chapter 23 glossary — terms first-defined
absorbed
the running sum stays exactly $10^{17}$. When the large value is finally subtracted, nothing of the small values remains. Result: `0.0`, off by the entire true total. → Case Study 1: The Energy Diagnostic That Depended on Loop Order
absorption
the loss of a small value when it is added to a much larger running sum and falls below half a ULP of it, so the sum is unchanged. The mechanism behind floating-point addition being non-associative. → Ch20
abstract type
a derived type declared `type, abstract :: t` that cannot be instantiated (no `type(t)` variable, no `allocate(t)`), existing only to be extended. It defines the common components and, via `deferred` bindings, the interface that extensions must fulfill. → Ch10
accelerator
the general term for a specialized device attached to a CPU to speed up a particular kind of computation; a GPU is by far the most common accelerator in scientific computing, and in Fortran contexts the two words are effectively interchangeable. → Ch35
actual argument
the specific value or variable a caller passes to a procedure, associated by position (or by keyword) with the procedure's dummy arguments. → Ch06
adaptive integration
a quadrature scheme that automatically refines its sampling where the integrand is hardest, guided by a run-time error estimate: apply a rule to an interval and to its two halves, and subdivide (recurse) wherever the two disagree by more than the tolerance. → Ch22
adaptive step size
a scheme that estimates each step's local error and adjusts $h$ (rejecting and shrinking, or accepting and growing) to keep the error near a tolerance. → Chapter 23 glossary — terms first-defined
adjustl / adjustr
the justification intrinsics: `adjustl` left-justifies (removes leading blanks and appends that many at the end); `adjustr` right-justifies (removes trailing blanks and prepends that many at the front). Both preserve the string's length — blanks are moved, not deleted. → Ch12
Adopt an SoA type
one `particles` type whose *components are arrays* (`real(dp), allocatable :: x(:), y(:), …`) — if profiling shows the hot loops are single-field sweeps. You still get one named object and safe argument passing; the arrays just live inside it. This is Exercise 9.23(b). 3. **Only refactor the interfa → Case Study 1: From Six Arrays to One Type
algorithm
and confusing them is the most common mistake in numerical work. → Introduction to Fortran Programming
aliasing
the very thing modern Fortran works hard to forbid, because forbidding it > is [what makes Fortran fast](../../part-01-foundations/chapter-01-why-fortran/index.md). → Introduction to Fortran Programming
Aliasing an existing object
giving a compact name to a piece of a larger structure, or letting two parts of a program share one object. An allocatable *owns* memory and cannot point at data that already exists; a pointer can. - **Genuine linked structures** — when the problem really is a frequently-restructured graph or list a → Introduction to Fortran Programming
allocatable array
an array declared with the `allocatable` attribute and a deferred shape (`a(:)`), sized at run time with `allocate`, released with `deallocate`, and automatically deallocated when its local scope ends; `allocated` tests its state. → Ch05
allocatable component
a component of a derived type that has the `allocatable` attribute; its size (or, for a character, its length) is set at run time rather than in the type definition. Assignment of the containing derived-type variable performs a *deep copy* of the component (independent storage), and the component is → Ch09
Amdahl ceiling
the maximum speedup on *unlimited* cores — which is $1/(1 - p)$. With $p = 0.8$ (80% parallel), that is $1/0.2 = 5$. No matter how many cores you add, the remaining 20% serial work caps the speedup at 5×. → Quiz Bank
Amdahl's Law
for a program with parallelizable fraction $p$ and serial fraction $1-p$, run on $N$ processors, the speedup is $S(N) = 1/((1-p) + p/N)$; as $N \to \infty$ it is capped at $S_{\max} = 1/(1-p)$. Governs strong scaling (fixed problem size): the serial fraction limits the achievable speedup no matter h → Ch31
Amount of code
OpenACC is a single `!$acc parallel loop` directive on ordinary Fortran; CUDA Fortran is an explicit `attributes(global)` kernel plus device-array declarations, a launch config, and hand-written index arithmetic. (2) **Portability** — OpenACC is an open standard compiled by several compilers and can → Ch35
an intent on every argument, always
it is the cheapest bug prevention in the language and the habit that most separates robust Fortran from fragile Fortran. Second, → Introduction to Fortran Programming
append-only
each tool that touches the data adds a line — so the attribute becomes a running log > of everything that was ever done to the file, letting a result be traced back to the code, inputs, and > steps that produced it. > 3. `long_name` is unrestricted free text; `units` must come from UDUNITS; `standar → Introduction to Fortran Programming
Appendix G, the parallel-programming reference
the send/recv/collective signatures, the datatypes, `MPI_PROC_NULL`, and the `use mpi` versus `mpi_f08` comparison, in one place. → Further Reading: MPI
arithmetic intensity
the ratio of floating-point operations performed to bytes (or numbers) moved from memory; the quantity that separates the compute-bound Level-3 BLAS (high intensity, near-peak achievable) from the memory-bound Levels 1 and 2 (low intensity). "Cast the work as Level-3 BLAS" is the practical form of " → Ch21
array constructor
an inline rank-1 array value built from a bracketed list, e.g. `[1.0_dp, 2.0_dp, 3.0_dp]`; higher-rank arrays are made by pouring a constructor into `reshape`. → Ch05
array descriptor
a handful of > words recording the base address, extents, and strides — rather than a bare pointer. That indirection is > normally negligible. It matters only in two situations: extremely hot inner loops where the tiny > per-access overhead adds up, and cases where the actual argument is a *non-cont → Introduction to Fortran Programming
array section
a subarray selected with a subscript triplet `lower:upper:stride` in one or more dimensions (a lone `:` meaning the whole extent). A section is a first-class array value: it can be read, assigned to, passed to a procedure, and used in any array expression. → Ch05
array sections
eight shifted copies of the grid summed into a neighbor count, then one masked assignment for the rule — and verify it on the classic "blinker." The payoff is not just elegance: this *is* a stencil computation, structurally identical to the heat-solver Laplacian you built in the Project Checkpoint, → Case Study 2: A Stencil in Nine Lines
Array-of-Structures
one array of a particle type: → Ch09
Arrays are first-class objects
the language knows an array's shape and bounds, and whole-array operations expose that structure to the compiler. (b) **Procedure arguments are assumed not to alias** — the compiler may assume distinct arguments occupy distinct memory, which licenses aggressive reordering and vectorization. → Ch01
arrays go in as `a(:,:)`
assumed-shape is safe, self-describing, and works with every array intrinsic; the alternatives are for special cases you will recognize when you meet them. → Introduction to Fortran Programming
assertion
a statement placed in the code declaring that a condition the programmer believes must be true at that point actually is; if false, the program halts at once with a diagnostic, because a false assertion means a bug has already happened. Fortran has no built-in assert, so one is written as a small pr → Ch13
associated
it is > currently a valid alias for some target or allocated memory; **disassociated** — it is explicitly tied to > nothing, the state produced by `nullify(p)` or by initializing `p => null()`; or **undefined** — it has > never been given a status at all, the state of a freshly declared pointer with → Introduction to Fortran Programming
association status
the state of a pointer, one of: *associated* (a valid alias for a target or allocated memory), *disassociated* (explicitly pointing at nothing, via `nullify` or `=> null()`), or *undefined* (never initialized). `associated(p)` distinguishes the first two but must never be called on an undefined poin → Ch11
assumed-length character
a dummy-argument declaration `character(len=*)` that takes its length from the actual argument the caller passes; the character analog of an assumed-shape array argument, used on essentially every string procedure argument. → Ch12
assumed-shape
a dummy array argument declared with colons for its dimensions (`a(:,:)`), whose shape is taken automatically from the actual argument; the modern default. Its lower bounds default to 1 and it requires an explicit interface. → Ch06
assumed-size array
the legacy FORTRAN 77 dummy array form `a(*)` whose last extent is unknown to the procedure, defeating `size`, whole-array operations, and bounds checking; avoid in new code. → Ch06
auto-vectorization
The compiler's automatic transformation of an ordinary scalar loop into one that uses SIMD instructions, processing several iterations per instruction, without the programmer writing any intrinsics or assembly. Requires (at `-O2`+) independent iterations, unit-stride access, a countable trip count, → Ch29
automatic deallocation
the string is freed when it goes out of scope, with no manual cleanup and no leak; and (2) **no aliasing** — an allocatable string cannot be aliased by a pointer, so assignment deep-copies (`s = t` gives an independent, correctly sized copy) and the compiler can optimize freely. A pointer string wou → Ch12

B

backward (implicit) Euler
the implicit first-order method $y_{n+1} = y_n + h f(t_{n+1}, y_{n+1})$; A-stable, the simplest method suited to stiff problems. → Chapter 23 glossary — terms first-defined
backward compatibility for careful, public growth
the same machinery keeps your legacy code compiling *and* delivers new features, which is exactly why the language is neither frozen nor dead. And always: separate what *shipped* (2023 facts) from what is *coming* (proposals), in your code and in your claims. → Introduction to Fortran Programming
benchmark methodology
The disciplined practice of measuring performance so the numbers are meaningful and reproducible: warm up before timing, repeat the measurement many times, report a robust statistic (minimum or median, not a lone sample) with its spread, control the environment (release build, quiet machine, fixed f → Ch28
bind(c)
an attribute giving a Fortran entity C linkage. On a procedure it produces a predictable, un-mangled binding label (the symbol a C linker resolves), set exactly by an optional `name=` clause or defaulting to the lower-case Fortran name; on a derived type it makes the type interoperable (C-struct lay → Ch14
bit-for-bit
an absolute tolerance of zero on the interior field (parsing the numbers, ignoring the cosmetic iteration-count format). Failure: any interior temperature differs from the reference by more than zero (or, if you allow for a deliberate later precision change, by more than the small tolerance you then → Ch18
bit-for-bit reproducibility
agreement of two computations to the last bit of every floating-point value; achievable only when precision, operations, and their order are preserved, and it is a property of the source *together with* the compiler and its flags. → Ch18
BLAS
the Basic Linear Algebra Subprograms: a standardized set of low-level routines for the fundamental operations of linear algebra, organized into three levels — Level 1 (vector-vector, $O(n)$ work), Level 2 (matrix-vector, $O(n^2)$), and Level 3 (matrix-matrix, $O(n^3)$). The reference implementation → Ch16
BLAS levels
the three-way grouping of the Basic Linear Algebra Subprograms by operand shape and arithmetic intensity. **Level 1** is vector–vector work, $O(n)$ operations on $O(n)$ data (e.g. `daxpy`, `ddot`); **Level 2** is matrix–vector, $O(n^2)$ operations on $O(n^2)$ data (e.g. `dgemv`); **Level 3** is matr → Ch21
blinker
three live cells in a row — which is famous for oscillating between horizontal and vertical with period two. If our code turns a horizontal blinker into a vertical one in a single step, it is right. → Case Study 2: A Stencil in Nine Lines
bridge between host and device
historically the PCI Express bus, and even on the tightest modern interconnects — is dramatically slower than either processor's access to its *own* memory. Data crossing that bridge is the slowest step in most GPU programs by a wide margin. → Introduction to Fortran Programming
buffer, count, datatype, dest, tag, comm, ierr
the single most-fumbled thing. - Reduce → root only; **all**-reduce → everyone (use it for global convergence tests). - MPI standardised **1994**; portable across a laptop and the largest cluster on Earth. - A correct decomposition prints the **identical** field on any process count — that is your c → Chapter 34 — Key Takeaways (MPI)
build configuration
the complete set of choices that determine how source is turned into a program: the compiler and its version, the optimization and debugging flags, which optional code paths and preprocessor macros are enabled, the precision, and the exact versions of every external library linked in. A debug build → Ch36
build the Python interface
`intent(in)` becomes a Python argument, `intent(out)` becomes a return value, `intent(inout)` becomes an in-place argument. So a habit you adopted purely for correctness turns out to be precisely the metadata f2py needs to generate a clean Python signature. Careful Fortran wraps itself; sloppy Fortr → assemble frame_*.png into a movie with your tool of choice
Bulky
~24 chars vs 8 bytes per double, ~3× inflation → **fixed** (binary writes the exact 8 bytes). (2) **Slow** — a decimal conversion per value each way → **fixed** (no conversion). (3) **Lossy** — formatted text can drop digits → **fixed** (exact bytes, bit-for-bit round trip). (4) **Mute** — no record → Ch25
Butcher tableau
the compact table of stage nodes, coupling coefficients, and final weights that specifies a Runge-Kutta method. → Chapter 23 glossary — terms first-defined

C

C-contiguous
a NumPy memory layout (row-major) in which the *last* array index varies fastest in memory; rows are stored one after another. NumPy's default. The opposite of Fortran's layout, so a C-contiguous array must be copied to be passed to Fortran. Checked with `a.flags['C_CONTIGUOUS']`. → Ch15
C-interoperable kind
a Fortran kind parameter, exported by `iso_c_binding`, whose objects share their representation bit for bit with the corresponding C type, so values pass to and from C without conversion. If no matching Fortran kind exists on a platform, the constant is negative. (E.g. `real(c_double)` matches C `do → Ch14
cache blocking (tiling)
A loop-nest restructuring that works on small blocks (tiles) of data that fit inside a fast cache level, finishing all the work that reuses a tile before advancing. It captures data reuse in cache instead of re-reading from main memory. Pays for high-reuse, compute-bound kernels (matrix multiply) an → Ch29
cache line
the fixed-size contiguous block of memory (typically 64 bytes = eight `real(dp)`) transferred between main memory and cache as a single unit. You never load one value, only the whole line containing it. Using all of a fetched line before it is evicted is what makes cache-friendly (with-the-grain) lo → Ch27
cachegrind
The valgrind tool (`valgrind --tool=cachegrind`) that runs a program on a *simulated* machine with a modelled cache hierarchy (I1, D1, LL) and counts every memory reference and miss. Its counts are deterministic and reproducible but model a generic cache; `cg_annotate` attributes misses to individua → Ch28
call graph
The gprof report that shows the caller/callee structure with time attributed along the edges: for each procedure, its callers appear above and its callees below, and its time is split into "self" and "children." It explains *why* a routine is hot (who calls it, how often). → Ch28
cannot be passed in the wrong order
one object with named components replaces five loose scalars/arrays that are easy to transpose. (2) The interface is **stable and self-documenting**: `write_field_netcdf(field, ...)` says what it operates on, and adding a component to `field_t` (say `dz`) does not change the routine's signature. (Al → Introduction to Fortran Programming
Case/spelling of `# vtk DataFile Version 3.0`
exact, or rejected. - **`POINT_DATA` count off by one** — the field silently shifts; compute it, never hard-code it. - **Transposed picture** — you looped `i` outer; VTK needs `i` inner. - **Frames play out of order** — filenames not zero-padded. - **gnuplot draws nonsense** — missing the blank line → Chapter 26 — Key Takeaways (Visualization Output)
catastrophic cancellation
the severe loss of significant digits when subtracting two nearly equal floating-point numbers: the shared leading digits cancel, promoting the operands' small rounding errors into the leading digits of the result. Cured by rearranging the algebra (e.g. the conjugate trick) so the near-equal subtrac → Ch20
central
difference derivative in double precision ($\varepsilon \approx 2.2\times10^{-16}$), given that truncation error is $\sim h^2$ and round-off error is $\sim \varepsilon/h$. Compare with the forward difference's $h^{*}\sim \sqrt\varepsilon$. → Chapter 22 Exercises: Numerical Integration and Differentiation
CESM
large, community-developed, Fortran, and decades old in its lineage. Such a code discretizes the atmosphere into a three-dimensional grid of millions of cells and marches the physical state (wind, temperature, pressure, moisture) forward in time by solving the governing equations of fluid flow and t → Case Study 1: The Anatomy of a Survivor
CF conventions
The Climate and Forecast metadata conventions: a community standard for the attributes in a NetCDF file, so the data is unambiguous and machine-interpretable. CF specifies a `units` attribute (from UDUNITS) on every variable, an optional `standard_name` from a controlled vocabulary plus a free-text → Ch25
cffi
the C Foreign Function Interface — is a third-party package (widely used, originally from the PyPy project) with the same goal as ctypes but an interface many prefer: you paste the C declarations (`double c_sum_squares(double *x, int *n);`) and cffi compiles and manages the binding. Like ctypes, it → Introduction to Fortran Programming
CFL condition
The stability requirement that an explicit scheme's timestep be small enough, named for Courant, Friedrichs, and Lewy (1928). Intuition: the scheme sees only as far as its stencil (one cell) per step, so $\Delta t$ must keep the physics within about one cell. For 2D explicit heat: $r = \alpha\Delta → Ch24
CFL limit
the timestep must stay below a stability bound, or the simulation blows up. **Implicit** stepping removes that limit: you may take arbitrarily large timesteps stably, but each step now requires *solving a linear system*. That is where LAPACK enters the solver. Here we take one implicit (backward-Eul → Introduction to Fortran Programming
Ch. 17
I described their behavior in §2.5/§2.6 and pointed forward to Ch. 17 rather than giving them the formal Definition device. *kind parameter / `dp` / `selected_real_kind` / integer division* are owned by **Ch. 3** — I *used* `real(dp)` and the `_dp` suffix (via `use iso_fortran_env, only: dp => real6 → Chapter 2 — continuity delta
Ch. 7
§25.1 scales them up and links back heavily); derived type / `field_t` / allocatable component / type-bound `init` (**Ch. 9** — the project checkpoint serializes `field_t`, links back); column-major order / assumed-shape (**Ch. 5/6** — used in the row-major-vs-column-major display pitfall); `error s → Chapter 25 — continuity delta
Ch.38 (capstone climax).
**LAPACK from Fortran:** Ch.5 (`matmul` foreshadow) → Ch.16 (named in the ecosystem) → **Ch.21 (climax: `dgesv`, `dsyev`)** → Ch.29 (tuned BLAS beats a hand-rolled loop). - **A FORTRAN 77 code modernized:** Ch.17 (read the 200-line F77 program) → **Ch.18 (modernize it, step by step)** → Ch.19 (the t → Continuity & Cross-Reference Ledger — Introduction to Fortran Programming
Chapter 9 (Derived Types)
the foundations this chapter is built on. Answer before checking. → Introduction to Fortran Programming
character intrinsic
`index`, `scan`, `verify` to search; `trim`, `adjustl`, `adjustr` to clean up — and compute what each one returns before you compile. - **Concatenate** with `//`, slice out a **substring** with `s(i:j)`, and grow a deferred-length string by assignment. - Convert numbers to text and text to numbers w → Introduction to Fortran Programming
characterization test
a test written to capture what a piece of code *currently* does (rather than what it *should* do), so that its behavior is pinned before you refactor underneath it; especially valuable when the running legacy program is the only specification that exists. → Ch18
Cheap invariants
the maximum principle and symmetry — cost nothing and catch boundary and indexing bugs a plausible heat map would hide; leave them on. - Validation is what makes the later optimization and parallelization *safe*: every faster version must reproduce the validated answer, behind the frozen `step` inte → Case Study 2: Building a Validated Steady-State Heat Solver
chunking
Storing a dataset not as one contiguous block but as a grid of fixed-size rectangular tiles (**chunks**), each written and read independently. Chunking enables reading a sub-region without loading the whole array (only the overlapping chunks are fetched) and is a prerequisite for compression (the fi → Ch25
close every object you open
file, dataspace, dataset, property list — or you leak handles. → Introduction to Fortran Programming
cluster
hundreds or thousands of separate computers, each with its own private memory, wired together by a fast network. To program that machine you need a way for those separate computers to *cooperate*, and for thirty years the answer, across essentially every supercomputer on Earth, has been one thing: * → Introduction to Fortran Programming
coarray
a variable declared with a **codimension** (an extra bound in square brackets, e.g. `real :: a[*]`), which makes it exist as a separate copy on every image and lets any image access any other image's copy by writing a coindexed reference `a[q]`. A coarray may be scalar, array, or allocatable; the `( → Ch32
Coarrays
Fortran's native, standardized parallel model, no external library. → Ch31
Coarrays span both CPU rows
Fortran's native, standardized PGAS model, one notation for shared *and* distributed memory. No external library. (Chapter 32.) → Chapter 31 — Key Takeaways (Why Parallel?)
codimension
a dimension of a coarray, written in square brackets `[ ]`, that ranges over *images* rather than over elements within one image: where `a(3)` is the third element of the local array, `a[3]` is image 3's copy of `a`. The number of codimensions is the **corank** (`a[*]` has corank 1); the coextents f → Ch32
coindexed access
reaching another image's data by writing its image number in brackets: → Introduction to Fortran Programming
collective communication
an operation that all processes in a communicator call together, cooperating in one communication pattern (broadcast, reduce, gather, scatter). Every process must make the matching call or it hangs; in return MPI implements the pattern efficiently (often log-depth tree algorithms). Clearer and faste → Ch34
collective subroutine
an intrinsic subroutine (Fortran 2018) that performs a coordinated operation across *all* images at once and therefore must be called by every image with matching arguments: `co_sum`, `co_max`, `co_min` (reductions that combine a value across images), `co_broadcast` (copy one image's value to all), → Ch32
collective subroutines
`co_sum`, `co_max`, `co_broadcast` — and know what **teams** are for. - **Build and run** a coarray program two ways, and decide when coarrays beat OpenMP or MPI and when they do not. → Introduction to Fortran Programming
colormap
the function that maps each scalar value to a display color. A *perceptually uniform* colormap (matplotlib's `viridis`, `inferno`, `magma`, `plasma`) renders equal value-steps as equal-looking color-steps and is colorblind-safe; the rainbow/`jet` map is not — it invents false boundaries at its color → Ch26
column
**is** contiguous. Column-major layout stores the first index fastest, so the elements of a column occupy consecutive memory addresses. `field(1, :)` — a **row** — is → Ch07
column by column
`a(1,1)`, `a(2,1)`, `a(3,1)`, … march down the first column before the second begins — so two elements that are adjacent *in memory* differ in their **first** index. A CPU never fetches one number from memory; it fetches a whole **cache line** (typically 64 bytes, eight `real(dp)` values) at a time, → Introduction to Fortran Programming
column mean
the average across stations for each month. Second, the **anomaly** — each reading minus its own month's mean, which tells you how far above or below normal that station-month was. By hand, the month means are `20, 14, 10, 22`, and, for instance, station 3 in January is `30 - 20 = +10`: ten degrees → Case Study 1: Vectorizing a Scalar Loop
column-major
and use the `matmul`, `dot_product`, and `transpose` intrinsics for the small cases where they are the right tool. - Write a matrix multiply from scratch, then measure it against the intrinsic and the BLAS in your head, and understand the three **levels** of the BLAS that explain the gap. - Call **` → Introduction to Fortran Programming
Column-major access patterns
loop ordering can be a 10× difference (the payoff of Ch.5). - **27.3** **The no-aliasing advantage** over C (why Fortran arrays optimize better; `restrict` in C for comparison). - **27.4** `pure`/`elemental` and their optimization implications. - **27.5** Reading a compiler optimization report (`-fo → Introduction to Fortran Programming — Master Outline
Column-major memory layout
the single most important performance idea in the book (foreshadow Ch.27). - **5.7** `where` and masks revisited on real data. - **First-define:** array section, whole-array operation, array constructor, `allocatable` array, column-major order, rank/shape/extent. - **Project Checkpoint:** the temper → Introduction to Fortran Programming — Master Outline
column-major order
the compiler walks each section's first index fastest (down columns), which is **cache-friendly**, exactly as a first-index-inner hand loop would be. Writing it as sections (rather than a hand loop) affects aliasing assumptions favorably: the result array `lap` is a **distinct** array being written, → Ch27
COMMON
a named (or blank) region of memory that several program units may each declare and thereby share. Written `COMMON /name/ list`, it associates the listed variables of different units **by position, not by name**, with no compiler checking that the declarations agree; FORTRAN 77's mechanism for globa → Ch17
communicator
an MPI object identifying a group of processes and providing a private communication context for them; every message is sent within a communicator, and a rank is meaningful only relative to one. The predefined `MPI_COMM_WORLD` contains all processes the program was launched with. In the `use mpi` in → Ch34
compensated (Kahan) summation
the fix Case Study 1 pointed toward. The idea is to keep a small running correction `c` that captures the low-order bits lost at each addition, and feed them back in: → Case Study 2: Building a Variance You Can Trust
compilation order
a valid build sequence for a multi-module program: a topological ordering of the module-dependency graph in which each module is compiled after every module it `use`s (leaves first, the main program last). It is a property of the dependencies, not the file names. → Ch08
compile-time error
D. Undefined behavior that sometimes works → Self-Assessment Quiz: Procedures
compiler
the program that translates a high-level language into the machine instructions a processor actually executes. → Ch01
Compiler Explorer (`godbolt.org`)
paste a loop, pick gfortran with `-O3 -march=native`, and *see* whether it emitted `vfmadd`/`vmovupd` (SIMD) or scalar instructions. The fastest way to confirm a loop vectorized without running anything. *(Tier 1.)* → Chapter 29 — Further Reading
compiler flag
an option passed to the compiler on the command line, conventionally beginning with a hyphen, that modifies how it compiles: what output to produce (`-o`, `-c`), which warnings to report (`-Wall`), which run-time checks to insert (`-fcheck=all`), how hard to optimize (`-O2`), which standard to enfor → Ch02
complex
an intrinsic type storing a pair of reals as a single number `a + b*i`, with arithmetic following complex algebra; `real(z)` extracts the real part, `aimag(z)` the imaginary part, and `abs(z)` the modulus. → Ch03
component
one of the named data members a derived type groups together; read or written with the percent operator `%` (`v%comp`, and chained for nested types as `p%pos%x`). A component may be a scalar, an array, another derived type, or allocatable, and may carry a default initializer (`integer :: count = 0`) → Ch09
compression
Losslessly shrinking a dataset's stored bytes with a filter applied per chunk, transparently decompressed on read. The most common HDF5 filter is **deflate**; smooth scientific fields (which have highly redundant bytes) compress well, noisy fields barely at all. Requires chunking. HDF5: `h5pset_defl → Ch25
computational scientist
a scientist or engineer whose primary research tool is large-scale computation: someone who poses a scientific question, chooses or devises the numerical method to attack it, writes and runs the simulation, and interprets the results *as science*. Sits at the science end of the career spectrum; typi → Chapter 40 — Glossary (terms first-defined here)
computational-science paper
the conventional written form of a computational result, structured as problem statement, governing equations and numerical method, verification and validation, implementation and performance, results, conclusion, and reproducibility. The order reflects what a reader needs to trust the work: the met → Ch38
Compute in Fortran, render in Python
one saved dataset feeds an interactive ParaView animation, a stitched movie, and a contoured publication figure, none of which re-runs the simulation. → Case Study 26.2: Building a Time-Series Visualization Module for the Heat Solver
compute-bound
when arithmetic is the limit and the data it works on is already in registers/cache (high arithmetic intensity, as in dense matmul). For the triad/stencil (low intensity), vectorize by all means, but the real wins come from moving less memory (loop order, blocking). → Ch27
computed `GOTO`
jump by integer index | `select case` (with `case default`) | | `IF (e) l1,l2,l3` | **arithmetic `IF`** — jump on `sign(e)` | `if … else if … end if` | | `F(x) = expr` | **statement function** — inline one-liner | internal `pure` function (Ch. 6) | | `ENTRY name` | second entry point sharing body/st → Chapter 17 — Key Takeaways (Reading FORTRAN 77)
computed GOTO
a control statement of the form `GO TO (L1, L2, L3), K` that transfers control to the label selected by the integer `K` (the first label if `K` is 1, and so on), falling through if `K` is out of range. FORTRAN 77's integer-indexed multi-way branch, the ancestor of `select case`. → Ch17
concatenation
the `//` operator, which joins two `character` values into one whose length is the sum of their lengths (`'heat' // '.vtk'` is `'heat.vtk'`). It joins the operands exactly as given, blanks included, so a fixed-length operand must be `trim`med first or its trailing blanks are spliced in. → Ch12
conditional expression
a Fortran 2023 expression of the form `( logical-condition ? value-if-true : value-if-false )`, parenthesized, that yields one of two values depending on a scalar logical condition. Only the selected branch is evaluated (it short-circuits), unlike the `merge` intrinsic, which evaluates both value ar → Ch39
conditioning
a property of a *problem*: how sensitive its answer is to small changes in its inputs, measured by the condition number (a condition number of $10^{k}$ means losing about $k$ digits). A well-conditioned problem is insensitive; an ill-conditioned one amplifies input error, and no algorithm can beat t → Ch20
config file → parameters
`namelist` read (Ch. 7), `read(u, nml=config)`; (2) **parameters → field object** — the `field_t` constructor (Ch. 9), `call f%init(nx, ny, dx, dy)`; (3) **field object → evolved state** — the solver's time loop mutates `f%u`; (4) **field object → output file** — `write_field_netcdf` (Ch. 25) → self → Ch25
contiguous
a whole array, a leading section `a(1:m)`, or a full column `a(:,j)` — and never a strided slice such as a row `a(i,:)` or `a(1:n:2)`. In return, the compiler may assume unit stride and emit simple, vectorizable load/store code, instead of the general strided-access code it must generate for a plain → Ch11
continuous integration (CI)
The practice of automatically building a project and running its test suite on every change, on a clean neutral machine, so a break is caught within minutes rather than weeks; reports pass/fail (the green check / red X) and, for a proposed merge, can block it. → Chapter 37 — Glossary (terms first-defined)
Conventions in this bank (matching the book).
**No code was executed.** Every "what does this print?" answer was worked out by hand — that *is* the exercise. Encourage students to predict the output before revealing the answer. - Snippets assume **`implicit none`** and modern free-form style, and that **`dp`** is the book's double-precision kin → Quiz Bank
convergence
the property that a method's approximation approaches the exact answer as the discretization is refined, $E(h) \to 0$ as $h \to 0$ (or $n \to \infty$). The order of accuracy says how fast it converges. → Ch22
convergence study is the paper's spine
the error falling like $h^2$ (observed order → 2) is the evidence that turns "trust me" into "here is why," and it doubles as the regression oracle. - Build the two figures with the right tools: the **convergence plot** (matplotlib, the reviewer's figure) and the **steady-state heat map** (ParaView, → Case Study 2: Writing the Paper — Assembling Your Solver into a Reproducible Result
coordinate variable
A one-dimensional NetCDF variable with the *same name as a dimension*, holding the physical coordinate of each index along that axis (e.g. dimension `x` of length 4 and variable `x(x) = [0.0, 0.25, 0.5, 0.75]` with `units = "m"`). Coordinate variables turn array indices into physical space, letting → Ch25
core-days
which is why the work must be spread across thousands of cores to finish in an hour. → Case Study 1: The Anatomy of a Survivor
correct
it computes $12$ — and it can be dramatically **slower** than the reduction, because of false sharing (§33.5). Eight `real(dp)` slots are 64 bytes, exactly one cache line, so all threads' slots live on the *same* line. Every time any thread updates its slot, the cache-coherence hardware must invalid → Case Study 2: Scaling the Stencil
Correctness is non-negotiable
without it nothing else matters. > 3. It shows the author understands the tool's regime of validity, which builds trust; a paper that pretends > its method has no limits invites the reviewer to find the one it ignored. > → Introduction to Fortran Programming
cosubscripts
its position in the coarray's image grid, a small integer vector like `[2,3]` for a corank-2 `[np,*]` coshape — rather than the single scalar image number that `this_image()` (no argument) returns. `image_index(grid, [2,3])` does the inverse: it maps the cosubscript position `[2,3]` back to the plai → Ch32
counted do loop
`do i = start, end, step`: an integer counter runs from `start` to `end` (inclusive on both ends) in increments of `step` (default 1); the trip count is fixed at loop entry. → Ch04
CPU time
The amount of processor time actually consumed by the program, measured with `cpu_time`. Equal to wall time for a serial compute-only run on a quiet machine; smaller when the program waits (I/O-bound); larger than wall time when work is spread across several cores. → Ch28
CUDA Fortran
NVIDIA's set of Fortran extensions (from PGI, now nvfortran) for writing explicit GPU kernels and launching them from host code. Exposes the CUDA model directly (device arrays, `attributes(global)` kernels, `<<>>` launch). NVIDIA-specific — more control than OpenACC, at the cost of porta → Ch35
CUDA Fortran one-based thread indexing
`i = (blockIdx%x - 1)*blockDim%x + threadIdx%x`. Stated as correct (threadIdx%x, blockIdx%x are 1-based in CUDA Fortran, unlike CUDA C's 0-based). HIGH-CONFIDENCE but it is the single most error-prone detail; worth a maintainer confirming against the CUDA Fortran Programming Guide. blockDim/gridDim → Chapter 35 — continuity delta
curvature
and it is positive where the graph bends upward (a valley) and negative where it bends down (a hill). A computer cannot take the limit $h \to 0$, so it stops at a small finite $h$; that single act of stopping early is the finite-difference idea of §D.3 and [Chapter 22](../part-05-numerical-methods/c → Appendix D: Mathematics Refresher
cycle
a statement that abandons the current iteration of a loop and jumps to the next one, without leaving the loop (Python's `continue`). With a construct name, `cycle name` acts on the named loop. → Ch04

D

dangling pointer
a pointer that aliases memory that has been freed (deallocated through another alias) or has gone out of scope; it may still report `associated == .true.`, but dereferencing it is undefined behavior. → Ch11
data parallelism
performing the same operation on many independent data elements simultaneously (e.g., applying the identical stencil to every interior cell of the plate); the dominant, well-scaling form of parallelism in scientific computing. → Ch31
data race
a bug in which two or more threads access the same memory concurrently with at least one writing, and no synchronization orders the accesses, so the result depends on nondeterministic thread timing. The signature is an answer that changes from run to run on the same input. In OpenMP a race is almost → Ch33
data region
a block of code, delimited by `!$acc data` … `!$acc end data`, over which named arrays are kept resident in device memory: the data clauses move the arrays once (in at entry, out at exit), and every `!$acc parallel loop` inside reuses the resident copy without re-transferring it. The mechanism for " → Ch35
data scoping
assigning a data-sharing attribute to every variable in a parallel region, declaring whether the team shares one instance or each thread holds a private one. The principal attributes: `shared` (one instance for all), `private` (an uninitialized per-thread copy), `firstprivate` (a per-thread copy ini → Ch33
DataField.Dev
*From `Hello, world` to parallel supercomputer code.* → Introduction to Fortran Programming
dataset
In HDF5, a typed, multidimensional array stored in a file — the analogue of a NetCDF variable. A dataset has a datatype (e.g. `H5T_IEEE_F64LE`), a dataspace (its rank and shape), and an optional creation property list controlling chunking and compression. Created with `h5dcreate_f`, written with `h5 → Ch25
dead code
an unused result may be optimized away entirely, and you would "measure" an empty loop. **(d)** Compile the *same source* twice — `gfortran -std=f2018 -O0 x.f90 -o x0` and `gfortran -std=f2018 -O3 -march=native x.f90 -o x3` — run both, and compare the elapsed times (the checksum must match to prove → Ch27
debug
catch mistakes | `-g -O0 -fcheck=all -fbacktrace` | `-g -O0 -check all -traceback` | `-g -O0 -Mbounds -traceback` | | **release** — run fast | `-O3 -march=native -flto` | `-O3 -xHost -ipo` | `-fast -Minfo` | | **FP contract** — IEEE-strict | *(default is strict)* | `-fp-model precise` | `-Kieee` | → Case Study 30.2: A Reproducible, Portable Release Build for the Solver
declared type
the type a variable is declared with, fixed and known to the compiler (`base_t` in `class(base_t) :: x`). → Ch10
decompose the plate across images
each image owns a vertical strip of columns — and at every timestep the images **exchange their shared edge columns as halos** with coindexed access, so that each image can apply the *identical* Chapter 24 stencil to its own strip. The physics does not change one bit; only *who computes which column → Introduction to Fortran Programming
decomposed (row) direction on the second
so that a whole row, `u(:,k)` (the thing the halo exchanges), is a block of `nx` **contiguous** reals in Fortran's column-major memory. That lets each halo message be a plain contiguous buffer handed straight to `mpi_sendrecv` with `count = nx`, needing no packing and no derived datatype. If you spl → Ch34
deep copy
`b` receives its own storage holding a copy of the values, independent of `a`. With a **pointer** component, `b = a` copies the pointer (a **shallow** copy), so `b` and `a` share the same storage — change one and the other changes. → Ch09
defensive programming
the practice of writing code that actively verifies its own assumptions — validating inputs (preconditions), checking that results are sane (postconditions), guarding every operation that can fail, and initializing everything — and that fails early, loudly, and with a diagnostic when an assumption i → Ch13
deferred binding
a type-bound procedure declared `deferred` in an abstract type: it names a binding and its (abstract) interface but supplies no body. Every concrete extension must implement it or itself be abstract — a compile-time contract. → Ch10
deferred-length character
a string declared `character(:), allocatable :: s` whose length is not fixed but acquired at run time, either from `allocate(character(len=n) :: s)` or, usually, from assignment (`s = value` allocates `s` to the value's exact length, with no padding, and reallocates on a later assignment). The chara → Ch12
deflate
The gzip/zlib lossless compression algorithm, the default HDF5 compression filter, controlled by a level from 1 (fast, less shrinkage) to 9 (slow, most shrinkage). Levels 4–6 are the practical sweet spot for smooth floating-point fields; level 9 buys little extra ratio for much CPU. Often paired wit → Ch25
degree-valued trigonometric intrinsics
`sind`, `cosd`, `tand` and their inverses `asind`, `acosd`, `atand`, plus `atan2d` — which take and return angles in **degrees** instead of radians. If your data is in degrees (latitudes, headings, phase angles, a hot-edge profile), you no longer sprinkle `* pi / 180.0_dp` across your code and risk → Introduction to Fortran Programming
delete the entire computation
leaving you timing an > empty loop and celebrating an infinite speedup. The cure is to *use* the result in a way the compiler > cannot predict away: accumulate it and print it after the timer stops. > > ```fortran > real(dp) :: sink > sink = 0.0_dp > do rep = 1, n_rep > call tic() > call kernel(a, b → Introduction to Fortran Programming
Dennard scaling
the observation (Robert Dennard, 1974) that as transistors shrink, their voltage and current shrink in proportion so that power per unit area stays roughly constant, which for decades permitted rising clock frequencies "for free." Its breakdown in the mid-2000s (chiefly from leakage current) ended t → Ch31
dependency
each timestep needs the array the previous timestep produced, each iteration reads the > value the last one wrote — you are forced back into an explicit Python loop, and an explicit Python loop > over a million elements is where the interpreter's per-element overhead crushes you, routinely 50-to-100 → Introduction to Fortran Programming
derived type
a data type you define yourself by grouping together other data (of intrinsic types like `real` and `integer`, or of other derived types) under one new type name; a variable of a derived type is a single object holding all the grouped values at once. Defined with `type :: name … end type name`; decl → Ch09
derived types
your own data structures — and full → Introduction to Fortran Programming
Design the suite as a plan
a table mapping each procedure to an oracle — so it tests what matters, spans all four oracle sources, and layers unit, regression, and verification scopes. - **Layer the scopes:** units localize a break to one procedure; the golden regression catches unintended change; the analytical verification c → Case Study 2: From Script to Release — Giving the Solver a Test Suite, Docs, and CI
Deterministic
`start` prints first (serial master), `end` prints last (serial master), and exactly **three** `thread k` lines appear, one per thread, with `k` taking each of the values `0, 1, 2` once. **Nondeterministic** — the *order* of the three `thread` lines (and they may interleave mid-line). One possible r → Ch33
deterministic and reproducible
the same run gives the same numbers every time, unlike wall-clock timing — at the price of running your program perhaps 20–100× slower. So you run it on a *small* problem. → Introduction to Fortran Programming
device
the accelerator (GPU) and its separate on-board memory, which executes the parallel kernels the host sends it. Host and device memories are distinct address spaces; data must be explicitly copied between them. → Ch35
dgesv overwrites both `A` and `b`
`A` becomes its LU factors and `b` becomes `x` — whereas MATLAB leaves `A` untouched and returns a fresh `x`, so copy them if you need the originals; (2) your Fortran matrix is **already column-major**, the exact layout LAPACK expects, so no transposition or reordering is needed to hand it in — MATL → Ch21
Diagnose an `EQUIVALENCE` before translating
it does three different jobs with three different modern answers. Pick by *why* it is there, not *what* it looks like. → Chapter 19 — Key Takeaways (FORTRAN 77 → Modern Translation Dictionary)
diagnose before you translate
an `EQUIVALENCE` and a `GOTO` each do several different jobs, and the faithful replacement depends on which. Second, **translation preserves the numerics** — every entry in this dictionary changes the engineering, not the science, and a regression test ([Chapter 18](../chapter-18-modernizing-legacy- → Introduction to Fortran Programming
different compiler or version
reorders and fuses (FMA) arithmetic differently; (2) **different flags**, especially `-Ofast`/`-ffast-math`, which *permit the compiler to reassociate* non-associative floating-point addition; (3) a **different processor count** — a parallel `reduction(+:...)` combines partial sums in an order that → Ch37
different hardware
several *cores* versus a single core's *vector unit* — so their speedups **multiply** rather than add: `!$omp do` spreads the iterations over (say) 8 cores, and `simd` makes each core process 4 elements per vector instruction, for a ceiling near $8 \times 4 = \mathbf{32\times}$ throughput (before me → Ch33
different numbers
so **record the build configuration** or the result is not reproducible (Ch. 37). Capture compile-time choices in `parameter` constants: → Chapter 36 — Key Takeaways (Anatomy of a Real Scientific Code)
Different optimization flags
`-O3`, and especially `-Ofast`/`-ffast-math`, which explicitly permit the compiler to reassociate floating-point math ([Chapter 30](../../part-07-performance/chapter-30-compiler-flags/index.md)) — change results in the low bits. - **A different math or linear-algebra library** (a different BLAS/LAPA → Introduction to Fortran Programming
Difficulty tiers.
⭐ **warm-up and recall** — a few minutes; retrieval and articulation. - ⭐⭐ **applied** — write, research, or package something real; 15–45 minutes. - ⭐⭐⭐ **deeper or open-ended** — produces a portfolio-grade artifact or a broad synthesis; an hour or more, and worth it. → Chapter 40 Exercises: The Fortran Career
diffusion number
The dimensionless group $r = \alpha\Delta t/h^2$ (also "mesh Fourier number") that collects the physics, timestep, and grid spacing; it multiplies the stencil in the FTCS update and sets both the step size and the stability amplification factor. → Ch24
Dijkstra epigraph wording
quoted from memory of the 1968 CACM letter; the paper and thesis are certain, the verbatim string should be confirmed before print (also noted in `bib/ch04.md`). 2. **`gfortran -std=f2018` rejecting a real `do` counter** — stated as an error. Real do-variables were *deleted* in Fortran 95, so a stan → Chapter 4 — continuity delta
direct access
a file access mode (`access='direct', recl=N`) with fixed-length records addressable by number with `rec=k`, allowing random jumps to any record. The units of `recl` are processor-defined (bytes in gfortran). → Ch07
Dirichlet boundary condition
A boundary condition that fixes the *value* of the field on the boundary ($u = g$). Coded by setting boundary points once and never updating them; the time loop sweeps only the interior. → Ch24
disassociated
the clean "points at nothing" status a pointer has after `nullify(p)` or initialization `=> null()`; `associated` returns `.false.` for it. → Ch11
distributed
1D domain decomposition (one horizontal strip per process, ghost rows), halo exchange each step with `mpi_sendrecv`, `mpi_allreduce` for a global convergence measure, `mpi_gather` for output. The Chapter 24 stencil is UNCHANGED (the "serial-update + halo-exchange" thesis). Sits between Ch. 33 (OpenM → Chapter 34 — continuity delta
distributed memory
a parallel model in which each process has its own private memory and cannot directly access another's; processes coordinate by explicitly sending messages. The model of a cluster of separate nodes on a network; scales to the largest machines. Fortran tools: MPI, coarrays. → Ch31
do concurrent
a loop `do concurrent (i = a:b) … end do` in which the programmer asserts the iterations are independent (no iteration depends on another's result), permitting the compiler to reorder, vectorize, or parallelize them. The promise is unchecked; violating it makes the program invalid. → Ch04
do loop
Fortran's loop construct, `do … end do`, in three forms: counted (`do i = a, b, s`), conditional (`do while (c)`), and infinite (a bare `do` ended by `exit`). → Ch04
do while
a loop `do while (condition) … end do` that tests the logical `condition` before each pass and runs the body only while it is true; runs zero times if the condition is false at the outset. → Ch04
doc comments
ordinary comments, so the source still compiles — and generates a cross-linked API site. Docs in the source *cannot drift* from the code. - **git:** tie every figure to a **commit hash** (`git rev-parse HEAD`); commit code **and** inputs; **tag** submissions; do **not** commit huge outputs — commit → Chapter 37 — Key Takeaways (Testing, Documentation, and Software Engineering)
documents the dependency
a reader sees exactly what this file takes from `kinds`; (2) it → Ch08
domain decomposition
the strategy of dividing a simulation's spatial domain into subdomains, assigning one to each process, and having each process compute the update for its own subdomain. The dominant way to parallelise grid-based physics on distributed memory; because a finite-difference stencil couples only nearby p → Ch34
domain decomposition with halo exchange
that you have been quietly prepared for since [Chapter 24](../../part-05-numerical-methods/chapter-24-pdes-finite-differences/index.md). The five-point stencil there reaches only to a cell's four nearest neighbours. Cut the plate into strips, give each process one strip, and the *only* thing a proce → Introduction to Fortran Programming
domain scientist
the role furthest toward the science end: asks the research question, runs existing codes, and modifies them only lightly; domain depth matters more than software depth. → Chapter 40 — Glossary (terms first-defined here)
double precision
an intrinsic real type (and legacy keyword) providing roughly 15 significant digits, historically distinct from single-precision `real`; modern code obtains the same thing more flexibly through a kind parameter (`real(dp)`), but the keyword and the `1.0d0` literal form persist in older code. → Ch03
dp
this book's name for the double-precision real kind, defined once as `integer, parameter :: dp = selected_real_kind(15, 307)` (at least 15 significant digits, range to 10^307 — IEEE 754 double on mainstream systems). Reals are declared `real(dp)` and real literals carry a `_dp` suffix (`1.0_dp`). → Ch03
driver
the top-level program that, by [Chapter 38](../../part-09-real-world-fortran/chapter-38-capstone-simulation/index.md), will set up the plate, run the time-stepping loop, and write out results for visualization. Right now the driver only prints a banner. In [Chapter 3](../chapter-03-variables-types-a → Introduction to Fortran Programming
driver program
the top-level program unit that orchestrates a run — reading configuration, setting up data structures, running the main loop by calling into the solver and physics, arranging output, and shutting down — while performing none of the science itself. In the heat project, `program heat` is the driver. → Ch36
Dropping the $1/h^2$
answer changes when you refine the mesh (a broken discretisation). - **Hard-coded $\Delta t$** — stable on a coarse grid, explodes on a fine one ($r \propto 1/h^2$). - **In-place update** — mixes time levels, silently changing the scheme. - **`do i = 1, n`** at the boundary — off-grid stencil read; → Chapter 24 — Key Takeaways (PDEs and Finite Differences)
dtype
a NumPy array's element type (`float64`, `float32`, `int32`, `complex128`, …). For an array passed to Fortran it must match the Fortran declaration's kind byte for byte (`real(real64)` ↔ `float64`, `integer(int32)` ↔ `int32`, etc.); a mismatch forces f2py to copy and convert on every call. → Ch15
dummy argument
the placeholder name a procedure declares for an input; associated at each call with an **actual argument**, the value the caller supplies. → Ch06
dynamic dispatch
resolving a type-bound procedure call at run time by the object's dynamic type (an indirect call through a table), rather than at compile time. It is what makes polymorphism work, and — because it cannot be inlined — what makes it costly inside hot loops. → Ch10
dynamic type
the actual type a polymorphic variable holds at run time, which may be the declared type or any extension of it, and may vary during execution. → Ch10

E

edit descriptor
a code inside a format string that controls how one value is converted between its internal form and characters. Data descriptors (`i`, `f`, `e`, `es`, `a`) format values; control descriptors (`x`, `/`) position text without consuming a value. The number in `f8.2` gives the field width and, for real → Ch07
eigenvalue problem
find the $\lambda$ and $\mathbf{v}$ with $A\mathbf{v} = \lambda\mathbf{v}$ — and the **singular value decomposition**, $A = U\Sigma V^{\mathsf{T}}$, which factors *any* matrix into a rotation, a scaling by the singular values, and another rotation. Eigenvalues tell you a system's natural frequencies → Introduction to Fortran Programming
elemental
a procedure attribute for a procedure written with scalar arguments that may be applied element-by-element to array arguments of any shape; an elemental procedure is automatically `pure`. → Ch06
embedded Runge-Kutta pair
a method that yields two solutions of different order from the same stages (e.g. RKF45, Dormand-Prince), giving a nearly free error estimate. → Chapter 23 glossary — terms first-defined
end-of-file read loop
reading an unknown number of records until the file runs out. This is where the *negative* `iostat` and the named constant `iostat_end` do their work: → Introduction to Fortran Programming
enforce types and access control
`public`/`private` and compiler-checked declarations, versus `COMMON`'s unchecked memory overlay; (3) → Ch08
enforced
a `print` or module-write inside `pure` is a compile error. - Habit: make small math helpers `pure`, scalar transforms `elemental`, whenever they honestly qualify. → Chapter 27 — Key Takeaways (Why Fortran Is Fast)
enforced by the compiler
a `physics` module that tried to reach up into the driver simply would not compile — whereas Python's package layering is a convention a linter merely hopes you followed, breakable at runtime with an import. → Ch36
entire scientific-software lifecycle
physics → numerics → software engineering → HPC → communication — in one real, runnable code, which is precisely what a computational-science employer wants to see. → Quiz Bank
entry point
the single `program` unit of a Fortran program, where execution begins; the root of the call tree and the first thing to read when navigating an unfamiliar code. → Ch36
enumeration type
a Fortran 2023 distinct data type whose values are a fixed, named set of *enumerators*; a variable of the type may hold only one of those named values, and the compiler type-checks it. Distinct from — and more type-safe than — the C-interoperable `enum, bind(c)` of Fortran 2003, which merely creates → Ch39
Epigraph
Seymour Cray, "Anyone can build a fast CPU. The trick is to build a fast system." Widely attributed to Cray, on-theme; tagged Tier 2 (exact venue not pinned). Non-load-bearing. 6. **C `restrict` behavior described honestly** (modern C compilers emit runtime overlap checks + loop versioning rather th → Chapter 27 — continuity delta
EQUIVALENCE
a statement, written `EQUIVALENCE (a, b)`, declaring that the named variables or array elements share the *same* memory location, so writing one changes the other. Used to save memory (reuse one buffer) or to reinterpret storage as a different shape or type; FORTRAN 77's tool for deliberate aliasing → Ch17
error stop
a statement that terminates a program immediately as an *error termination*, reporting failure to the environment with a nonzero exit code; contrasts with plain `stop` (normal termination, exit code zero by default). Both accept an optional integer or character stop code, which `error stop` uses as → Ch13
Euler's method
the first-order integrator $y_{n+1} = y_n + h f(t_n, y_n)$; follows the tangent at the interval's left endpoint. Global error $O(h)$. → Chapter 23 glossary — terms first-defined
every timing and speedup below > is illustrative
an order-of-magnitude expectation, not a measurement. They are shaped to be *realistic* > and to teach the right reasoning, but the only honest performance number is one *you* measure on *your* > machine with the profiler of [Chapter 28](../../part-07-performance/chapter-28-profiling-benchmarking/in → Introduction to Fortran Programming
exact and associative
no rounding occurs — so reassociating an integer count cannot change it. Hence `-Ofast` can perturb a floating sum's digits but never an integer tally. (Overflow aside, which is a separate matter.) → release, chosen by compiler identity:
exact for quadratics
the basis of the unit test in §I.7. Boundary rows and columns are returned as zero; they are held fixed and never enter the update. - `step(field, alpha, dt)` — one explicit **forward-Euler (FTCS)** step. It evaluates the Laplacian on the *old* field, then advances the interior by $\alpha\,\Delta t\ → Appendix I: The Complete Heat-Solver Code
exchange first, then update
so that when the stencil reaches an edge row, the ghost beside it already holds the neighbour's *current* value: → Case Study 1: The Halo Exchange That Hangs (Sometimes)
executable
the final product of the build: a complete, self-sufficient program the operating system can load and run, with every reference resolved and every needed library linked in or locatable at run time. Typically has no extension on Linux/macOS and ends in `.exe` on Windows. → Ch02
exit
a statement that immediately terminates the enclosing loop (or, with a construct name, a named loop) and transfers control to the statement after its `end do`. → Ch04
experiment
*not made, and that's fine* | → Case Study 1: Refereeing a Result — Reading a Heat-Solver Manuscript Like a Reviewer
experimental data
a real heated plate measured in a lab — to test whether the heat equation with our chosen $\alpha$ actually describes that plate. This chapter has no such data and so does verification only, and says so. → Ch38
explicit interface
full compiler knowledge of a procedure's arguments (number, type, intent) at the call site; provided automatically by internal and module procedures, and required for optional, keyword, and assumed-shape features. → Ch06
explicit scheme
A time-stepping scheme in which each new value is given by a formula in already-known (current-step) values only, so it is computed directly with no equations to solve. Cheap per step but conditionally stable (a timestep limit). → Ch24
explicit-shape array (argument)
a dummy array whose extents are stated outright (`a(n, n)`), requiring the caller to pass the sizes separately; guaranteed contiguous but error-prone. → Ch06
exponent range to at least $10^{307}$
IEEE double precision on every mainstream system, portably. You then declare reals `real(dp)` and must write real literals with the → Midterm Exam — Solutions
extension module
a compiled shared library (`.so` on Linux/macOS, `.pyd` on Windows) that Python can `import` exactly like a pure-Python `.py` file, but whose code is native machine code rather than interpreted Python. NumPy and SciPy are extension modules; f2py lets you build your own from Fortran. → Ch15
extent
the number of elements along one dimension of an array. → Ch05
external procedure
a standalone procedure with no host and no automatic explicit interface; a source of uncaught argument-mismatch bugs in legacy code, and the reason modern code uses `contains` or modules. → Ch06

F

F-contiguous
a NumPy memory layout (column-major, "F" for Fortran) in which the *first* array index varies fastest in memory; columns are stored one after another. This matches Fortran's array layout, so an F-contiguous, correct-dtype array passes to Fortran with zero copy. Created with `order='F'` or `np.asfort → Ch15
f2py
"Fortran to Python interface generator," a program distributed with NumPy that reads Fortran source and automatically generates and compiles a Python extension module exposing the Fortran procedures as callable Python functions. It parses the Fortran, generates the C glue between the Python and Fort → Ch15
fails closed
any helper, variable, or type you add later stays private automatically, so you can only ever expose something by a deliberate `public ::` line, never by *forgetting* to hide it. The reverse (`public` by default, `private` the exceptions) fails open: forget to hide one internal and it leaks into you → Ch08
false sharing
a performance fault (not a correctness one) in which threads on different cores write to *different* variables that happen to occupy the same cache line, so the cache-coherence hardware must repeatedly transfer that line between cores even though the threads share no data logically. The result is a → Ch33
finite difference
an approximation of a derivative formed by evaluating a function at a few points a finite distance $h$ apart and combining the values, rather than taking the calculus limit $h \to 0$. The forward $(f(x+h)-f(x))/h$ and backward $(f(x)-f(x-h))/h$ differences are $O(h)$; the central $(f(x+h)-f(x-h))/(2 → Ch22
first letter is the data type
`s` single, `d` double, `c` complex, `z` double complex — then the matrix type (`ge` = general) and the operation (`sv` = solve). So `dgesv` is *double-precision, general matrix, solve* $A\mathbf{x} = \mathbf{b}$. Reading the name tells you the routine. → Quiz Bank
first-order system of ODEs
a vector state $\mathbf{y}$ evolving under a vector RHS $\mathbf{y}' = \mathbf{f}(t, \mathbf{y})$; any higher-order ODE reduces to one by introducing derivatives as new state variables. → Chapter 23 glossary — terms first-defined
five-point stencil
The finite-difference approximation to the 2D Laplacian that combines a grid point with its four nearest neighbours (north, south, east, west): $(u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-4u_{i,j})/h^2$ on a square grid. Second-order accurate; exact for quadratics. Drawn on the grid it is a plus sign. → Ch24
fixed-form source
the source layout of FORTRAN 77 and earlier, in which each line is divided into fixed character columns with reserved meanings: columns 1–5 hold an optional statement label, column 6 is the continuation marker, columns 7–72 hold the statement, columns 73–80 are ignored, and a `C` or `*` in column 1 → Ch17
fixed-length character
a string declared with a constant length, `character(len=n) :: s`; it always holds exactly `n` characters, blank-padding a shorter value on the right and truncating a longer one. The length is a property of the variable, not of its contents. → Ch12
flat profile
The gprof report that ranks procedures by the time spent *inside* each one (its "self" time), ignoring callees. Columns: `% time`, cumulative seconds, self seconds, call count, self ms/call, total ms/call. The `% time` column usually identifies what to optimize. → Ch28
floating-point exception trap
a mode in which the CPU halts the program at the exact instruction that raises an anomalous floating-point condition, instead of silently producing a special value. gfortran enables it with `-ffpe-trap=list`; the useful list is `invalid` (0/0, sqrt of a negative → NaN), `zero` (nonzero divided by ze → Ch13
flops per number
grows with $n$. Vector $y \leftarrow y + ax$: $O(n)$ flops / $O(n)$ numbers $= O(1)$ flop per number — constant, and small. The matrix-matrix operation reuses each loaded number many times, so it is **compute-bound** and can run near peak; the vector operation touches each number about once, so it i → Ch16
Follow the data, not the control flow
in numerical code the data flow *is* the algorithm. - **Where the time goes:** almost always the **inner stencil loop** (80/20). Hypothesize from structure, **confirm with a profiler** (Ch. 28) *before* optimizing (Ch. 29). Navigate → measure → change → re-measure. → Chapter 36 — Key Takeaways (Anatomy of a Real Scientific Code)
FORD
FORtran Documenter: a tool that generates browsable HTML documentation from Fortran source and from special doc comments (`!!` after an entity, `!>` before one). The markers are ordinary comments, so annotated code compiles unchanged. (Used in Chapter 37.) → Ch16
fork overhead ~1 µs
typical/illustrative (see bib Tier 2). The false-sharing arithmetic (8 × real(dp) = 64 B = one line) is exact given a 64-byte line. 7. **No code executed.** Every `! Expected output:` is hand-computed. The 5×5 grids were re-derived cell by cell and match Ch. 24. Race "wrong values" are labeled illus → Chapter 33 — continuity delta
fork–join
OpenMP's execution model: a single master thread runs serially until it reaches a parallel region, where it *forks* a team of threads that all execute the region; at the region's end the threads *join* (synchronize and terminate) and the master continues alone. Parallelism is added incrementally, on → Ch33
format string
the parenthesized list of edit descriptors in `print '(...)'` or `write(unit, '(...)')` that acts as a template for the I/O list of values. → Ch07
fortls
the Fortran Language Server: a background program speaking the editor-agnostic Language Server Protocol (LSP) that gives an editor autocompletion, hover documentation, go-to-definition, and live error diagnostics for Fortran. → Ch16
Fortran > and Python are better together
Fortran writes the data at speed, and Python (or ParaView) reads it > back to make the picture. → Introduction to Fortran Programming
Fortran 2023 is a consolidation
a collection of useful, mostly small refinements rather than a single sweeping change. That is not a criticism. A mature language should evolve by careful addition, and a reader who has absorbed the previous thirty-eight chapters will find that nothing here forces you to relearn anything. These are → Introduction to Fortran Programming
Fortran and Python > are better together
the hot kernel belongs in Fortran and the orchestration in Python. → Introduction to Fortran Programming
Fortran and Python are better together
and to the project that ties the whole book into one story. → Introduction to Fortran Programming
Fortran is not dead
it runs the world's supercomputers, weather, and climate models; it persists because of *performance*, and the performance traces to language-design choices (array semantics, no pointer aliasing) that were right for numerical work. 2. **Modern Fortran is a modern language** — modules, OOP, `allocata → Style & Continuity Bible — Introduction to Fortran Programming
FORTRAN system
from *For*mula *Tran*slation — and it changed computing permanently. Before Fortran, programming meant writing the numeric instructions of a specific machine, one at a time. After Fortran, a scientist could write `X = (A + B) / C` and trust the compiler to figure out the rest. → Introduction to Fortran Programming
those index.md files are not yet on disk, but the chapters are canonical in `_continuity.md` (≤ 40) and the slugs/paths match the ledger. Same situation as other in-parallel chapters' links; will resolve when authored. → Chapter 40 — continuity delta
fpm
the Fortran Package Manager: a build tool and dependency manager for Fortran, developed by the fortran-lang community. It builds a project with one command, works out module compilation order automatically, and fetches and builds dependencies, all driven by a small `fpm.toml` manifest. Conventions: → Ch16
free-form source
the modern Fortran source layout (Fortran 90 onward) in which statements are not constrained to fixed character columns, as opposed to the fixed-form layout of FORTRAN 77 and earlier. → Ch01
FTCS (Forward-Time, Centred-Space)
The classic explicit scheme for the heat equation: forward (Euler) difference in time, centred difference in space. Update: $u^{n+1}_{i,j} = u^n_{i,j} + r(\text{neighbour sum} - 4u^n_{i,j})$ with $r = \alpha\Delta t/h^2$. → Ch24
function
one value (the mean), no side effects. (b) **subroutine** — it modifies both arguments in place and returns nothing to assign. (c) **function** — one value (the area). (d) **subroutine** — it performs an action (writing a file), returning no value. (e) **subroutine** is idiomatic: a real solver retu → Ch06
fused multiply-add (FMA)
A single hardware instruction computing `a*b + c` with just *one* rounding step instead of two. Faster and usually more accurate — but because it rounds once rather than twice, an FMA build can differ from a non-FMA build in the last bit, even without `-Ofast`. Often enabled by `-march=native` when → Chapter 30 — Glossary (terms first-defined here)

G

Gaussian quadrature
quadrature that chooses both the nodes and the weights optimally (nodes = roots of Legendre polynomials), achieving exactness for polynomials up to degree $2n-1$ with $n$ points — twice the reach of an equally-spaced rule. Maximizes accuracy per function evaluation on smooth integrands. → Ch22
generics
a planned Fortran facility for *parametric polymorphism*: writing a procedure or type once, parameterized over one or more types (and kinds), so the compiler generates a specialized, type-checked version for each concrete type used — no code duplication, no runtime dispatch. Fortran does not have th → Ch39
gfortran manual
reading the real description of `-Wall` or `-fcheck=all` cements what §2.4 introduced. 3. If installation fights you (most often on Windows or macOS), take the exact error to the **Fortran Discourse** or the relevant **platform documentation** above. 4. Once you are compiling comfortably, open **Com → Further Reading: Setting Up
gfortran TEAMS support "incomplete/absent"
true as broadly reported for the gfortran 10–13 era (the book's baseline); support evolves, so I wrote "verify on your version / prefer ifx" rather than pinning a release. Collectives (co_sum etc.) support in gfortran+OpenCoarrays is solid (stated as such). 4. **OpenCoarrays / caf / cafrun mechanics → Chapter 32 — continuity delta
ghost cell (halo cell)
a grid cell a process stores but does not own: a copy of a neighbouring subdomain's boundary data, kept so the stencil can reach across the subdomain edge without special-casing it. A process surrounds its owned block with a one-cell layer of ghost cells (a halo), refreshes it each step, and runs th → Ch34
global order of accuracy (of an integrator)
the exponent $p$ in the error $O(h^p)$ at a fixed final time; specializes Chapter 22's order-of-accuracy idea to time-stepping. (Euler $p=1$, RK4 $p=4$.) → Chapter 23 glossary — terms first-defined
gprof
The GNU profiler: compile and link with `-pg` (keeping `-O2 -g`), run the program (which writes `gmon.out`), then run `gprof exe gmon.out`. It instruments procedure entry to count calls exactly and samples the program counter to estimate time, producing a flat profile and a call graph. → Ch28
GPU (graphics processing unit)
a processor built around a very large number of simple cores that execute the same operation on many data elements simultaneously — a throughput-optimized, data-parallel machine, originally designed for graphics and now used for general numerical computation. Fast on wide, regular, data-parallel wor → Ch35
group
In HDF5, a container that holds datasets and other groups, named with filesystem-style paths (`/fields/temperature`). Every file has a root group `/`; a tree is built beneath it. Groups are HDF5's mechanism for hierarchy, the headline difference from NetCDF's flat model. Created with `h5gcreate_f`, → Ch25
growable array
an `allocatable` backing store plus a logical-size counter, doubled on overflow — is Fortran's answer to "a collection whose size I learn at run time." It is the structure to reach for, not a linked list. - `move_alloc` transfers an allocation in $O(1)$, making the grow step correct and cheap; it is → Case Study 2: Build the Growable Array
guarded allocation
`allocate(a(n), stat=s, errmsg=msg)` with a check — which turns an out-of-memory abort into a reported, recoverable failure with a message; and (b) **input validation / preconditions** (`validate_config`-style checks, or an `assert`) — which turns a nonsensical size like `n <= 0` into an immediate, → Introduction to Fortran Programming
guarding an `open`
you saw it in §7.3, and it is the single most valuable line of defensive I/O you can write: → Introduction to Fortran Programming
Gustafson's Law
for a problem whose size grows with the processor count so that per-processor work stays fixed, the scaled speedup is $S(N) = s + (1-s)N$, where $s$ is the serial fraction of the parallel run. Linear in $N$ with no ceiling; governs weak scaling. Answers "how much bigger a problem in the same time?" → Ch31

H

halo exchange
the act of refreshing every process's ghost (halo) cells each step by swapping boundary rows with neighbouring subdomains; in the project, two `mpi_sendrecv` calls (up and down), deadlock-free, with `MPI_PROC_NULL` neutralising the physical edges. → Ch34
HDF5
Hierarchical Data Format version 5: a self-describing, portable, binary format and library for large, complex scientific data, maintained by The HDF Group. Its model is a filesystem inside a file — a tree of **groups** (like directories) containing **datasets** (typed, multidimensional arrays) and * → Ch25
heat-equation solver
the book's spine — reaches its capstone. NO physics change; the chapter ASSEMBLES the canonical solver (kinds/timers/heat_types/heat_solver/heat_io + driver, all at their frozen signatures) and presents it AS A PAPER: problem, method, verification, performance, results, reproducibility. Canonical si → Chapter 38 — continuity delta
high-level language
a programming language that expresses computation in human-meaningful abstractions (variables, expressions, loops, procedures) rather than a specific processor's raw instructions; Fortran was the first to win broad adoption. → Ch01
high-performance computing (HPC)
the use of the most powerful available computers, typically clusters of many thousands of processor cores, to solve problems too large or too slow for an ordinary machine. → Ch01
host
in accelerator programming, the CPU and its main memory (RAM), which runs the main program, does the serial work and I/O, and issues commands to the device. → Ch35
host association
the mechanism by which an internal procedure can directly read and write the variables of its host program unit without them being passed as arguments. → Ch06
host–device transfer
the copying of data across the bus connecting CPU and GPU (host→device before a kernel, device→host after). Its bandwidth is much lower and latency much higher than either processor's access to its own memory (commonly ~10–30× slower), so it is usually the dominant cost in a GPU program — hence the → Ch35
host–device transfer time
the cost of moving the field to the device and results back, which OpenMP (shared memory) never pays. It is work the GPU *adds*, so it counts toward the un-accelerated serial fraction and lowers the whole-program speedup ceiling; minimizing it (one data region, not per-step copies) is how you keep t → Introduction to Fortran Programming
hot loop
The small region of code, very often a single innermost loop, where a program spends the large majority of its time (the "hot spot"). Numerical codes are highly concentrated this way; finding and optimizing the hot loop captures nearly all available speedup, and optimizing elsewhere is wasted effort → Ch28
How does C pass an output filename
a null-terminated string — that Fortran can use? → Case Study 2: Exposing the Heat Solver to a C Driver
HPC engineer
sometimes "performance engineer" or "scientific software engineer": the person brought in to make a code run faster, scale to more nodes, or move onto a GPU. Lives in Parts VII–VIII (profiling, optimization, OpenMP/MPI/coarrays/GPU). → Chapter 40 — Glossary (terms first-defined here)

I

I/O-bound
the CPU sat idle waiting. | | Machine oversubscribed (other jobs) | large | small–ish | Contention: your job was scheduled off the core. | | Multithreaded (e.g. OpenMP) on $p$ cores | small | up to $p\times$ wall | Parallelism working: CPU-seconds spread across cores. | → Introduction to Fortran Programming
identical to Chapter 24's CPU solver
a correct offload reproduces the serial physics exactly. It pays only on a large grid swept many times; on the 5×5 toy grid the GPU is slower (too little work to fill it). To scale beyond one GPU, combine with MPI ([Chapter 34](../chapter-34-mpi/index.md)): one rank per GPU, halos exchanged between → Chapter 35 — Key Takeaways (GPU Computing)
Idioms worth memorizing
Strip both ends: `trim(adjustl(s))` - Present? `index(s, sub) > 0` · Absent? `index(s, sub) == 0` - All digits? `verify(tok, '0123456789') == 0` - Start of content (skip leading blanks): `verify(s, ' ')` - File extension: `index(name, '.', back=.true.)` → Chapter 12 — Key Takeaways (Strings and Text)
IEEE 754
the international standard for binary floating-point arithmetic (1985; revised 2008, 2019). It fixes how reals are encoded in bits, how many bits each format uses, how operations round, and what happens in exceptional cases, giving bit-for-bit reproducibility across conforming machines. Fortran's `r → Ch20
IEEE 754 / `-ffast-math` / non-associativity
§27.1, spaced review, ans 27.25/28), Ch. 21 (tuned BLAS/`dgemm` beats hand-rolled — §27.4 + CS-02), Ch. 24 (the FTCS stencil — Project Checkpoint), Ch. 28 (**profiling / `system_clock` rigor / measure-first** — What's Next + checkpoint + CS), Ch. 29 (**SIMD/blocking/`do concurrent`** — foreshadowed → Chapter 27 — continuity delta
if construct
a block of the form `if (condition) then … end if` that runs its enclosed statements only when the logical `condition` is true; may include `else if (condition) then` branches (tested in order) and a final `else`. At most one branch executes. → Ch04
ill-conditioned
nearly singular, so the columns almost line up — then small > rounding errors in the data or the arithmetic are amplified into large errors in $\mathbf{x}$, and a small > residual can still hide a wrong answer. This is the conditioning idea from > [Chapter 20](../chapter-20-floating-point/index.md): → Introduction to Fortran Programming
illustrative
an > order of magnitude typical of the transformation, not a measurement from a specific run. We have not > executed any of this code; the *correctness* values (what the programs print) are hand-computed and exact, > but the *timings* depend on your CPU, its caches, your compiler, and its flags. The → Introduction to Fortran Programming
image
one of the several concurrent instances of a coarray program that execute together, each running the same executable with its own complete private set of variables. Images are numbered 1 to `num_images()`; the executing image's number is `this_image()`. The image is Fortran's unit of parallelism, th → Ch32
implicit
VTK can reconstruct every point position from the origin, the spacing, and the dimensions — and the file needs to carry only the temperature values themselves. This is the `STRUCTURED_POINTS` dataset in the legacy format, called `ImageData` (extension `.vti`) in the XML format. It is the simplest th → Introduction to Fortran Programming
implicit method
an integrator that defines the new state in terms of the RHS at the new state (e.g. backward Euler, $y_{n+1} = y_n + h f(t_{n+1}, y_{n+1})$), requiring an equation solve per step. → Chapter 23 glossary — terms first-defined
implicit none
a statement placed at the top of every program, module, and procedure (right after the opening `program`/`module`/`subroutine`/`function` line) that switches off implicit typing and requires every variable to be explicitly declared; with it in force, using an undeclared name is a compile-time error → Ch02
implicit scheme
A time-stepping scheme whose update involves the unknown new values on both sides, so each step requires solving a coupled linear system. Costlier per step (a linear solve) but typically unconditionally stable (no timestep limit). → Ch24
implicit typing
the FORTRAN convention by which an undeclared variable's type is set by the first letter of its name: names beginning `I`–`N` are `INTEGER`, all others are `REAL`. Summarized "`I` through `N` are integers." A variable comes into existence, typed by its initial, the first time it is used; modern Fort → Ch17
implied-do
a loop-like generator inside an array constructor, e.g. `[(i*i, i = 1, 5)]`, which produces `[1, 4, 9, 16, 25]`. → Ch05
in place
`intent(inout) :: u` — f2py cannot fake it with a > copy, because your in-place changes would be made to the copy and thrown away. So f2py **refuses**: pass a > C-contiguous (or wrong-dtype) array to an `intent(inout)` argument and it raises a `ValueError` about the > array not being Fortran-contigu → Introduction to Fortran Programming
inclusive on both ends
`do i = 1, n` runs `n` times, not `n-1` — which trips up programmers arriving from Python's half-open `range`. Second, the number of iterations (the *trip count*) is computed **once**, at loop entry, from the bounds and step; changing `end` inside the loop does not lengthen or shorten it. Third, the → Introduction to Fortran Programming
incomplete or > absent
a program using them may fail to compile or link, or behave incorrectly, through no fault of > your code. Treat teams as a feature to *recognize and understand the model of*, not one to build a > deadline-critical program on with gfortran today; if you need them now, check the Intel `ifx` compiler, → Introduction to Fortran Programming
Incomplete/absent
verify on your version; prefer `ifx` | → Introduction to Fortran Programming
incremental modernization
transforming a working program through a series of small, individually verified changes — compiling and re-running its tests after each one — so the code stays correct and buildable at every step; the opposite of a "big-bang" rewrite. → Ch18
incrementally
one conceptual change, then recompile and re-run the regression test — so any break is localized to the single edit that caused it. And judge each step by **numerical equivalence**: demand *bit-for-bit* agreement for the arithmetic-preserving steps (1–6), and fall back to a *stated tolerance* only w → Appendix E: FORTRAN 77 to Modern Fortran — Translation Reference
independent
no iteration may depend on another's > result — or the parallel result is wrong. (2) `copyin` for a read-only input; `create` for device-only > scratch (allocated on the device, never copied either way). (3) A `!$acc data` region moves the data **once** > (in at entry, out at exit) and every kernel → Introduction to Fortran Programming
index
`index(string, sub[, back])`, the 1-based position where `sub` first occurs in `string`, or 0 if it does not occur; with `back=.true.`, the position of the last occurrence. It returns a position, not a boolean — test `> 0` for "present." → Ch12
Inf
a signed infinity, the result of overflow or of a nonzero number divided by zero; obeys sensible rules ($\infty+1=\infty$, $1/\infty=0$) and compares greater than every finite number. → Ch20
initial-value problem (IVP)
a first-order ODE $\frac{dy}{dt} = f(t, y)$ together with an initial condition $y(t_0) = y_0$; the standard form solved by marching a numerical integrator forward in time. → Chapter 23 glossary — terms first-defined
initializer in a declaration ⇒ implicit `save`
the single most surprising Fortran trap. → Chapter 13 — Key Takeaways (Error Handling, Debugging, and Defensive Programming)
initializer in its declaration
`integer :: count = 0` — Fortran does → Introduction to Fortran Programming
inlining
the optimization that replaces a call to a procedure with a copy of the procedure's body pasted into the caller. Removes call overhead and, more importantly, lets the compiler optimize the pasted-in code together with its surroundings (constant propagation, vectorization across the former call bound → Ch27
Inner loop over the second index
strided, column-major-hostile; several × slow. The #1 numerical-Fortran bug. - **A wasted pass / temporary** — a full array written and re-read is pure traffic for a memory-bound kernel. - **`do concurrent` with a hidden dependency** — undefined result; the compiler trusts, does not check. - **Plain → Chapter 29 — Key Takeaways (Optimization Techniques)
input / output / input-output
especially which arrays get overwritten. 3. **Spot the leading dimensions** (`lda`, `ldb`, `ldu`, …) and pass the *declared* first dimensions. 4. **Check for a workspace query** (`work`, `lwork`): if present, call once with `lwork = -1`, then allocate. 5. **Read the `info` codes** for this routine's → Chapter 21 — Key Takeaways (Linear Algebra and LAPACK)
inquire
a statement that asks the runtime about the state of a file or unit without transferring data: `exist=`, `opened=`, `number=`, `size=`, `iolength=`, and more. → Ch07
Inseparability
values, name, and units are one object; you cannot pass the values without them. 2. **Safety** — an object, once constructed, is always valid (its array is allocated, its strings are set). 3. **Self-description** — the field can summarize itself (`report`) without the caller knowing its internals. 4 → Case Study 2: Designing a Labeled-Field Container
install fortls first
a language server is the single highest-value day-to-day upgrade to the Fortran editing experience. Reach for **stdlib** in any real project instead of re-writing means, sorts, and text-table readers by hand (it is a dependency you declare via fpm, exactly as in §H.4). Keep → Appendix H: Libraries and Tools Reference
integer division
division of two integers with `/`, which computes the mathematical quotient and then discards the fractional part, truncating toward zero: `7/2` is `3`, `1/2` is `0`, `-7/2` is `-3`. The remainder is obtained separately with `mod` or `modulo`. → Ch03
Intel `ifx`/`ifort`
often fastest on Intel hardware; flags like `-O3 -xHost -ipo -qopt-report`. - **NVIDIA `nvfortran`** — targets NVIDIA GPUs (OpenACC, CUDA Fortran; Chapter 35). - **LLVM `flang`** and **LFortran** — newer open compilers; LFortran is also interactive. → Appendix C: gfortran Setup and Compiler Flags
intent
an attribute on a dummy argument declaring how the procedure uses it: `intent(in)` (read-only), `intent(out)` (write-only; undefined on entry), or `intent(inout)` (read and write). The compiler enforces the declared intent — a safety feature most languages lack. → Ch06
interactively
one statement at a > time, in a read-evaluate-print loop or a Jupyter notebook — the way Python or Julia have always worked but > Fortran never could. It is what powers the browser playground. LFortran is **still in active development**: > it can handle a growing subset of modern Fortran but is not → Introduction to Fortran Programming
interface first
argument list, intents, purity — and treat the procedure body as a replaceable detail. The signature is the promise; the body is an implementation. - An **optional** argument is the right tool when one procedure must serve two workflows (enforce boundaries or not) without splitting into two; guard i → Case Study 2: Designing `step()` for the Long Haul
internal file
a `character` variable used as the unit of a `read` or `write` statement. `write(s, fmt) values` formats numbers into the string `s`; `read(s, fmt) vars` parses the characters of `s` into variables. No disk file is involved — the string is the file — and the full set of Chapter 7 edit descriptors ap → Ch12
internal procedure
a procedure defined after a `contains` statement inside another program unit; it has an explicit interface automatically and can access the host's variables via host association. → Ch06
internal write
formatting *into* a character variable. The descriptor `i5.5` writes the integer in a field of width 5 with a minimum of 5 digits, **zero-padded**, giving `00042`. Concatenated after `'heat_'`, `name` holds `heat_00042` followed by blanks to length 20; `trim` strips those trailing blanks. This is ex → Quiz Bank
interoperable derived type
a derived type declared with the `bind(c)` attribute (`type, bind(c) :: t`), laid out by the compiler with the same field order, padding, and alignment as the equivalent C `struct`. Its components must all be of interoperable type and kind; it may not have `allocatable` or `pointer` components, type → Ch14
intrinsic function
a function built into the language itself, always available without being written by the programmer or imported from a library (e.g. `sqrt`, `sin`, `abs`, `mod`, `modulo`, `real`, `selected_real_kind`); the compiler supplies the implementation and can often optimize it specially. → Ch03
intrinsic module
built into every standard-conforming > compiler, requested with `use, intrinsic :: iso_c_binding` — that supplies the named constants, derived > types, and procedures needed to interoperate with C. Its most important exports are a set of *kind > parameters*, one for each interoperable C type, each e → Introduction to Fortran Programming
iomsg
an optional specifier that fills a character variable with a human-readable description of an I/O failure, paired with `iostat`. → Ch07
iostat
an optional specifier on an I/O statement that stores an integer status instead of aborting on error: zero on success, negative at end-of-file or end-of-record (compare against `iostat_end`/`iostat_eor` from `iso_fortran_env`), positive on error. → Ch07
ISO/IEC 1539-1:2023
is real and published. But a language standard is a *document*, not a compiler, and the distance between "the standard says you may write this" and "gfortran on your laptop will compile it today" can be years. Some 2023 features are already usable; several are not yet in the compiler you have; a few → Introduction to Fortran Programming
iso_c_binding
an intrinsic module (requested with `use, intrinsic :: iso_c_binding`) that supplies the named kind parameters, derived types, and procedures needed to interoperate with C. Its exports include the C-interoperable kinds (`c_int`, `c_double`, `c_char`, …), the `c_ptr`/`c_funptr` types, the null consta → Ch14

J

Jacobi relaxation
repeatedly replacing each interior point with the average of its four neighbours until the largest change drops below `TOL`. Structure: `PROGRAM PLATE` → `SETBC` (boundaries) → `RELAX` (the GOTO convergence loop) → `OUTPT`. - **The tell for Jacobi:** the separate `TNEW` array — each sweep computes ` → Chapter 17 — Key Takeaways (Reading FORTRAN 77)
Job 2: reinterpreting the bits of a value
viewing a `REAL` as an `INTEGER` to inspect or hash its bit pattern. This is the one genuinely valid use, and it has a genuine modern replacement: the intrinsic function → Introduction to Fortran Programming
Join `fortran-lang.discourse.group`
the community answers beginners' questions generously. → Self-Paced Study Guide
joins
the extra threads go dormant — and the master alone continues. Between two parallel regions **exactly one** thread runs (the master); parallel regions are islands of many threads in serial execution. → Ch33
jump table
a single indexed jump — instead of testing each condition in turn. For a > handful of cases the difference is negligible, but the point stands: expressing your intent precisely > (this is a one-value dispatch) hands the compiler information it can optimize with. That theme — say what > you mean and → Introduction to Fortran Programming

K

Karp–Flatt citation (1990, CACM)
confident it exists; flagged Tier 2 for exact volume/pages. The formula is a direct inversion of Amdahl and is correct independent of the citation. 4. **Seymour Cray "oxen/chickens" epigraph** — attributed with "attributed to" hedge (folklore; Tier 2). 5. Chapters 27–30 index files do not yet exist → Chapter 31 — continuity delta
kernel
a procedure that runs on the device, executed simultaneously by many GPU threads (one thread per data element). In CUDA Fortran a kernel is a subroutine marked `attributes(global)` (called from the host, run on the device); every thread runs the same body but computes its own index and operates on i → Ch35
Key ideas to emphasize.
Two builds, always: a guarded development build and a lean release build. This is a *habit*, not a fact — reinforce it every time you compile in front of the class. - Never time a `-fcheck=all` build. This is the most common self-inflicted benchmarking wound; Case Study 30.1 is built entirely around → Chapter 30 — Instructor Notes
Key rules and numbers to carry forward:
**Inner loop over the first index** — column-major, unit stride. The one rule with no exceptions. - **Optimize in payoff order:** `-O2`/`-O3` + loop order → fusion + hoisting → vectorization → (rarely) anything else. The first hour buys most of the speedup. - **Roofline / memory-bound:** most stenci → Introduction to Fortran Programming
keyword argument
an actual argument named explicitly at the call site (`factor=0.5_dp`), allowing arguments to be passed out of order and optionals to be skipped; every argument after the first keyword must also be keyword. Requires an explicit interface. → Ch06
kind parameter
an integer that selects one of an intrinsic type's variants (which differ in storage size and therefore in range and precision); written in parentheses after the type, as in `real(dp)` or `integer(i64)`. The default kind is whatever the compiler chose, which portable numerical code should not depend → Ch03
known answer
a case where you can derive the exact result (a manufactured/analytical solution) — within a tolerance. "Doesn't crash" and "compiles" are necessary but far too weak: a routine can compile, run, and still return numerically wrong values. Test the *numbers*. → Quiz Bank

L

LAPACK
solves dense linear-algebra problems ($A\mathbf{x}=\mathbf{b}$, eigenvalues, SVD), in Fortran, on top of BLAS. **BLAS** — standardized low-level vector/matrix kernels (Levels 1/2/3) that the higher libraries call. **fpm** — the Fortran Package Manager: builds projects and manages dependencies from a → Ch16
LAPACK and BLAS
the numerical libraries everything depends on, written in Fortran (named here; used in Ch.21). - **16.2** FFTW, NetCDF, HDF5, MPI libraries (pointers forward to Parts VI and VIII). - **16.3** **fpm** — the Fortran Package Manager: build, dependencies, projects. - **16.4** stdlib and the `fortran-lan → Introduction to Fortran Programming — Master Outline
LAPACK routine naming
the systematic scheme by which every LAPACK routine name encodes its function in a few letters: a precision prefix (`s` real single, `d` real double, `c` complex single, `z` complex double), then a two-letter matrix type (`ge` general, `sy` symmetric, `po` symmetric positive-definite, `gt` general t → Ch21
leading dimension (`lda`, `ldb`)
the first dimension of a two-dimensional array *as it is declared in memory*, which in Fortran's column-major layout is the stride between the start of one column and the next. It is not necessarily the number of rows in use: solving the top-left `n`×`n` block of a `real(dp) :: a(100,100)` array req → Ch21
Legacy
an ocean of *validated* code (validation ≫ source). 3. **Domain fit** — built for arrays, complex numbers, math intrinsics. 4. **Modern Fortran is genuinely good** — modules, OOP, coarrays, C interop. → Chapter 1 — Key Takeaways (Why Fortran?)
legacy code
working, deployed, often old software that an organization depends on and must keep running; in scientific computing, frequently synonymous with "validated," "trusted," and "irreplaceable." → Ch01
legacy code is not a burden
expressed at the level of the language's own governance. → Introduction to Fortran Programming
Legacy code is not a burden; it is an inheritance
and you are about to improve the engineering while preserving the science. Let's modernize it. → Introduction to Fortran Programming
legacy VTK (STRUCTURED_POINTS)
the older, positional, human-readable `.vtk` text format for a uniform grid: five mandatory parts in fixed order — the magic string `# vtk DataFile Version 3.0`, a title line, `ASCII`/`BINARY`, `DATASET STRUCTURED_POINTS` with `DIMENSIONS`/`ORIGIN`/`SPACING`, and `POINT_DATA` with `SCALARS`/`LOOKUP_ → Ch26
len_trim
the intrinsic giving a string's length excluding trailing blanks (0 for an all-blank string); usually what you mean when you ask "how long is the content?" → Ch12
let each tool do its half
Fortran writes the field, ParaView animates it, matplotlib makes the paper figure; that division is the sixth theme, **Fortran and Python are better together**, at work. → Introduction to Fortran Programming
LFortran
a modern, LLVM-based Fortran compiler that can also run Fortran interactively, statement by statement, and powers the fortran-lang browser playground. (Named here as part of the community; defined and developed fully in Chapter 39.) → Ch16
licenses you grant the compiler
promises about your code's behavior that unlock optimizations the compiler could not otherwise justify. → Introduction to Fortran Programming
linear temperature profile
the steady state of the diffusion equation with fixed ends. For `n = 5` with ends 100 and 0, that analytical steady state is $[100, 75, 50, 25, 0]$. Run the simulation for many steps and the interior should approach those values: → Case Study 1: The Notebook That Wouldn't Finish
linear test still PASSES
the unscaled second difference of a linear field is $0$, and $0$ divided by anything is still $0$, so a missing multiplicative factor is invisible to an oracle whose expected value is $0$. The two `stable_dt` checks are untouched and PASS. Net: 2 fail, 3 pass, `error stop 1`. **Lesson:** to catch a → Ch37
linearly in $P$
communication takes an ever-larger share, because the strips get thinner (more perimeter per unit area). → Ch34
linker
the program that combines one or more object files with the libraries they depend on into a complete executable, resolving every reference from one piece to another. gfortran invokes it automatically unless told to stop after compiling with `-c`. A failure at this stage (e.g. "undefined reference to → Ch02
LINPACK benchmark
still the yardstick the [TOP500](../../part-01-foundations/chapter-01-why-fortran/index.md) uses to rank the world's fastest machines. But those early packages were built around > Level-1 BLAS (vector operations), and as processors grew deep cache hierarchies in the 1980s, memory > bandwidth — not a → Introduction to Fortran Programming
list-directed I/O
input or output in which the processor chooses the formatting, selected by writing `*` in place of a format: `print *, x`, `read *, x`. Quick to write and uncontrolled in layout; list-directed output emits one leading blank. → Ch07
logical
an intrinsic type holding a truth value, either `.true.` or `.false.`; printed as `T` or `F` under the `l` edit descriptor. → Ch03
logical expression
something that is true or false. You build logical expressions from two families of operators. The **relational operators** compare two values of the same kind: → Introduction to Fortran Programming
logical operator
an operator that combines logical values: `.and.` (both true), `.or.` (either true), `.not.` (negation), and `.eqv.` / `.neqv.` (equivalence / exclusive-or). The dots are part of the spelling. → Ch04
loop fission
A loop transformation that splits one loop into two or more over the same range, each doing part of the original body. Used to isolate a vectorizable portion from one that blocks vectorization (a call, a data-dependent branch), or to relieve register/cache-stream pressure. Also called loop distribut → Ch29
loop fusion
A loop transformation that merges two adjacent loops running over the same index range into a single loop, so each data element is touched once instead of once per loop. Cuts memory traffic and loop overhead and often eliminates a temporary array. Also called loop jamming. → Ch29
loop unrolling
the optimization that does several iterations' worth of a loop's work per pass, reducing per-iteration bookkeeping (counter increment, bound test, branch) and exposing more independent operations. Notably, gfortran does *not* unroll at any `-O` level by default — you request it with `-funroll-loops` → Ch27
lossy
`f8.2` keeps two decimals of a ~15-digit double. | For exact round trips, use unformatted or stream I/O (§F.6). | | A stray leading space / misaligned first column | List-directed output emits one leading blank. | Use an explicit format, e.g. `print '(a)', s`. | | `E` vs `ES` shows an unexpected man → Appendix F: I/O and Format Reference

M

machine epsilon
written $\varepsilon_{\text{mach}}$, the gap between 1.0 and the next larger representable number; $2^{-52} \approx 2.22\times10^{-16}$ for double, $2^{-23} \approx 1.19\times10^{-7}$ for single. Returned by `epsilon(x)` (only the kind of `x` matters). It is the relative resolution of the format. → Ch20
Manual
you must `deallocate`, or leak | | **Dangling** | Impossible | Possible (freed/out-of-scope target) | | **Undefined status** | No — `allocated()` is always valid | Yes — undefined until initialized | | **Assignment `b = a`** | Deep copy, auto-(re)allocated to fit | Copies the *value* through, if ass → Introduction to Fortran Programming
mask
itself a whole-array comparison — is true, with an optional `elsewhere` for the rest: → Introduction to Fortran Programming
matplotlib
ready ASCII, and know which format each tool wants. - Turn a saved field into a **publication-quality figure** with a small, rerunnable matplotlib script. → Introduction to Fortran Programming
Matrix multiply is blocking's home turf
high arithmetic intensity, $O(n)$ reuse — so tiling earns its complexity here, exactly where it did nothing for the memory-bound stencil. - **The optimization ladder is real:** naive (a few % of peak) → correct loop order → cache blocking (tens of %) → and still the tuned library beats you. - **A tu → Case Study 2: Optimizing a Matrix Multiply — and Learning to Call BLAS Instead
matrix top-row-first for imshow
standard conventions; confident. `numpy.loadtxt` → shape `(ny, nx)`; confident. 6. **Epigraph** (Hamming, "The purpose of computing is insight, not numbers.") — genuinely his, from *Numerical Methods for Scientists and Engineers*; tagged Tier 2, exact page not pinned. Non-load-bearing. 7. **Crameri → Chapter 26 — continuity delta
memory-bandwidth-bound
you are limited by how fast you can stream those arrays, not by the CPU's flop rate. (Chapter 28 measures exactly this; Chapter 29 attacks it.) → Ch23
memory-bound
describing a loop whose speed is limited primarily by how fast data moves between memory and the CPU, not by how much arithmetic it performs. Most dense array kernels are memory-bound, because floating-point units are far faster than main memory; the way to speed such a loop up is to move less memor → Ch27
memory-bound / compute-bound
A kernel is memory-bound when its arithmetic intensity is low enough that it hits the memory-bandwidth ceiling before the arithmetic ceiling (optimize by moving less data); compute-bound when high intensity lets it hit the arithmetic ceiling (optimize by keeping the arithmetic units fed). → Ch29
metadata
units, grid spacing/coordinates, and provenance (`source`, `history`). Preserve the science (the bytes), add the description. → Ch25
method of lines
solving a time-dependent PDE by discretizing the spatial derivatives on a grid while keeping time continuous, producing a large system of ODEs (one per grid point) to be time-stepped. → Chapter 23 glossary — terms first-defined
minimize host–device > transfers
move data to the device once, keep it resident while you compute on it repeatedly, and bring > back only what you must, as rarely as you can. → Introduction to Fortran Programming
Misconceptions to preempt.
*"Bit-for-bit is stricter, so it's safer."* No — stricter-than-the-problem-warrants is *fragile*; it fails on legitimate changes until the team ignores it (the "cry wolf" pitfall). Stricter is better only under a pinned build. - *"A test that passes is a good test."* The `allocated(u)` test passes a → Chapter 37 — Instructor Notes
Misconceptions to preempt:
*"RK4 is 4× slower than Euler."* No — 4× per step, but thousands of times fewer steps for a given accuracy. Do the order arithmetic on the board (F1). - *"Smaller step is always better."* Round-off (Ch. 20) and, for stiff/PDE problems, wasted work say otherwise; and for a conserved system, accuracy → Chapter 23 — Instructor Notes: Ordinary Differential Equations
miss rate is high
far higher than the handful of misses the arithmetic would need. The kernel does about four adds and one multiply per cell, over an array far larger than cache: it is → Case Study 1: The Loop That Strode the Wrong Way
missing data
grid points with no valid value (e.g. salinity on land) — so tools skip them rather than plot the sentinel. → Ch25
mixed-mode arithmetic
an arithmetic expression whose operands are of different types. For each binary operation Fortran promotes the lower-ranked operand to the higher type (`integer` → `real` → `double precision` → `complex`) and computes in that higher type; crucially, the type of a subexpression is fixed by its own op → Ch03
Modern Fortran
free-form, `implicit none`, lowercase keywords, `intent` on every argument, modules over `COMMON` — and is written for `gfortran` version 10 or later against the Fortran 2018 standard. When a new feature needs a new compiler flag, we show the command; get comfortable compiling from the terminal earl → How to Use This Book
Modern Fortran (2018), free-form
the page to keep open in a second window while you write code. Everything here is the modern style the book teaches: `implicit none` everywhere, lowercase keywords, kind-parameterized reals (`real(dp)`), `intent` on every argument, arrays and modules as first-class tools. Each section names the chap → Appendix A: Modern Fortran Syntax Reference
modern Fortran is a modern language
most languages leave you poking at bit patterns, while Fortran 2003 standardized the interface: → Introduction to Fortran Programming
modern Fortran is unambiguously a modern language.
## 4.4 `cycle`, `exit`, Named Loops, and Nesting → Introduction to Fortran Programming
module
a program unit (`module name` … `end module name`) that packages related definitions — named constants, variables, derived types, and procedures — so other program units can access them via `use`. A module is not a program and runs nothing on its own; it is a library of definitions. → Ch08
module map
the dependency graph of a code's modules (who `use`s whom), which is also its compile-order graph and its layering; the codebase's true, compiler-enforced table of contents. → Ch36
module procedure
a subroutine or function defined after a module's `contains` statement. Because it lives in a module it carries an explicit interface for every `use`r, and it may be `public` or `private`. → Ch08
module variable
a variable declared directly in a module (not inside one of its procedures). It has the `save` attribute implicitly (persists for the whole run, initialized once) and is shared by every procedure that can see it; best kept `private` and mutated only through public procedures. → Ch08
module variables
ordinary variables, declared in the module's specification part, that persist for the life of the program and are shared by every procedure that can see them. → Introduction to Fortran Programming
modules
the subject of [Chapter 8](../../part-02-modern-fortran-features/chapter-08-modules/index.md), where this two-step picture grows into the real story of how large Fortran programs are compiled. → Introduction to Fortran Programming
Moore's Law
the doubling of transistor *count* — continued. Confusing the two is the most common error in this story: the transistors kept coming; what stopped was the ability to clock them faster within the power budget. → Ch31
more expensive
computing the inverse costs roughly three times an LU solve — and (2) it is **less accurate**, because the explicit inverse accumulates extra rounding and `A⁻¹b` has a worse error bound than a direct solve. `dgesv` instead factors `A` once (LU with pivoting) and solves by forward/back substitution, → Ch21
moving less memory
better loop order, cache blocking, fusing passes — the material of [Chapter 29](../chapter-29-optimization-techniques/index.md), not from squeezing more flops. For high-intensity kernels (matmul), vectorization and register tiling pay off enormously, which is why a tuned BLAS `dgemm` is so fast and → Case Study 2: Designing a Kernel the Compiler Will Vectorize
MPI
the **Message Passing Interface** — is a standardised library for > distributed-memory parallel programming, in which many independent processes, each with private memory, > coordinate by explicitly sending and receiving messages. It is not part of any language; it is a > *specification* (first stan → Introduction to Fortran Programming
MPI (Message Passing Interface)
a standardised library (first standardised 1994) for distributed-memory parallel programming, in which many independent processes, each with private memory, coordinate by explicitly sending and receiving messages. Not part of any language; a specification with Fortran/C/C++ bindings, implemented by → Ch34
MPI model
many processes, each with private memory, coordinated by messages — and write the `mpi_init` … `mpi_finalize` skeleton that every MPI program shares. - Send and receive data between processes with **point-to-point** calls, get the argument order exactly right, and diagnose and cure the notorious sen → Introduction to Fortran Programming
MPI-IO
the part of the MPI standard for parallel file I/O: all processes write to (or read from) a single shared file concurrently, each into its own region, so output does not funnel through one rank. Usually used through a self-describing library (parallel HDF5 / parallel NetCDF) built on it. → Ch34
mpif90 (mpifort)
the MPI Fortran compiler wrapper: it calls the underlying Fortran compiler (usually gfortran) with all MPI include and library flags added automatically; used exactly like gfortran. Launch the resulting program with `mpirun -np N`. → Ch34

N

name mangling
a compiler's transformation of a source-level procedure or variable name into the decorated symbol that actually appears in the object file and linker (with gfortran: `foo` → `foo_`, and module `m`'s `foo` → `__m_MOD_foo`). It differs between compilers and from C, which is why `bind(c)` — giving a c → Ch14
named construct
any `do`, `if`, or `select case` given a name (`name: do …` / `end do name`); `exit name` and `cycle name` then act on the named construct, the only clean way to break out of or continue an outer loop from inside an inner one. → Ch04
namelist
a statement associating a group name with a list of variables (`namelist /config/ nx, alpha`) so that one `read(unit, nml=config)` parses a `&config nx=100, alpha=1e-4 /` block, matching values to variables by name, case-insensitively, in any order, with omitted names left unchanged. Fortran's built → Ch07
NaN
"Not a Number," the result of an undefined operation ($0/0$, $\infty-\infty$, $\sqrt{-1}$ in real arithmetic). It is contagious (any arithmetic with it yields `NaN`) and not equal to anything, including itself — so `x /= x` (or `ieee_is_nan(x)`) detects it. → Ch20
navigate
find the entry point, the solver, and its inner stencil loop (the likely hot > spot). Then **profile** to confirm where the time actually goes. Only after measuring do you optimize. > Navigate, then measure, then change. → Introduction to Fortran Programming
neither a race nor a bug
it is floating-point **non-associativity** ([Chapter 20](../../part-05-numerical-methods/chapter-20-floating-point/index.md)). A parallel reduction adds the elements in a *different grouping* than the serial left-to-right loop (and a different grouping again for each thread count); since every float → Ch33
NetCDF
publishing gridded data to climate scientists is exactly CF-NetCDF's home turf; the community's tools expect it. (b) **HDF5** — a deep tree of thousands of nested datasets you analyze yourself needs HDF5's group hierarchy and control. (c) **NetCDF** — CF metadata (coordinate variables in metres) is → Ch25
Neumann boundary condition
A boundary condition that fixes the *normal derivative* (gradient) of the field on the boundary ($\partial u/\partial n = q$). The common zero-flux ("insulated") case is coded by setting the edge equal to its inward neighbour, e.g. `u(1) = u(2)`. → Ch24
never report a timing you cannot reproduce
a benchmark you cannot repeat is a rumour, not a measurement. → Chapter 28 Exercises — Profiling and Benchmarking
Never run code
reason about output by hand. → Style & Continuity Bible — Introduction to Fortran Programming
Never time a `-fcheck=all` build
the run-time checks can slow it several-fold, so you measure the > checks, not your algorithm. **Remove `-fcheck=all` for production.** → Chapter 30 — Key Takeaways (Compiler Flags and Platform-Specific Optimization)
no
*you* track dependencies | → Appendix H: Libraries and Tools Reference
no code was executed to produce the outputs
every `! Expected output:` was computed by hand. The solver's signature computation, the 5×5 plate marched two steps, is reproduced digit-for-digit by every version here: `28 / 32 / 28`, `4 / 4 / 4`, maximum `100`. → Appendix I: The Complete Heat-Solver Code
no computer, compiler, or interpreter may be used
in the spirit of the book, every numeric answer is to be *hand-computed*, and partial credit is given for correct reasoning even when the arithmetic slips. Show your work. All code you write should be modern Fortran (free-form, `implicit none`, `real(dp)`, `intent` on arguments) that would compile w → Final Exam
no dangling
the allocatable is the sole owner, so there is no stray alias to outlive it; (3) **no association-status pitfalls** — `allocated()` is always a valid question, and there is no "undefined" state; (4) **better optimization** — a plain allocatable cannot be aliased, so the compiler has full no-aliasing → Ch11
no explicit loop
a single whole-array expression using array sections `u(1:n-2)`, `u(2:n-1)`, `u(3:n)`. Confirm it gives the same numbers as the loop version, and say why the array form is both clearer and friendlier to the optimizer. → Chapter 23 Exercises: Ordinary Differential Equations
no gfortran equivalent
it is `nvfortran`-only. → Appendix G: Parallel Programming Reference
No named fictional characters
real compilers, real libraries (LAPACK, NetCDF), real codes (WRF, CESM, VASP), and the reader's own solver carry the narrative. - **Motivate before you formalize.** Say the idea in plain words first ("column-major means the *first* index is the one that moves fastest through memory"), then give the → Style & Continuity Bible — Introduction to Fortran Programming
no timing here was measured
every speedup is an illustrative order of magnitude, and every *correctness* value was hand-computed. This is a feature, not an apology: it forces you to run the code yourself and *measure your own machine*, which is the entire point of Part VII. When your ratio differs from "typical," that is not a → Chapter 27 — Teaching Notes
no timing in this chapter was measured
every speedup figure is an illustrative order of magnitude, framed as "typical; measure it yourself," never a benchmark we ran. Program *outputs* — the actual numbers a correct program prints — are still computed by hand and exact. When you see "10×," read it as "several-fold, and you will confirm t → Introduction to Fortran Programming
non-blocking communication
an MPI operation (`mpi_isend`, `mpi_irecv`) that initiates a send or receive and returns immediately, handing back a request handle; the data is unsafe to use until completed with `mpi_wait`/`mpi_waitall`. The point is overlap: independent work done between the initiate and the wait hides the commun → Ch34
non-portability
overlaying a `REAL` on an `INTEGER` assumes they have the same size and representation, which is not guaranteed across machines, so the same code can corrupt memory elsewhere; (2) **silent reinterpretation** — reading `RBUF` after `IBUF` was written (or vice versa) yields the *bit pattern* reinterpr → Ch17
normally
exit status 0 by default (or a code you supply) — and reads as an intentional "we're finished" halt. `error stop` signals **error termination**: it returns a nonzero error status, so scripts and CI see the run as *failed*, and in a parallel (coarray) program it is required to terminate **all images* → Quiz Bank
not
C. Link LAPACK - D. Enable OpenMP → Quiz Bank
not truncated
the field fills with asterisks (`****`). Examples show gfortran's output; anything the standard leaves *processor-dependent* is flagged as such. → Appendix F: I/O and Format Reference
not portable
they record nothing about shape, type, or byte order (endianness). For data you must share, archive, or read years later, use a self-describing format (**HDF5** or **NetCDF**, [Chapter 25](../part-06-file-io-and-data-management/chapter-25-scientific-data-formats/index.md)); for visualization, the ** → Appendix F: I/O and Format Reference
nothing checks the mismatch
an untyped, corruption-prone global. A **module** is a real namespace with an **explicit, compiler-checked interface**: it can keep its state `private` and expose it only through procedures, cannot silently mis-overlay memory, and can be reasoned about in isolation. Any one of these — *the compiler → Midterm Exam — Solutions
numerical equivalence
the property that two programs produce the same results on a given input, either *bit-for-bit identical* (every floating-point value equal to the last bit) or identical *to within a stated tolerance* ("close enough"). → Ch18
numerical stability
a property of an *algorithm*: how much error it adds beyond what the problem's conditioning forces. A stable algorithm is about as accurate as the conditioning allows; an unstable one manufactures extra error (typically through internal cancellation), returning poor results even for well-conditioned → Ch20
NVIDIA-specific
it runs only on NVIDIA GPUs, compiled only by > `nvfortran` — which is the price of its control, and the contrast with portable OpenACC. → Introduction to Fortran Programming

O

object file
the output of compiling a single source file: a file conventionally ending in `.o` (gfortran produces `.o` on every platform, including Windows; some Windows-native compilers use `.obj` instead) containing the source translated into machine instructions but not yet a runnable program, because refere → Ch02
obsolescent
still legal, but on the way out, and flagged by the committee as a feature to avoid. Modern code does not use it. For a masked assignment, use `where` (§4.5); for an independent loop, use `do concurrent`; for a plain whole-array operation, just write the array expression (`a = b * 2.0_dp`), which [C → Introduction to Fortran Programming
obsolescent features
the committee's own on-notice list of constructs to avoid, which reads as a near-exact table of contents for this chapter. *Tier 1.* - **The FORTRAN 77 standard (ANSI X3.9-1978).** The original definition of the dialect you are learning to read; historically interesting and occasionally the only aut → Further Reading: Reading FORTRAN 77
offload
to move a portion of a program (typically a data-parallel loop or kernel and the data it needs) from the host to the device for execution, then bring the results back. A GPU program is a host program that offloads its hot parallel regions while keeping serial control flow and I/O on the host. → Ch35
On a derived type
`type, bind(c) :: t` — makes the type *interoperable*: it is laid out in memory with exactly the same field order, padding, and alignment as the equivalent C `struct`. This is §14.5's centerpiece. - **On a module variable** — `integer(c_int), bind(c, name="verbosity") :: verbosity` — gives a Fortran → Introduction to Fortran Programming
On a real machine, it is not
and the reason is the entire subject of [Chapter 20](../chapter-20-floating-point/index.md). → Introduction to Fortran Programming
on the order of a few ×
*illustrative, machine-dependent* (Tier 2); always measure and record. - `-Ofast` = `-O3` + `-ffast-math`; if you want `-O3`'s speed without the numeric risk, use `-O3` alone. → Chapter 30 — Key Takeaways (Compiler Flags and Platform-Specific Optimization)
One
the master thread alone. Parallel regions are islands of many threads in a sea of serial > execution; outside them, only the master runs. > 2. It returns **0** for the master. On a team of 8, values range over `0, 1, …, 7` (that is, `0` to > `omp_get_num_threads() - 1`). > 3. **One.** Without `-fope → Introduction to Fortran Programming
One module per file, module named after the file
the convention that makes a code navigable from a file listing alone. → Chapter 36 — Key Takeaways (Anatomy of a Real Scientific Code)
one value per `write`
a million `write` statements per step, each formatting one double into 24 characters of decimal text. The formatting work alone is enormous. Second, it is called **every step**, producing 5,000 files totaling gigabytes, almost none of which the colleague will ever look at. The routine is correct, an → Case Study 1: The Simulation That Spent Its Life Formatting
only differences are meaningful
the absolute value of `t0` is an arbitrary origin, so you always subtract two readings. Second, `cpu_time` measures *time the CPU spent on your program*, not time elapsed on the clock on the wall. If your program sleeps, waits for a disk read, or blocks on the network, that idle time is *not* charge → Introduction to Fortran Programming
only the selected branch is evaluated
the > untaken value is never computed. Fortran 2023 also allows the same `? :` form as an *actual argument* in > a procedure call (a "conditional argument"). This is Fortran's version of what C calls the ternary > operator and what Python writes as `a if cond else b`. → Introduction to Fortran Programming
OpenACC
an open standard for directive-based parallel programming of accelerators. Ordinary Fortran is annotated with `!$acc` comment-directives that an OpenACC-aware compiler turns into device offload (data movement + parallel kernels). Portable, incremental, and — like OpenMP directives — ignorable by a n → Ch35
OpenBLAS
a free, open-source, aggressively tuned BLAS/LAPACK; link `-lopenblas` (it usually provides the LAPACK symbols too, so it can replace both `-llapack -lblas`). The common default for good performance on commodity hardware. - **Intel MKL** (Math Kernel Library) — Intel's heavily optimized BLAS/LAPACK, → Introduction to Fortran Programming
OpenMP
Open Multi-Processing: a standard set of compiler directives (in Fortran, comments beginning `!$omp`), library routines (`omp_lib`), and environment variables for shared-memory parallel programming in Fortran, C, and C++. Because the directives are comments, the same source compiles as correct seria → Ch33
opt-in, per-pointer, and unenforced
the programmer must remember it and must not get it wrong, whereas Fortran's non-aliasing is the default state of the world for every argument. → Ch27
optimization level
the `-O` flag controlling how hard the compiler optimizes: `-O0` (none, debuggable), `-O2` (the safe, IEEE-clean production workhorse), `-O3` (adds auto-vectorization and aggressive inlining), `-Ofast` (`-O3` plus `-ffast-math`, which reorders floating-point arithmetic and can change results). → Ch27
optimization report
diagnostic output the compiler emits on request describing which optimizations it applied to which source lines, and — often more usefully — which it declined and why. In gfortran, the `-fopt-info` family: `-fopt-info-vec` (loops vectorized), `-fopt-info-vec-missed` (loops not vectorized, with reaso → Ch27
optional
if omitted, there is no upper limit. Predict the results of `clamp(5.0_dp, 0.0_dp, 3.0_dp)`, `clamp(-1.0_dp, 0.0_dp, 3.0_dp)`, and `clamp(2.0_dp, 0.0_dp)`. *(Code solution provided.)* → Exercises: Procedures
optional output
a diagnostic the caller may or may not want. A linear solver might declare `real(dp), intent(out), optional :: residual` and compute it only when asked, guarding the assignment with `if (present(residual))`. The caller who cares passes a variable and reads the residual back; the caller who does not → Introduction to Fortran Programming
optional argument
a dummy argument with the `optional` attribute that the caller may omit; inside the procedure, the intrinsic `present(arg)` reports whether it was supplied. Requires an explicit interface. → Ch06
optional arguments
the caller must know which arguments may be omitted; (3) **assumed-shape array arguments** (`x(:,:)`) — the shape/bounds are passed through the interface. (Also: automatic checking of argument type/rank/`intent`.) → Ch08
order of accuracy
the exponent $p$ in a method's error model $E(h) \approx C h^p$ as $h \to 0$. Measured numerically by halving $h$ and confirming the error ratio approaches $2^p$ (2 for first order, 4 for second, 16 for fourth). → Ch22
order verification
then run this chapter's convergence study on your own solver and confirm you get order 2. Verifying your own code once is worth more than reading three chapters about it. 3. Read **Wilson et al.** and package your solver for reproducibility (Case Study 2, Phase 5) — the discipline that makes the res → Further Reading: Capstone — From Physics to Publication
oscillate in the last bit forever
flipping between two adjacent representable values, never exactly equal, and your loop never exits. This is the real-equality pitfall of §4.1 in its most dangerous form, because the loop *looks* correct and hangs only sometimes. → Case Study 1: Reading and Porting a Convergence Loop
out of bounds
a memory error, caught at run time by `-fcheck=all` and otherwise silent corruption; and (2) `v(5)` is **never assigned**, so it is left undefined. **Fix (3 pts):** loop over the array's real bounds and index directly: → Midterm Exam — Solutions
overflow
when a result's magnitude exceeds the largest finite representable number (`huge`); under IEEE 754 the result becomes a signed infinity (`Inf`). → Ch20
overflows
the program crashes. A `do` loop uses **O(1)** stack (one frame, reused every iteration) and is faster besides, having no per-call overhead. Summation is not tree-shaped — the subproblem shrinks by just one element — so recursion is the wrong tool; use a loop (or the `sum` intrinsic). → Ch06
overhead
the difference between measured speedup and the overhead-free Amdahl ideal. Two causes from this chapter (any two): **fork/join overhead** paid per parallel region (worst when a fresh team is forked every time step — hoist it); **synchronization cost** (implicit/explicit barriers, or a `critical`/`a → Ch33

P

parallel efficiency
the speedup divided by the processor count, $E(N) = S(N)/N$; the fraction of each processor that is actually being used. Perfect (linear) speedup corresponds to $E = 1$. → Ch31
parallel overhead
communication, synchronization, or load imbalance — that grows with the core count (see Case Study 1). → Ch31
parallel region
the block of code between `!$omp parallel` and `!$omp end parallel`, executed by every thread of the forked team. Serial code outside such regions runs on the master thread only. → Ch33
parameter
an attribute declaring a named constant whose value is fixed at compile time and can never be reassigned (an attempt to do so is a compile-time error); because the value is known at compile time it is folded into the generated code at no run-time cost. Used for `dp`, physical constants, and fixed si → Ch03
parameterized derived type (PDT)
a derived type carrying type parameters written in parentheses after its name: a *kind* parameter (`integer, kind`, a compile-time constant such as a precision) and/or a *length* parameter (`integer, len`, fixed when an object is created, such as an array extent). Standard since Fortran 2003, but th → Ch09
parent component
every extension contains its parent as a component named after the parent type, so `self%shape_t%describe()` invokes `shape_describe` non-polymorphically. This "call `super` then extend" pattern is one you will use constantly. → Introduction to Fortran Programming
partial derivatives
its rates of change > with respect to each variable separately, written $\frac{\partial u}{\partial t}$, > $\frac{\partial u}{\partial x}$, and so on, where the $\partial$ ("partial") signals that the other > variables are held fixed. Where an ODE governs a function of one variable, a PDE governs a → Introduction to Fortran Programming
partial differential equation (PDE)
An equation relating a function of several variables to its partial derivatives (rates of change with respect to each variable separately). Where an ODE governs a function of one variable, a PDE governs a *field* spread over space that also evolves in time. Examples: the heat, wave, and fluid-flow e → Ch24
partially supported by current gfortran
those caveats are flagged where they occur. → Appendix G: Parallel Programming Reference
passed-object dummy argument
the dummy argument of a type-bound procedure that automatically receives the invoking object; it must be declared **polymorphic** (`class(name)`, never `type(name)`). Its identity is controlled by `pass` (default: the first dummy), `pass(name)` (a named dummy), or `nopass` (no object passed). → Ch09
Per-step transfers
a `copy` on the loop-body kernel instead of a `!$acc data` region around the loop. The classic way an offload runs *slower* than the CPU. - **CUDA C's zero-based index in CUDA Fortran** — `blockIdx%x*blockDim%x + threadIdx%x` is off by one every block; CUDA Fortran needs `(blockIdx%x - 1)*blockDim%x → Chapter 35 — Key Takeaways (GPU Computing)
performance
cache references and misses via a simulated cache. You never run both in one invocation because valgrind runs exactly one tool per process (`--tool=` selects it), and each already slows the program 20–100×. For a *correct but slow* program you reach for **cachegrind** (memcheck has nothing to fix — → Ch28
performance is not accidental
it is Amdahl's ceiling, the roofline's walls, and the memory layout of [Chapter 5](../../part-01-foundations/chapter-05-arrays/index.md), reasoned about deliberately rather than hoped for. → Introduction to Fortran Programming
Performance is not accidental
it never was, but now it is not even *automatic*. The hardware will not make your serial program faster on its own anymore. If your 2005-era mental model is "wait for a faster chip," that model is dead. The only remaining sources of large speedups are the ones you must reach for deliberately: better → Introduction to Fortran Programming
periodic boundary condition
A boundary condition that wraps the domain so the last point's neighbour is the first ($u_{n+1} \equiv u_1$), modelling a representative patch of a large uniform system without edges. Coded with `modulo` neighbour indexing. → Ch24
pFUnit
a unit-testing framework for Fortran developed at NASA's Goddard Space Flight Center, designed for scientific computing and able to run tests in parallel under MPI. The lighter, fpm-native `test-drive` is a common alternative for smaller projects. (Used in Chapter 37.) → Ch16
physics module
a module that encodes one piece of the science — a single physical process or term in the governing equations — as procedures computing it, ideally `pure` functions of their inputs (e.g. `diffusion`, `advection`). In the project, the five-point Laplacian is the physics. → Ch36
pivot
and never asks whether that is a safe thing to do. → Case Study 1: The Solver That Divides by Zero
platform-dependent
a negative return would break compilation. Flagged in CS-02 Phase 3 and §20.6. The qp reference output (0.25) is exact. 5. **Kahan summation** (CS-02 Phase 4) is presented as algorithm + correctness reasoning; I deliberately did NOT claim a specific hand-traced printed sum for it (multi-step tie beh → Chapter 20 — continuity delta
playground
concrete evidence that "modern Fortran is a modern language." → Quiz Bank
point-to-point communication
the exchange of a message between exactly two processes: one calls a send operation naming the receiver, the other a matching receive naming the sender. The fundamental building block of MPI; core pair `mpi_send`/`mpi_recv`. → Ch34
POINT_DATA
the legacy-VTK section declaring that the following arrays hold one value *at each grid point*; its count must equal `nx*ny*nz` (the number of points, which is what `DIMENSIONS` gives). Contrast `CELL_DATA` (one value per cell), used by finite-*volume* schemes; finite-*difference* nodal values are p → Ch26
pointer
a variable declared with the `pointer` attribute that holds no value of its own but can be *associated* with (made an alias for) another object, or with a block of memory obtained by `allocate`. It is dereferenced automatically — using the pointer's name uses its target — and a pointer to an array c → Ch11
pointer aliasing
the situation in which two names refer to the same region of memory. Fortran assumes procedure arguments do not alias, which frees its compiler to optimize aggressively; C added the `restrict` keyword to let programmers make the same promise. → Ch01
pointer assignment
association of a pointer with a target using the `=>` operator (`p => a`), which makes the pointer an alias for the target and changes what the pointer refers to. It is distinct from value assignment `=`, which — for an associated pointer — copies a value *through* the pointer into its current targe → Ch11
pointer chasing
load a node, read its `next` address, jump to a random new location, stall while the processor fetches a cache line it cannot predict, repeat. This defeats the two things modern hardware is fastest at: **prefetching** (the CPU cannot guess where `p%next` leads, so it cannot fetch ahead) and **vector → Introduction to Fortran Programming
pointers and targets
how `=>` differs from `=`, how association status can bite you, when a linked list or tree actually beats an array in Fortran (rarely), and why, for the field in your solver, `allocatable` remains the right choice and `pointer` the wrong one. It is the last of the "how Fortran manages data" chapters → Introduction to Fortran Programming
polymorphic
`class(name)`, *never* `type(name)`. It must be `class` so the binding can be inherited by an extension of the type (Chapter 10); the compiler rejects `type` on a passed object outright. → Ch09
polymorphism
the ability of one piece of code to operate on values of different types through a common interface, with the specific behavior chosen by each value's dynamic type. A call on a polymorphic object *dispatches* to the procedure of whatever type it currently holds. → Ch10
portfolio piece
the thing you put on GitHub, link from your résumé, and show an employer. A working program in a folder is private evidence. A *packaged* program — with a README that explains it, a license that lets others use it, a figure that shows what it does, and an abstract that describes it in a paragraph — → Introduction to Fortran Programming
possibly non-contiguous and possibly > aliasing
so the compiler cannot assume unit stride *or* that `u` and `u_new` are distinct, and it > refuses to vectorize the inner loop (and may insert copy-in/copy-out). The fix is to declare them > `contiguous`: `real(dp), contiguous, pointer :: u(:,:), u_new(:,:)`. That restores the unit-stride > guarante → Introduction to Fortran Programming
predict every output before you compile
the whole book is written that way. → Exercises: Object-Oriented Fortran
Present it
the figures, the paper structure, and what a reviewer is actually looking for. → Introduction to Fortran Programming
prevents name clashes and surprises
if `kinds` later grows a new public name that collides with a local name here, the bare `use` would break or shadow silently, while `only: dp` is unaffected. (It also makes the code's true dependencies auditable, which matters for large builds.) → Ch08
private
an attribute/statement making a module entity visible only inside the module. A bare `private` (no list) sets the module's default to hidden, so only entities explicitly marked `public` escape — the recommended "hide by default, expose on purpose" idiom. → Ch08
procedure pointer
a pointer that is associated with a *procedure* rather than data, declared against an interface, so that one call site can invoke different procedures chosen at run time (the callback pattern). → Ch11
procedures
subroutines and functions — and the feature that makes passing arrays around both safe and fast: `intent`, which lets you promise the compiler whether an argument is read, written, or both, and **assumed-shape** array arguments, which let a procedure accept an array of any size and ask it its own sh → Introduction to Fortran Programming
processes
separate running programs, each with its *own* private memory — and no process can touch another's variables at all. If process 0 has a value that process 1 needs, process 0 must package it up and *send* it, and process 1 must *receive* it. There is no shared state; there is only communication. This → Introduction to Fortran Programming
processes with private memory
no process can read another's variables. To obtain a value another process computed, it must be *sent* (`mpi_send`) by the owner and *received* (`mpi_recv`) by the process that needs it: coordination is by explicit message, never by shared state. → Ch34
profile-guided optimization (PGO)
A two-phase build: first compile an *instrumented* binary and run it on representative input to record which branches, functions, and loops are actually hot; then recompile using that recorded profile so the optimizer's branch-layout, inlining, and hot/cold decisions are informed by real behavior ra → Chapter 30 — Glossary (terms first-defined here)
profiling
Measuring *where* a running program spends its resources (time, memory traffic, cache misses) so you can find the small part of the code that dominates the cost. A profiler answers "where does the time go?", as opposed to a timer, which answers only "how long did this region take?". → Ch28
Profiling the `-O0` build
measures the wrong balance; `-O2` inlines helpers away. Profile what you ship. - **Guessing `count_rate`** or using default-integer counters — wrong or negative times. - **Timing an un-warmed run** — measures cache/page/frequency start-up, not steady state. - **Reporting one sample** — an anecdote, → Chapter 28 — Key Takeaways (Profiling and Benchmarking)
promise you make and the compiler trusts
it does not re-prove independence, so it > is free to vectorize, unroll, or (with the right flags or compiler) run the iterations across multiple > threads or a GPU. Crucially, `do concurrent` does *not by itself guarantee* parallel or vector execution; > it removes the compiler's need to prove inde → Introduction to Fortran Programming
public
an attribute/statement making a module entity visible to any unit that `use`s the module. `public :: a, b` exposes exactly the named entities. → Ch08
Pure
`sum(x)` has no side effects. *Not* elemental, because its argument is an array, and elemental procedures take scalar arguments. (b) **Not pure** — it performs I/O (`print`). (c) **Not pure** — it modifies module-level state (the counter). (d) **Pure** — `x**2 + 1` has no side effects; and because i → Ch06
pure refactor
renaming variables, splitting a module, reordering declarations, with no intended change to any arithmetic — produced *identical* output. Here even a single changed bit means the refactor accidentally altered behaviour, so bit-for-bit is exactly the check you want, and a tolerance would be *too weak → Ch37
PVD
a ParaView *collection* file (`.pvd`): a small XML file mapping each data file to a physical `timestep` value. Opening the single `.pvd` loads the whole series with correct physical times on the slider, decoupling physical time from the file index. → Ch26

Q

Q1, Q2, Q6, Q7, Q19
§22.1 (finite differences, Taylor-derived orders). - **Q3, Q11, Q13, Q15** — §22.2 (trapezoidal and Simpson's rules). - **Q4, Q14** — §22.3 (Gaussian quadrature). - **Q5, Q16, Q20** — §22.3–§22.4 (Richardson, measuring order of accuracy). - **Q8, Q9, Q10** — §22.4 (round-off floor; the Chapter 20 co → Chapter 22 Self-Check Quiz: Numerical Integration and Differentiation
quad is usually not hardware
on mainstream CPUs gfortran emulates `real128` in software (via libquadmath), so it can be tens to hundreds of times slower than double. Reach for it to *check* a double result or to rescue a specific ill-conditioned step, not as a blanket safety margin. Second, **precision is not accuracy**: comput → Introduction to Fortran Programming
quadrature
the numerical approximation of a definite integral $\int_a^b f\,dx$ by a weighted sum $\sum_i w_i f(x_i)$ over a finite set of nodes $x_i$ with weights $w_i$. The word (from "constructing a square of equal area") is the classical term for finding area under a curve; a quadrature rule is defined enti → Ch22

R

rank
the number of dimensions of an array: a vector has rank 1, a matrix rank 2; Fortran allows up to rank 15. → Ch05
read-only
the procedure may use its value but must not change it. > `intent(out)` means **write-only** — the argument arrives undefined, and the procedure is expected to set > it. `intent(inout)` means **read and write** — the procedure receives a meaningful value and may modify > it in place. The compiler ch → Introduction to Fortran Programming
Recompilation cascades
with everything in one module, editing any procedure body regenerates the module's `.mod`, forcing every file that `use`s it to recompile; moving the body into a submodule means editing it recompiles only the submodule, because the parent's interface (`.mod`) is unchanged. (2) **Circular dependencie → Ch08
record
the atomic chunk a single I/O statement transfers: one line for a text file, one `write`'s worth of bytes for unformatted data. → Ch07
Record the compiler, flags, and CPU
the CPU especially when `-march=native` is used. A number without its manifest is a story, not a measurement. - The easiest person to fool is yourself; the flags are where the fooling happens. → Case Study 30.1: The Benchmark That Lied
recursion
a procedure that calls itself; in Fortran it must use a `result` clause, and (before Fortran 2018's default) be marked `recursive`. → Ch06
reduction
a `reduction(op:var)` clause that combines per-thread contributions under an associative operator `op` (`+`, `*`, `max`, `min`, `.and.`, `.or.`, …). Each thread gets a private copy of `var` initialized to the operator's identity, accumulates into it without contention, and the runtime combines the p → Ch33
refactoring
a change to the *form* of code that leaves its *observable behavior* unchanged; a change that alters the answer is by definition not a refactoring but a bug. → Ch18
regression harness
a test that runs the code on known inputs and checks the outputs against a trusted reference. You will design the harness, decide what "still correct" means when floating-point rounding is in play, build it in modern Fortran, and establish the baseline that [Chapter 18](../chapter-18-modernizing-leg → Case Study 2: The Safety Net
regression test
a test that runs a program on a fixed input and compares its output against a stored "golden" reference (captured from the trusted version), reporting failure if they differ by more than an allowed amount; in a migration, the reference is the original program's output. → Ch18
relational operator
an operator that compares two values and yields a `logical`: `==` (equal), `/=` (not equal), `<`, `<=`, `>`, `>=`. → Ch04
repeat count
shorthand for `0.0, 0.0, 0.0` — and the `(EDGE(I), I=1,3)` is an **implied-DO**, a compact loop that lists `EDGE(1), EDGE(2), EDGE(3)`. Modern Fortran folds all of this into the declaration: `real :: ttop = 0.0, tbot = 100.0` and `real :: edge(3) = 0.0`. → Introduction to Fortran Programming
reported, not measured
never quote it as a statistic. - A `real(dp)` field of $N\times N$ costs $8N^2$ bytes; a solver needs **≥ 2** such fields at once. - Code with **no LICENSE** is legally unsafe for others to reuse. - Integer division still truncates ($7/2 = 3$); kinds still matter; column-major still wins — the whole → Chapter 40 — Key Takeaways (The Fortran Career)
representative layout
a composite, idealized from the common structure of computational-fluid-dynamics, weather, and diffusion codes, not a copy of any one project. Read it as a floor plan, not a specific building: → Introduction to Fortran Programming
reproducibility
The property that a computational result can be regenerated from the recorded materials — the same code, inputs, build, and environment producing the same result (bit-for-bit or within a stated tolerance); what makes a computational result checkable, and therefore scientific. Its failure mode is "it → Chapter 37 — Glossary (terms first-defined)
reproducible build
A build whose exact inputs — compiler name and version, every flag, the target architecture, and linked library versions — are recorded precisely enough that another person (or you, later) can reconstruct the same binary and reproduce the same results. The intrinsics `compiler_version()` and `compil → Chapter 30 — Glossary (terms first-defined here)
research software engineer (RSE)
a professional who combines genuine software-engineering expertise with enough research understanding to build and maintain the software that research depends on. A recognized and growing career track, with its own professional societies (the Society of Research Software Engineering, US-RSE) and, in → Chapter 40 — Glossary (terms first-defined here)
return value
f2py removes > it from the input arguments and hands it back as (part of) the function's result. > → Introduction to Fortran Programming
Richardson extrapolation
combining two approximations of different step size to cancel the leading error term: for a method of order $p$, $(2^p A(h/2) - A(h))/(2^p - 1)$ removes the $h^p$ term, yielding a higher-order estimate. Applied to the trapezoidal rule at halved steps it is Romberg integration. → Ch22
right
associative: `2**3**2` = `2**(3**2)` = `512` | | 2 | `*` `/` | left-associative | | 3 | unary `+` `-` | *below* `**` — so `-2**2` = `-(2**2)` = `-4` | | 4 | binary `+` `-` | | | 5 | `//` | character concatenation | | 6 | `== /= < <= > >=` | result is `logical` | | 7 | `.not.` | | | 8 | `.and.` | | | → Appendix A: Modern Fortran Syntax Reference
right-hand-side function (RHS)
the function $f(t, y)$ in $y' = f(t, y)$ giving the instantaneous rate of change of the state; the whole physics of the problem, passed to a solver as a procedure argument. → Chapter 23 glossary — terms first-defined
RK4 (classical fourth-order Runge-Kutta)
the four-stage method with weights $\frac16,\frac13,\frac13,\frac16$; global error $O(h^4)$; the default general-purpose ODE integrator. → Chapter 23 glossary — terms first-defined
RK4 coefficients
verified exact against the classical Butcher tableau (nodes 0, ½, ½, 1; weights ⅙, ⅓, ⅓, ⅙). High confidence. 2. **All hand-computed outputs** cross-checked with independent scalar/array arithmetic: - Euler y'=y h=0.25 → 1.25, 1.5625, 1.953125, 2.44140625 (exact dyadic); error 0.276876. Solid. - RK4 → Chapter 23 — continuity delta
roofline model
A performance model plotting a kernel's achievable rate against its arithmetic intensity under two ceilings — memory bandwidth and peak arithmetic rate — so a kernel runs at whichever ceiling it hits first. It tells you which optimizations can possibly help: reduce memory traffic under the memory ce → Ch29
round-off floor (in numerical differentiation)
the smallest useful step size for a finite-difference derivative: because the numerator subtracts near-equal values (catastrophic cancellation, Ch. 20), round-off error grows like $\varepsilon/h$ while truncation falls like $h^p$, so total error is U-shaped with an optimal step $h^* \sim \sqrt\varep → Ch22
Rules worth memorizing:
`type` is monomorphic and fast (compile-time, inlinable); `class` is polymorphic and dispatched (run-time, not inlinable). Default to `type`; opt into `class` only where you need run-time variation. - A polymorphic **array** has one dynamic type; to hold a mix, make an array of boxes each wrapping a → Introduction to Fortran Programming
Runge-Kutta method
a family of one-step integrators that evaluate the RHS at several intermediate stages within a step and combine those slopes with fixed weights; higher order than Euler for a few extra evaluations. → Chapter 23 glossary — terms first-defined
Runge–Kutta (RK4)
the workhorse. - **23.3** Adaptive step-size control. - **23.4** Systems of ODEs; the **method of lines** (bridge to PDEs). - **23.5** Stiffness and implicit methods (a preview). - **23.6** Applications: orbital motion, chemical kinetics, population dynamics. - **First-define:** initial-value proble → Introduction to Fortran Programming — Master Outline
runtime aliasing check
a few instructions at the top of the loop that test whether the arrays actually overlap — and generate *two* versions of the loop, a fast vectorized one taken when they do not overlap and a safe scalar one when they do. That recovers much of the speed, but at a cost Fortran never pays: the check its → Introduction to Fortran Programming

S

samples
while the program runs, a timer interrupts it a hundred or so times a second and records which procedure the program counter is in, building up a statistical picture of *where the time goes*. Call counts are exact; times are statistical, which is why a profiled run must be long enough to gather many → Introduction to Fortran Programming
scaled speedup
how much longer the same enlarged problem would take on a single processor — is > $$S(N) = s + (1 - s)\,N = N - s\,(N - 1).$$ > Unlike Amdahl's ceiling, this grows *linearly* with $N$, essentially without bound. There is no > horizontal asymptote; more cores keep buying more scaled speedup. → Introduction to Fortran Programming
scan
`scan(string, set[, back])`, the position of the first character of `string` that is a member of `set` (or 0 if none); with `back`, the last. Used to find a delimiter, a digit, any character from a set. → Ch12
scheduling
the policy by which a work-sharing loop assigns iterations to threads, set with `schedule(kind[,chunk])`. `static` divides the range into equal chunks once, before the loop, and is cheap and reproducible (best for uniform work); `dynamic` lets threads grab chunks at run time as they finish (self-bal → Ch33
Scientist Track
"my Python/MATLAB is too slow": Parts I–III, then V, VII, VIII. - 📖 **Standard** — full sequential reading for comprehensive mastery. - 🔧 **Legacy Track** — "I inherited FORTRAN 77": Part I, then Part IV, then Part IX. - ⚡ **HPC Track** — "I need parallel code for a cluster": Parts I–III, then strai → Introduction to Fortran Programming
scoping bug
a race, such as a shared loop temporary or writing into the field in place instead of a separate buffer — not a legitimately faster answer. (The stencil update is not a reduction, so unlike a floating-point sum it is *exactly* reproducible, with no last-bit variation.) → Ch33
second-order accurate in space
exactly what the five-point stencil's $O(h^2)$ truncation error predicts. That agreement is the verification. → Final Exam — Solutions
select case
a control construct that evaluates one discrete expression (`integer`, `character`, or `logical` — never `real`) and runs the single `case` block whose label matches; labels may be a value, a list, or a range (`case (60:69)`), with an optional `case default`. It has no fall-through, and its labels m → Ch04
selected_int_kind
the intrinsic function `selected_int_kind(r)` that returns an integer kind parameter able to represent every integer with up to `r` decimal digits (e.g. `selected_int_kind(18)` yields a 64-bit integer kind). → Ch03
selected_real_kind
the intrinsic function `selected_real_kind(p, r)` that returns a real kind parameter guaranteeing at least `p` decimal digits of precision and a decimal exponent range of at least `r`; it returns a negative value if no available kind can satisfy the request. Its integer cousin is `selected_int_kind( → Ch03
self-describing format
A file format that stores, alongside the data, enough metadata to interpret the data with no external information: each array's shape and rank, its numeric type and byte order (endianness), variable and dimension names, and arbitrary user attributes. A program that has never seen the writing code ca → Ch25
Send/recv deadlock
both ranks send first; cure with `mpi_sendrecv`. - **Datatype mismatch** (e.g. `MPI_INTEGER` for `real(dp)`) — no error, wrong bytes. - **Skipping a collective on some ranks** — the collective hangs; *all* must call it. - **Exchanging halos after the update** — edge rows read stale ghosts; exchange → Chapter 34 — Key Takeaways (MPI)
sequential access
the default file access mode, in which records are read and written in order, front to back. → Ch07
serial fraction
Amdahl-limited; attack the sequential code or switch to weak scaling. - A **rising** Karp–Flatt fraction means **overhead** that grows with cores (usually communication) — attack the parallel structure, and stop adding cores past the point where speedup turns around. - A speedup number without its c → Case Study 1: Reading a Scaling Study
Shallow
b aliases a's data | | Out of scope | **Auto-deallocated** (no leak) | Leaks unless you `deallocate` | | Aliasing | Cannot alias → optimizes better | Can alias → optimizer constrained | | Use it for | Almost all scientific data | Sharing, linked structures, C interop | → Chapter 9 — Key Takeaways (Derived Types)
shape
the list of all of an array's extents, one per dimension, given as a rank-1 integer array (e.g. an `a(3,4)` array has shape `[3, 4]`). → Ch05
Shape first
read the comments and routine names; get the job description before any logic. 2. **Shared state** — find the `COMMON` blocks; that is the data model. 3. **Loops and exits** — locate `DO`/`GO TO` loops and the `IF (…) GO TO` that leaves them. 4. **The kernel** — find the few lines that do the math ( → Chapter 17 — Key Takeaways (Reading FORTRAN 77)
shared memory
a parallel model in which several threads read and write the same single address space; coordination happens implicitly through common variables rather than explicit messages. The model of the multiple cores within one node. Fortran tools: OpenMP, coarrays. → Ch31
significand
(also mantissa) the part of a floating-point number carrying its significant digits, the $1.f$ in $\pm 1.f \times 2^{e}$. Its width sets precision: double's 53-bit significand gives about 16 decimal digits. The leading `1` of a normalized number is implicit ("hidden bit"), so 52 stored fraction bits → Ch20
Significant?
A **speedup with no stated baseline and build configuration is meaningless.** - Name your method's limit (here: explicit $\Delta t \sim h^2$; want implicit/`dgesv` for stiff fine grids) — it *strengthens* the paper. → Chapter 38 — Key Takeaways (Capstone: From Physics to Publication)
SIMD
*Single Instruction, Multiple Data*: the class of CPU instructions that apply one operation to several data elements simultaneously (packed into a vector register). The hardware mechanism that vectorization targets; "32 byte vectors" = four `real(dp)` per instruction (AVX). Deeper treatment in Ch. 2 → Ch27
SIMD (Single Instruction, Multiple Data)
A hardware capability in which one machine instruction applies the same operation to a whole small vector of operands packed into a wide register (a 256-bit AVX register holds four `real(dp)` values; 512-bit AVX-512 holds eight), so one SIMD add handles several element-adds at once. → Ch29
SIMD vectorization
how to structure code so the compiler auto-vectorizes; `do concurrent`. - **29.4** `contiguous` pointers; aliasing hints; when hand-tuning beats the compiler (rarely). - **29.5** When to stop (readability, diminishing returns) — and why a tuned BLAS still beats you (callback to Ch.21). - **First-def → Introduction to Fortran Programming — Master Outline
Simpson's rule
quadrature that fits parabolas through pairs of panels: $S_n = \tfrac{h}{3}[f_0 + 4f_1 + 2f_2 + \cdots + 4f_{n-1} + f_n]$ ($n$ even). Error $-\tfrac{(b-a)h^4}{180}f^{(4)}$, so $O(h^4)$; exact for cubics. → Ch22
single precision
and `0.1` is rounded to ~7 digits. Second: that single-precision value is then widened to double for the assignment, which pads it with binary zeros but **cannot recover** the digits lost in the single rounding. So `x` holds the coarse single-precision `0.1`, worse than `0.1_dp`. Correct: `real(dp) → Ch20
Skills applied
Reading the anatomy of a `real(dp)` and its ULP to predict absorption (§20.1, §20.2). - Diagnosing catastrophic cancellation and non-associativity in a summation (§20.3). - Using `spacing` to reason quantitatively about which contributions are lost (§20.2). - Recognizing that floating-point behaviou → Case Study 1: The Energy Diagnostic That Depended on Loop Order
Skills applied:
Reading an RHS and reducing a model to the first-order system form (§23.1, §23.4). - Writing a vector RHS as a Fortran `rhs_sys` function with an assumed-shape argument (§23.4, Chapter 6). - Integrating a system with `rk4_sys` — one integrator, any RHS (§23.4). - Population-dynamics reasoning: equil → Case Study 23.1: Porting a Predator-Prey Model from Python to Fortran
slow
commonly 10–30× slower than a native run (a > Tier-2 order of magnitude, not a promise), because it instruments every memory access. Run it on a *small* > test case, not your production grid. For the specific case of stack and global buffer overflows, and for > much faster instrumented runs, gfortra → Introduction to Fortran Programming
slow and bulky
turning a `real(dp)` into decimal text takes real work, and the text is often larger than the eight bytes the number actually occupies. For a handful of values, who cares. For a billion-cell field written every timestep, it is the difference between a simulation that finishes and one that spends its → Introduction to Fortran Programming
slowest-varying
the *last* index in the Fortran dimension list (which `ncdump` prints *first*, as `temperature(time, y, x)`) — because NetCDF grows the file by appending whole records along the outermost dimension; in Fortran's column-major layout the outermost/slowest index is the last one. → Ch25
small, correct, and tested
maintainers value low-risk changes; big core changes from newcomers are hard to review and land (CS-01, §40.5). | | 23 | b | A *labeled measurement on stated hardware, validated* — the only honest form; (a)/(c) are unsupportable universals, (d) is over-cautious (§40.4). | | 24 | 100.00 | The lone in → Chapter 40 Quiz: The Fortran Career
solver module
a module that owns the numerical engine: the algorithm that advances or converges the solution (the time-stepping loop's machinery, the iteration scheme, the update rule). It knows *how to advance* a field, not where the field came from or where results go. In the project, `heat_solver`. → Ch36
source tree
the directory hierarchy of a project's files, deliberately arranged in a well-organized code to mirror the module map (utilities at the bottom, driver at the top). → Ch36
sparse format
a storage scheme that records only a matrix's nonzero entries plus index information, giving $O(n)$ memory for an $n$×$n$ matrix with $O(n)$ nonzeros instead of $O(n^2)$. Common formats: **COO** (coordinate — parallel arrays of row index, column index, value), **CSR** (compressed sparse row — values → Ch21
specific institutions
the national laboratories, the weather and climate services, the aerospace and energy companies, the university research groups — where Fortran is a working tool and not a museum exhibit, and say what each of them actually builds. - Tell apart the **career roles** that Fortran fluency opens — comput → Introduction to Fortran Programming
speedup
the one-processor time divided by the > $N$-processor time — is > $$S(N) = \frac{1}{(1 - p) + \dfrac{p}{N}}.$$ > As $N \to \infty$, the parallel term $p/N$ vanishes and the speedup hits a hard ceiling: > $$S_{\max} = \frac{1}{1 - p}.$$ → Introduction to Fortran Programming
SPMD (Single Program, Multiple Data)
the model in which one program text is run by many processes at once, each specialising its behaviour by its rank (the `if (rank == 0)` branch is its signature). Almost all MPI programs are SPMD. → Ch34
stability
limited steps. - Explicit Euler on $y' = \lambda y$ is stable only if $|1 + h\lambda| \le 1$ ⇒ $h \le 2/|\lambda|$ (real $\lambda < 0$). RK4 buys only ~40% (limit $\approx 2.8/|\lambda|$). - **Backward Euler:** $y_{n+1} = y_n/(1 - h\lambda)$ — **A-stable**, decays for *any* $h > 0$. Cost: a solve ea → Chapter 23 — Key Takeaways (Ordinary Differential Equations)
stability (numerical)
The property that errors already present in the solution (round-off, initial data) stay bounded as the scheme marches, rather than growing without limit. An unstable scheme amplifies errors geometrically until they overflow. → Ch24
Stability: the CFL condition
why your timestep can't be too big. - **24.5** Boundary conditions: Dirichlet, Neumann, periodic. - **24.6** Structured grids and output for visualization (detailed in Ch.26). - **First-define:** PDE, five-point stencil, explicit/implicit scheme, CFL condition, Dirichlet/Neumann/periodic BCs. - **Pr → Introduction to Fortran Programming — Master Outline
Standard-status claims (§19.5 "Status" column)
obsolescent vs removed for statement functions, COMMON/EQUIVALENCE/BLOCK DATA, arithmetic IF, computed GOTO, assigned GOTO/PAUSE/Hollerith. Stated with an explicit "verify against ISO/IEC 1539-1" caveat in-text; teaching is status-independent. Verify clauses. 2. **gfortran on a statement function un → Chapter 19 — continuity delta
stat / errmsg (allocation)
optional specifiers on `allocate` and `deallocate` that turn a fatal memory error into a reportable value — the allocation counterpart of `iostat`/`iomsg`. `stat=s` sets the integer `s` to zero on success and a nonzero, processor-dependent value on failure (out of memory, an already-allocated or alr → Ch13
statement function
a single-statement function definition written among a routine's declarations, of the form `name(args) = expression`. Local to the routine that defines it, expanded like a formula wherever called; the lightweight ancestor of the modern internal procedure, now obsolescent. → Ch17
stdlib
the Fortran standard library: a community-developed package of general-purpose routines the language's intrinsics do not cover (statistics, sorting, strings, text-table I/O, math helpers), organized into modules such as `stdlib_stats` and `stdlib_io`. It is not part of the ISO Fortran standard — it → Ch16
stdlib dependency spec
the exact `git`/`branch`/`tag` line stdlib wants for fpm has historically changed between releases (fypp/`stdlib-fpm` history). I used the plain `{ git = "…" }` form and a *sample* pinned tag `v0.7.0`, and EXPLICITLY told the reader to confirm the current form from stdlib's README (both in prose and → Chapter 16 — continuity delta
step doubling (Richardson error estimate)
estimating local error by comparing a step of size $h$ with two steps of size $h/2$: error $\approx (y_{\text{half}} - y_{\text{full}})/(2^p - 1)$. → Chapter 23 glossary — terms first-defined
step size ($h$)
the time increment $t_{n+1} - t_n$ taken by an integrator; smaller $h$ means more steps and (for a convergent method) less error. → Chapter 23 glossary — terms first-defined
stiffness
the property of an ODE system with widely separated time scales that forces an explicit integrator into tiny steps limited by stability rather than accuracy. → Chapter 23 glossary — terms first-defined
stop
but *how* it stops carries information that the world outside the program reads. A program is not an island; it is a process launched by a shell, a Makefile, a batch scheduler, or a continuous-integration runner, and when it ends it hands that launcher a single small integer: its **exit code**. By u → Introduction to Fortran Programming
stream I/O
unformatted I/O with `access='stream'` (Fortran 2003): a pure byte stream with no record markers, addressable to the byte with `pos=`, used to interoperate with C, Python, and other non-Fortran readers. → Ch07
Strong scaling
the total problem ($4096 \times 4096$) is fixed while cores increase; you are asking Amdahl's question and hoping the time falls. (b) **Weak scaling** — the work *per core* (a $512 \times 512$ tile) is fixed while the total grid and the core count grow together; you are asking Gustafson's question a → Ch31
structure constructor
an expression that builds a value of a derived type by using the type's name as a function: `point2d(3.0_dp, 4.0_dp)` (positional) or `point2d(x=3.0_dp, y=4.0_dp)` (keyword). May be overloaded with a user-defined function via an `interface` named like the type. → Ch09
Structure-of-Arrays
one type holding six component arrays: → Ch09
Structure-of-Arrays (SoA)
where all the masses sit in one contiguous `mass(:)` array, 8 bytes apart. → Case Study 1: From Six Arrays to One Type
structured grid
A mesh whose points form a regular array, so a point's neighbours are found by index arithmetic ($(i\pm1,j)$, $(i,j\pm1)$) with no stored connectivity. Maps directly onto a Fortran array; contrasts with an unstructured grid (arbitrary cells with explicit connectivity). → Ch24
structured grid output
writing field values on a *logically rectangular* grid, where each point has an implied index `(i, j, k)` and neighbors are found by adding or subtracting one from an index, so the grid's connectivity is implicit and need not be stored. For a *uniform* structured grid (like the heat plate) even the → Ch26
submodule
a program unit (`submodule (parent) name`) that supplies the bodies of *separate module procedures* whose interfaces are declared in its parent module (or an ancestor submodule). It is never `use`d directly; it exists to separate implementation from interface, avoiding recompilation cascades and cir → Ch08
subnormal
(denormal) a number in the gap between `tiny` and zero, represented by giving up the hidden leading `1` so leading significand bits may be zero; keeps underflow gradual, down to about $4.9\times10^{-324}$ for double, at some speed cost. → Ch20
subroutine
a procedure invoked with the `call` statement that performs an action and returns results through its arguments; it may return zero, one, or many values. → Ch06
substring
a contiguous piece of a string selected by a 1-based, inclusive position range: `s(i:j)` is characters `i` through `j`, a string of length `j - i + 1`. Omitting a bound means "to the end" (`s(i:)`) or "from the start" (`s(:j)`); if `i > j` the substring is zero-length. A substring of a variable is i → Ch12
sums across cores
so a region that took 1 second on 8 threads might report ~8 CPU-seconds, badly overstating the wall time. For speedup and scaling numbers you want wall time. → Quiz Bank
sync all
an image-control statement that acts as a barrier across every image: an image reaching `sync all` waits until all images have reached their own, establishing a shared ordering point so that anything written before it (on any image) is safe to read after it (on any image). It is the simplest and mos → Ch32

T

target
the `target` attribute, given to an object so that a pointer may point at it. An object with neither `target` nor `pointer` may not be a pointer's target, which lets the compiler assume nothing aliases it and optimize accordingly. → Ch11
task parallelism
performing different operations concurrently (e.g., reading the next file while computing on the current one); limited by the number of genuinely independent tasks, so it scales less far than data parallelism. → Ch31
team
a named subset of images that, inside a `change team` block, behaves as a self-contained set of images: `this_image()` and `num_images()` report rank and count *within the team*, and coindexing refers to team members. Teams (Fortran 2018) let disjoint groups of images run different parallel computat → Ch32
temporal blocking
fusing several *time steps* over a spatial tile so the field is reused across steps before leaving cache — but that is a substantially more complex, correctness-fraught transformation (the tiles must overlap to carry the halo forward), and it belongs to the specialist codes, not to a first optimizat → Introduction to Fortran Programming
term
definition`) and its index entries to `_scratch/index/chNN.md` (`- term — 3.1, 3.4`). → Continuity & Cross-Reference Ledger — Introduction to Fortran Programming
Test against oracles, not "the right answer"
exact special cases, invariants, symmetry, convergence order — and compare within a **tolerance**, never `==`. 2. **A scientific result you cannot reproduce is not a result.** The deliverable is the number *plus* everything needed to regenerate it: tested code, recorded build, inputs, and seeds. → Chapter 37 — Key Takeaways (Testing, Documentation, and Software Engineering)
The $1/h^2$ is not optional
it turns a neighbour comparison into a real second derivative. - **Second-order accurate:** error $O(h^2)$; halving $h$ quarters the error. Exact for quadratics. - General $\Delta x \neq \Delta y$: $\dfrac{u_{i+1,j}-2u_{i,j}+u_{i-1,j}}{\Delta x^2} + \dfrac{u_{i,j+1}-2u_{i,j}+u_{i,j-1}}{\Delta y^2}$. → Chapter 24 — Key Takeaways (PDEs and Finite Differences)
the 80/20 rule
The Pareto principle applied to performance: the large majority of a program's runtime is spent in a small minority of its code (often ~80% in ~20%, and frequently far more extreme in numerical software). The practical consequence: profile to find that small hot fraction and optimize only it. The wh → Ch28
the boundary is a layout question
match the dtype and create your arrays `order='F'`, and data crosses for free; forget it and you either copy on every call or (for `intent(inout)`) get an error. Second, **you write the hot ten percent in Fortran and the other ninety in Python**, and the payoff — the 10-to-100× on the loop that domi → Introduction to Fortran Programming
The cache-miss measurement
§28.4. A high last-level-cache miss rate is the direct fingerprint of a memory-bound loop. → Introduction to Fortran Programming
the checksum is identical across both builds
you bought speed, not a different answer, exactly as §30.1 promised (had you used `-Ofast`, you would now check whether it still read `600.00`). Second, **the number in the "Elapsed" column is worthless without the "Flags" column beside it.** Write them together, always. That coupling — result, flag → Introduction to Fortran Programming
the core
`dgesv`, the naming scheme, `lda`, `ipiv`, `info`, the worked solve + residual, the overwrite warning, the silent-argument hazard (§21.3). This is the chapter; give it the most time. - 12 min: `dsyev` + the workspace query; reading `dgesvd`'s page (§21.4). - 8 min: linking, OpenBLAS/MKL, the link-er → Chapter 21 — Teaching Notes
the datatype must match the buffer's actual type
`MPI_DOUBLE_PRECISION` for `real(dp)`, `MPI_INTEGER` for `integer`, `MPI_REAL` for default `real`. → Ch34
The design changed; the science did not
which is exactly the invariant Chapter 18's regression tests are meant to protect. → Case Study 2: From a Translated Kernel to a Designed Library
The Fortran standard
ISO/IEC 1539-1 (the 2018 and 2023 editions). The committees are **J3** (US) and **WG5** (international). *Tier 2 for exact document numbers — confirm the current edition.* - **fpm** (Fortran Package Manager), **FORD** (documentation), **pFUnit** and **test-drive** (unit testing), **fortls** (languag → Appendix J: A Fortran Timeline and Resource Guide
The heat-equation solver
the progressive project (see §4). Introduced conceptually in Ch.1, scaffolded from Ch.2 on, and climaxed in the **Ch.38 capstone**. This is the spine of the book. - **LAPACK called from Fortran** — "the foundational libraries of numerical computing are written in Fortran, and calling them is easy." → Style & Continuity Bible — Introduction to Fortran Programming
the no-aliasing advantage
the optimization freedom a Fortran compiler gains from the standard's prohibition on argument aliasing: if a dummy argument is defined (written) within a procedure, the program may not have it associated with — aliased to — any other dummy argument or accessible entity the procedure also references. → Ch27
The ratio near 4 is the meaningful result
it certifies second-order accuracy independent of the constant. → Ch24
The shared-accumulator race
write to one shared scalar in a parallel loop ⇒ wrong, nondeterministic. Use `reduction`. - **Unscoped inner index / temporary** — the inner `j` and any `rowsum`-style scratch must be `private`. `default(none)` catches it at compile time. - **Work-sharing with no team** — `!$omp do` outside a parall → Chapter 33 — Key Takeaways (OpenMP)
The shift pattern is deadlock-free
traced a 3-rank chain by hand: rank 0's up-exchange is a `MPI_PROC_NULL` no-op, which unwinds the dependency chain so no rank waits forever. `mpi_sendrecv` is guaranteed non-deadlocking for this pattern regardless. Confident. 4. **Hand-computed heat values** — the 5×6-plate evolution (steps 1–3) was → Chapter 34 — continuity delta
the standards process (J3 / WG5)
the committee process by which Fortran evolves. **WG5** (formally ISO/IEC JTC1/SC22/WG5) is the international working group that sets each revision's direction, scope, and schedule; **J3** is the US Fortran committee (an INCITS committee, historically ANSI X3J3) that does the detailed technical draf → Ch39
The TOP500 project (`top500.org`)
the ranking of the world's fastest supercomputers, with honest statistics on what runs there. - **FortranCon** and national-laboratory HPC talks — video archives; good for hearing working scientists explain their language choices. → Appendix J: A Fortran Timeline and Resource Guide
This checkpoint is optional and advanced
it needs a GPU and `nvfortran`, which most readers building the solver on a laptop will not have — but it is the natural climax of the data-region idea, and it completes the running project's tour across every parallel model. We offload the heat solver's stencil update to the GPU with OpenACC. The r → Introduction to Fortran Programming
This is an introduction
the discipline > of *writing* code the compiler will actually vectorize (alignment, loop structure, cache blocking, > `do concurrent`) is the subject of [Chapter 29](../chapter-29-optimization-techniques/index.md). Here we > establish what vectorization is and the two things Fortran does to make it → Introduction to Fortran Programming
Tier 2
an illustrative order of magnitude, not a fixed figure), so ship a tuned BLAS in production. → Appendix H: Libraries and Tools Reference
Time budget (~4 h of student work).
§30.1 (the ladder + `-Ofast` + `-march=native` + `-flto`): 90 min — the heart, do not rush. - §30.2 (other compilers): 30 min — a reading/translation section. - §30.3 (two builds): 30 min. - §30.4 (PGO + reproducibility): 45 min. - §30.5 (portability): 20 min. - Project Checkpoint + one case study: → Chapter 30 — Instructor Notes
Time budget (≈ 5 h, matching the estimate):
§28.1 timers + wall/CPU + the idiom drill — 60 min (do the live before/after here) - §28.2 gprof workflow + reading flat profile & call graph — 60 min - §28.3 hot loop + memory/compute-bound + arithmetic intensity — 60 min (the conceptual heart) - §28.4 cachegrind demo — 45 min - §28.5 methodology + → Chapter 28 — Instructor Notes
Time budget (≈ 6 h, matching the estimate):
§24.1 equations + method-of-lines link — 45 min - §24.2 stencil + example-01 hand check — 60 min - §24.3 FTCS + example-02 — 45 min - §24.4 CFL/stability + the blow-up demo — 90 min (the heart; do not rush) - §24.5 boundary conditions — 45 min - §24.6 + Project Checkpoint (assemble the real solver) → Chapter 24 — Instructor Notes
Time budget (≈5 hours):
§23.1 Euler + IVP: 45 min (get the procedure-argument pattern down here). - §23.2 RK4: 60 min (the core; do the hand trace and the order test). - §23.3 adaptive: 30 min (concept + the controller formula; don't over-invest). - §23.4 systems + method of lines: 75 min (the pivot; spend time here). - §2 → Chapter 23 — Instructor Notes: Ordinary Differential Equations
time slider and a play button
you can scrub directly to any saved frame and animate the run. The trade is many small files instead of one big one, which is exactly what the padded naming and (for tidiness) an `output/` subfolder manage. → Ch26
time-series output
a sequence of files, one per saved timestep, that a viewer loads together and plays as an animation. Each file is an ordinary field snapshot; what makes the set a movie is (a) a shared base name with a zero-padded, increasing index (`heat_000000.vtk`, `heat_000100.vtk`, …) so the viewer detects and → Ch26
tokenizer
a routine that splits a string into its meaningful units (tokens) separated by delimiters, treating a run of delimiters as a single separator. Built here from `verify` (find where a token starts) and `scan` (find where it ends). → Ch12
tokens
> the meaningful units (words, numbers, symbols) — separated by **delimiters** (here, blanks). A good > tokenizer treats a *run* of delimiters as a single separator, so extra spaces between tokens do not > produce empty tokens. → Introduction to Fortran Programming
tolerance
An allowed difference within which two floating-point results are treated as equal: `abs(a-b) <= tol` (absolute) or `abs(a-b) <= tol*abs(b)` (relative); the robust default for numerical comparisons, because arithmetic rounds. → Chapter 37 — Glossary (terms first-defined)
TOP500
the semiannual ranking of the world's fastest supercomputers by a standard benchmark; a common reference point for the state of HPC hardware. → Ch01
Total heat is conserved
there are no absorbing boundaries — so it relaxes to uniform, unlike Dirichlet ends which drain heat out. → Ch24
translation dictionary
a categorized lookup mapping each FORTRAN 77 construct to its faithful modern-Fortran equivalent, so a legacy pattern can be replaced without re-deriving the modernization from first principles; the organizing device of this chapter and of Appendix E. → Ch19
trapezoidal rule
quadrature that joins samples with straight lines: $T_n = h[\tfrac12 f_0 + f_1 + \cdots + f_{n-1} + \tfrac12 f_n]$. Error $-\tfrac{(b-a)h^2}{12}f''$, so $O(h^2)$; exact for linear integrands. The correct tool for sampled data (nodes fixed). → Ch22
Trigonometric functions use radians.
**Kind numbers** (returned by `kind`, `selected_real_kind`, `selected_int_kind`) are *processor-dependent*; the values shown are what gfortran reports. Logicals print as `T`/`F` but their values are `.true.`/`.false.`. → Appendix B: Intrinsic Procedures Reference
trim
the intrinsic returning a copy of a string with its **trailing** blanks removed (leading blanks kept); its length is `len_trim`. `trim(adjustl(s))` removes blanks from both ends. → Ch12
truncation error
the error a finite-difference or quadrature formula incurs by truncating the Taylor series — dropping the higher-order terms. Its leading power of $h$ is the method's order of accuracy. It is distinct from round-off error and would persist even on a machine with infinite precision. → Ch22
twice
one copy in at `!$acc data`, one out at `!$acc end data`. → Ch35
two-language workflow
a program structured so a high-level interactive language (in scientific computing, almost always Python) handles everything except the numerical hot spot — input, orchestration, decisions, plotting, output — while a compiled language (Fortran or C) handles the small arithmetic-heavy kernel where ne → Ch15
type extension
defining a new derived type that inherits all the components and type-bound procedures of an existing type (the parent), then adds its own and/or overrides inherited procedures; written with the `extends` attribute, `type, extends(parent_t) :: child_t`. The child *is a* parent. → Ch10
type-bound procedure
a procedure attached to a derived type inside the type definition (`procedure :: m => proc`) and invoked through an object with the percent operator (`object%m(args)`); by default the object is passed automatically to the procedure as its first argument (the passed-object dummy). Fortran's spelling → Ch09
type-bound procedures
so an object carries its own behaviour, and get the one non-negotiable detail (the `class(...)` passed object) exactly right. - Understand **parameterized derived types**, which let a type carry compile-time kind and run-time length parameters — and judge honestly when your compiler is ready for the → Introduction to Fortran Programming

U

ULP (unit in the last place)
the value of a one-bit change in the significand at a number's magnitude; returned by `spacing(x)`. One ULP is a constant fraction (about $\varepsilon_{\text{mach}}$) of the number but a growing absolute amount as the number grows. → Ch20
unconditionally stable
they place *no* limit on $\Delta t$ — so they > win decisively when the explicit stability limit would force absurdly tiny steps. → Introduction to Fortran Programming
undefined
a race. Synchronization *orders* segments, turning "who knows what happened first" into "this provably happened before that." You place a synchronization precisely at the boundary where one image's writes must be visible to another's reads. → Introduction to Fortran Programming
undefined (pointer status)
the status of a pointer that has never been initialized or nullified; querying it with `associated` is undefined behavior. Prevented by initializing every pointer `=> null()` at declaration. → Ch11
underflow
when a nonzero result is smaller in magnitude than the smallest normal number (`tiny`); it is represented as a subnormal with reduced precision, and flushes to zero if smaller still. → Ch20
unformatted I/O
I/O that transfers a value's exact internal bytes with no character conversion, selected by `form='unformatted'`; you `write(u) x` and `read(u) x` with no format. Exact and fast; a traditional unformatted-sequential file wraps each record in length markers. → Ch07
unit
checks one procedure (`laplacian`) on a special input. (b) **regression** — compares the whole output to a stored result from a previous release (guards against change). (c) **verification** — compares the whole solver to a known-*true* analytical answer (the steady state). (d) **unit** — checks one → Ch37
unit roundoff
written $u$, the maximum relative error introduced by rounding a real to the nearest representable value; under round-to-nearest, $u = \varepsilon_{\text{mach}}/2 = 2^{-53}$ for double. Every basic floating-point operation has relative error at most $u$. → Ch20
unit stride
the compiler skips a contiguity check / copy-in-out and may vectorize. Most valuable on **pointers** (which may point at strided slices). - Fortran assumes procedure arguments **do not alias** (the Ch. 27 advantage) — that is *why* the stencil vectorizes. **Pointers/targets can alias** and forfeit i → Chapter 29 — Key Takeaways (Optimization Techniques)
unit test
A small, automated check that exercises one unit of code (a single procedure or a few) in isolation, with known inputs, and verifies the expected output; fast, independent, and specific enough to localize a failure. → Chapter 37 — Glossary (terms first-defined)
unreachable and unfreed
a classic leak. Push a million candidates over a long run, pop them all, and you have leaked a million nodes: the slow memory growth the production run exhibited. → Case Study 1: The Leaking Stack
Update from a snapshot
evaluate the Laplacian on $u^n$ *before* writing, or use two buffers. In-place overwrite silently becomes Gauss–Seidel. → Chapter 24 — Key Takeaways (PDEs and Finite Differences)
use
the statement that gives the current program unit access to a module's public entities. `use m` imports all of them; `use m, only: a, b` imports only the named ones (the preferred, self-documenting form); `use m, only: x => a` imports `a` under the new name `x`. → Ch08
Use list-directed for yourself
debugging, quick dumps, reading a few values you typed. **Use a format for anyone (or anything) else**, where the exact column and precision matter. → Appendix F: I/O and Format Reference
utility module
a module providing foundational, general-purpose support used throughout a code and specific to no single part of the science (precision kinds, physical constants, timers, logging, string helpers). Utility modules sit at the bottom of the dependency graph. In the project, `kinds`, `constants`, and ` → Ch36

V

validated
its predictions have matched physical measurements for two decades, and its error characteristics are documented and trusted by the group and its regulators. - It is **slow** — a full run takes 30 hours, and the group wants same-day turnaround. - It is **unmaintainable** — fixed-form source, `COMMON → Case Study 2: Rewrite or Refactor?
validates
a complete 2D steady-state heat solver on top of your project's `field_t`, `step`, and `stable_dt`. A solver that produces a plausible-looking heat map is not the same as a solver that is *correct*, and the difference is a validation you can defend. You will add a `run_to_steady` driver that marches → Case Study 2: Building a Validated Steady-State Heat Solver
validates the precondition
`if (n < 1) then ok = .false.; return` — before touching memory, and (b) → Ch36
validation
the process of confirming that the mathematical model itself adequately represents physical reality — "solving the right equations." Validation is about the *model*: it is established by comparing simulation results against experiment or observation. A code can be perfectly verified (it solves its e → Ch38
value attribute
a dummy-argument attribute (`real(c_double), value :: x`) declaring that the argument is passed by value: the procedure receives a private copy, and changes to it are not seen by the caller. It is how a Fortran interface matches C's default by-value passing of scalars; it requires an explicit interf → Ch14
value copy
`b` gets its own independent components. Assigning `b%h = 10.0_dp` therefore changes `b` alone. So `a`'s volume is `2·3·4 = 24.0`, `b`'s is `2·10·4 = 80.0`, and crucially `a%h` is **still `3.0`**, not `10.0`. This is the value-semantics point: derived-type assignment copies the whole object. → Midterm Exam — Solutions
Variables and types
that a program stores values, and that `3` (an integer) and `3.0` (a real number) are different kinds of thing. - **Control flow** — `if`/`else` decisions, and loops that repeat work. - **Functions** — packaging a computation so you can call it with different inputs. - **Arrays / lists** — an ordere → Prerequisites
vectorization
the optimization that transforms a loop performing one operation per iteration into a loop performing that operation on several array elements at once, using the CPU's SIMD instructions (one instruction adding, e.g., four or eight pairs of doubles). The speedup is bounded by the vector width. Enable → Ch27
verification
proving the code is correct (the convergence study); (2) **performance analysis** — measuring how it scales, honestly, with a stated baseline; (3) **presentation** — writing it up so someone else can understand and reproduce it. A reviewer reads (1), verification, first: a result whose correctness i → Ch38
verification and validation (V&V)
the paired discipline of establishing both that a code solves its equations correctly (verification) and that those equations describe reality (validation). In computational science a result reported without V&V is not yet trustworthy; the convergence study against an analytical solution is the cano → Ch38
verify
`verify(string, set[, back])`, the position of the first character of `string` that is **not** in `set` (or 0 if every character is in `set`); with `back`, the last. `verify(s, set) == 0` is the idiom for "every character of `s` is drawn from `set`" (e.g., all digits). → Ch12
Verify each against the compiler you actually have
the > *table's structure* (debug / release / FP-contract, one column per compiler) is the durable design; the > cells are details to confirm. This is flagged as version-dependent. → Case Study 30.2: A Reproducible, Portable Release Build for the Solver
Verify the order numerically.
Advancing `t` *before* using it in a non-autonomous $f(t, y)$ → wrong trajectory. - Using explicit RK4 on a **stiff** problem → tiny steps or `NaN`; switch to implicit. - Default `real` over a long integration → round-off swamps the answer; use `real(dp)` (Chapter 20). - Reading `dt` too large for t → Chapter 23 — Key Takeaways (Ordinary Differential Equations)
Visit fortran-lang.org and the Discourse
join the community whose language you now speak. 3. **Pick one open code and read its `CONTRIBUTING.md`** — line up a small first contribution (Case Study 40.1). 4. **Explore the RSE societies** if the software end of the spectrum appeals — the role may be the best fit for what this book taught you. → Chapter 40 — Further Reading
von Neumann stability analysis
feeding a general wave $e^{\mathrm i(k_x x + k_y y)}$ through the scheme instead of just the checkerboard — gives the amplification factor $G = 1 - 4r[\sin^2(k_x h/2) + \sin^2(k_y h/2)]$, and the checkerboard ($k_x h = k_y h = \pi$, both sines $=1$) is exactly the worst mode, confirming $r \le 1/4$. → Introduction to Fortran Programming
VTI
VTK's XML *ImageData* format (`.vti`), the XML-era equivalent of the legacy `STRUCTURED_POINTS` dataset. Stores the same uniform grid (as `WholeExtent` of 0-based inclusive point indices, plus `Origin` and `Spacing`) and point data, but as well-formed XML that can carry compressed or binary payloads → Ch26
VTK
the *Visualization Toolkit*, an open-source C++ visualization library, and (the sense used here) the family of file formats it defines for storing a dataset — a grid plus the field values on it — for viewers such as ParaView and VisIt. Two generations: the **legacy** format (a plain, human-readable → Ch26

W

wall-clock time
Elapsed real time, as a stopwatch on the wall would measure it: how long you actually waited. Measured with `system_clock`. Contrast with CPU time. → Ch28
warm-up
One or more untimed executions of the code run before timing begins, to pull data into cache, fault in memory pages, and bring the CPU to its steady operating frequency, so that the timed runs measure steady-state performance rather than start-up transients. → Ch28
waste less memory bandwidth
to make sure every cache line you pay to fetch is used to the last byte before it is thrown away. And whether that happens is decided entirely by the order in which your loops walk the array. → Introduction to Fortran Programming
weak scaling
a scaling experiment (and regime) in which the problem size per processor is held fixed and the total problem grows with the processor count; run time is expected to stay roughly constant, governed by Gustafson's Law. Easier to achieve than strong scaling. → Ch31
where
a construct performing a masked whole-array assignment: `where (mask) …` applies its array assignments only where the logical array `mask` is true, with an optional `elsewhere` (masked or not) for the remaining positions. The mask and arrays must be conformable. → Ch04
Where OOP helps.
**Abstraction and interchangeability.** When you have a family of things that answer the same question differently — several time integrators, several equations of state, several boundary conditions, several linear solvers — an abstract type with a `deferred` binding lets the rest of your code talk → Introduction to Fortran Programming
Where OOP hurts.
**Dynamic dispatch is not free.** A call through a `class` variable cannot, in general, be resolved at compile time — the compiler emits an indirect call through a table, chosen at run time from the object's dynamic type. That indirect call cannot be *inlined*, which is often the more expensive loss → Introduction to Fortran Programming
Who manages the machine
OpenACC lets the compiler choose the thread/block mapping and (with data clauses) the transfers; in CUDA Fortran you choose the launch configuration, declare `device` arrays, and compute indices yourself. For new code, reach for **OpenACC first**: less code, portable, and usually fast enough. Drop t → Ch35
whole-array
no inner loops, and the compiler vectorizes it. → Chapter 23 — Key Takeaways (Ordinary Differential Equations)
whole-array operation
an operation written on entire arrays rather than individual elements; for conformable arrays `a + b`, `a * b` (elementwise), scalar broadcasts, and elemental intrinsics like `sqrt(x)` all act element by element with no explicit loop. → Ch05
with type checking and explicit interfaces
replacing the untyped, position-dependent memory overlay that `COMMON` gave you (where a mismatch in the variable list between two routines silently reinterpreted the bytes). Modules are the single biggest safety upgrade in migrating F77. → Quiz Bank
without recompiling
the "aha" of configuration-not-recompilation lands hard. → Chapter 7 — Teaching Notes
work sharing
dividing the execution of a code block among the threads of an existing team so the work is done once collectively rather than once per thread. Fortran's work-sharing constructs are `!$omp do` (partition a loop's iterations), `!$omp sections` (different blocks to different threads), `!$omp single` ( → Ch33
workspace query
the LAPACK idiom for sizing a routine's scratch array: call the routine once with `lwork = -1`, whereupon it performs no computation but writes the optimal workspace size into `work(1)`; the caller reads that value, allocates a work array of that size, and calls again for the real computation. Used → Ch21
write your prediction down before you compile
the discipline of hand-tracing is the skill. → Chapter 23 Exercises: Ordinary Differential Equations
write → `sync all` → read.
Halo cost is a *surface*, compute is a *volume*: the ratio $\sim 2P/N$ shrinks as the grid grows → good weak scaling. - Coarrays are the only **standardized, in-language** parallel model among mainstream languages (Fortran 2008; collectives and teams in 2018). → Chapter 32 — Key Takeaways (Coarrays)
wrong loop nesting for column-major storage
the inner loop strides through memory. Fix: ```fortran do j = 2, n-1 do i = 2, n-1 ! inner loop over the FIRST index u_new(i,j) = ... end do end do ``` Fortran is column-major: `u(i,j)` and `u(i+1,j)` are adjacent, so `i` innermost walks contiguous memory and uses each cache line fully (Ch. 5; measu → Ch24

X

x (i) fastest, then y (j), then z (k)
so `i` is innermost, `k` outermost, which is again exactly Fortran's column-major order for `u(i,j,k)`. → Ch26

Z

zero-padded, > increasing index
`heat_000000.vtk`, `heat_000100.vtk`, `heat_000200.vtk`, … — that lets the viewer > detect the group and order it, and (b) optionally a small **collection file** that names each snapshot and > its physical time. The zero-padding is not cosmetic: it makes the filenames sort in numeric order under > p → Introduction to Fortran Programming