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: Modules
Where to go deeper on modules, submodules, and program organization. Sources are tagged Tier 1 (works we are confident exist and recommend) and Tier 2 (real and worth seeking, but confirm the current edition or URL yourself). Modules are the foundation of every large Fortran code, so this reading pays off for the whole rest of the book.
The canonical books
- Metcalf, Reid, and Cohen, Modern Fortran Explained (Oxford University Press). The definitive reference on the module and submodule facilities — the exact rules for access control, host association in submodules, and separate module procedures. When a corner case puzzles you, this is where the precise answer lives. Tier 1.
- Stephen Chapman, Fortran for Scientists and Engineers (McGraw-Hill). A gentler, example-driven treatment of modules and how to structure procedures into them; good for consolidating §8.1–8.2 before you push into submodules. Tier 1.
- Milan Curcic, Modern Fortran: Building Efficient Parallel Applications (Manning). Project-driven and modern; shows modules being used the way this book does — as the organizing unit of a real, growing numerical code, with an eye to the parallel back-ends of Part VIII. Tier 1.
On submodules specifically
- The
fortran-lang.orglearning pages on modules and submodules. Short, current, and worked with compilable examples; the clearest free introduction to the interface/implementation split of §8.3, with themodule procedureshorthand shown side by side with the full form. Tier 1. - The ISO/IEC 1539-1:2018 Fortran standard. The primary source for what a module is: the rules for
useassociation,public/private, separate module procedures, and submodule host association. Dense, authoritative, and the final word when a compiler and a textbook seem to disagree. Tier 1.
The design ideas behind modules
- David Parnas, "On the Criteria To Be Used in Decomposing Systems into Modules" (1972). The paper this
chapter's epigraph is drawn from, and still the best short argument for why to modularize: hide the
decisions likely to change behind stable interfaces. Fortran's
private/publicis this idea made into language. Tier 2 (a classic; confirm the reprint venue). - The GCC /
gfortrandocumentation. The manual for the compiler you are using — how it searches for.modfiles (-I,-J), what it puts in a.smod, and the exact wording of the "Cannot open module file" diagnostic you met in §8.5. Tier 1.
Tools that manage compile order for you
- The Fortran Package Manager (fpm), at
fpm.fortran-lang.org. Scans yourusestatements and derives the compile order automatically — the practical answer to §8.5's bookkeeping. We adopt it for the project in Chapter 16. Tier 1. - Compiler Explorer (
godbolt.org), withgfortranselected. Paste a module and a caller and watch the explicit interface let the compiler inline across the call — a concrete look at the ⚡ Performance Note of §8.2. Tier 1.
Suggested order
- Read the
fortran-lang.orgmodules and submodules pages now — they mirror this chapter and give you a second worked pass through §8.1–8.3. - Keep Chapman at hand for more examples of modules in scientific context; graduate to Metcalf/Reid/Cohen the first time a submodule or host-association rule needs pinning down.
- Skim Parnas (1972) once the mechanics feel solid — it reframes everything you just learned as why, not just how, and that framing carries straight into the architecture work of Chapter 36.
- Bookmark the fpm docs; the moment your project outgrows a single compile command, it is the tool that makes §8.5 someone else's problem.