Affiliate disclosure

Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.

Further Reading: Arrays

Arrays are the deep end of Fortran's design, and the good news is that the best sources are the canonical ones you will keep all book long. Sources are tagged Tier 1 (works we are confident exist and recommend) and Tier 2 (real and worth seeking; confirm the current edition or URL yourself). The theme here is: read enough to make whole-array thinking and column-major layout second nature, because both echo through every performance chapter later.

The canonical books

  • Stephen Chapman, Fortran for Scientists and Engineers (McGraw-Hill). Its array chapters are the gentlest thorough treatment in print — declaration, sections, allocatable arrays, and the intrinsic functions, all worked in a scientific-computing spirit close to ours. Start here if any section of this chapter felt fast. Tier 1.
  • Metcalf, Reid, and Cohen, Modern Fortran Explained (Oxford University Press). The definitive reference for what array sections, constructors, and allocatable semantics precisely mean, straight from the people who help write the standard. When you need the exact rule for a corner case — assumed-shape conformance, automatic reallocation on assignment — this is the book. Tier 1.
  • Milan Curcic, Modern Fortran: Building Efficient Parallel Applications (Manning). Project-driven and modern; strong on using whole-array operations and allocatable arrays the way working code does, and it carries the array ideas forward into the parallel features you will meet in Part VIII. Tier 1.

Free and online

  • fortran-lang.org — Learn → "Arrays and loops." A concise, current tutorial on exactly this chapter's material, with runnable snippets. The single best free companion to these pages. Tier 1.
  • The GCC / gfortran documentation — intrinsic procedures. The authoritative per-intrinsic reference for sum, matmul, reshape, spread, pack, maxloc, and the rest: exact argument lists, the dim and mask options, and return shapes. Bookmark it; you will consult it constantly. Tier 1.
  • Fortran stdlib (stdlib.fortran-lang.org). The community standard library, whose array and statistics modules show idiomatic modern array code you can read and imitate. Tier 1.

On memory layout (the payoff)

  • Ulrich Drepper, "What Every Programmer Should Know About Memory." A long, superb primer on caches and why access order dominates performance — the deep "why" behind §5.6. You do not need all of it now; read the sections on cache lines and access patterns, and return after Chapter 27. Tier 2.
  • Compiler Explorer (godbolt.org), with gfortran selected. Paste c = a + b on arrays and read the vectorized instructions the compiler emits; then try the two loop orders of a 2D sweep and compare. Wordless proof that the array form and the memory order change what the machine does. Tier 1.

Reference for the intrinsics

  • The ISO/IEC 1539-1:2018 standard, Clause 16 (intrinsic procedures). The primary source for what every array intrinsic is guaranteed to do. Terse and authoritative; reach for it only when a tutorial and the gfortran docs disagree, which is rare. Tier 1.

Suggested order

  1. Work back through this chapter's code/ examples in Compiler Explorer, changing one thing at a time and predicting the output before you run — the fastest way to make sections and whole-array ops reflexive.
  2. Read Chapman's array chapters for breadth, keeping Metcalf/Reid/Cohen on the shelf for the exact rule when a program surprises you.
  3. Skim the gfortran intrinsics page once now, so you know what is in the toolbox, and consult it by name thereafter.
  4. Save Drepper on memory for when you reach Part VII — it turns the "10× from loop order" claim of §5.6 into something you understand all the way down.