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: Anatomy of a Real Scientific Code

Where to go deeper on architecture, build systems, and navigating real scientific software. 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). This chapter's skills are best learned by doing — so several of these are codebases and tools to open, not books to read.

Software design and architecture

  • David Parnas, "On the Criteria To Be Used in Decomposing Systems into Modules" (1972). The foundational argument for why to decompose a system into modules with stable interfaces — hide the decisions likely to change. Everything in §36.1–§36.2 is this idea applied to Fortran. Tier 2 (a classic; confirm the reprint venue).
  • Frederick P. Brooks Jr., The Mythical Man-Month (Addison-Wesley). The source of this chapter's epigraph and the enduring wisdom that data structures ("your tables") explain a program better than its control flow — precisely the "follow the data, not the control flow" reading strategy of §36.5. Tier 1.
  • Milan Curcic, Modern Fortran: Building Efficient Parallel Applications (Manning). Project-driven and modern; shows a real Fortran code organized into modules and packaged with fpm the way this chapter prescribes, with the parallel back-ends of Part VIII in view. Tier 1.

Build systems

  • The Fortran Package Manager (fpm), at fpm.fortran-lang.org. The documentation for the build tool this book uses: the app//src//test/ convention, the fpm.toml manifest, dependencies, and how fpm derives compile order from your use statements. Start here for any new Fortran project. Tier 1.
  • The CMake documentation, at cmake.org/documentation. The build system the largest cross-platform scientific codes rely on. Dense, but the tutorial is a gentle on-ramp, and you will meet CMake in the wild. Tier 1.
  • The GNU Make manual (gnu.org/software/make/manual). The classic. Read enough to understand a hand-written Fortran Makefile — targets, prerequisites, and how module .o/.mod dependencies dictate order (§36.3, and Chapter 8). Tier 1.
  • The Meson build system (mesonbuild.com). Modern, fast, with first-class Fortran support; worth a look as the cleaner alternative to CMake for new projects that still need more than fpm offers. Tier 2 (active project; check current Fortran support).

Real codes to open (the best teacher)

  • Universal Ctags (ctags.io) and a Fortran language server (fortls). The tools that turn "find a name" into "jump to its definition" and "find all callers" — the two moves you make ten thousand times (§36.4). Set one up in your editor before you open a large code. Tier 1.
  • The GCC / gfortran documentation. How the compiler finds and emits .mod/.smod files (-I, -J) — the mechanics behind the compile-order rule that every build system automates. Tier 1.

Suggested order

  1. Read the fpm docs and turn your own solver into a package now (this chapter's Project Checkpoint) — the fastest way to make the architecture concrete.
  2. Clone one real code (WRF, CESM, or Quantum ESPRESSO) and run Case Study 1's navigation moves on it. Twenty minutes of real navigation teaches more than any chapter.
  3. Skim Brooks and Parnas once the mechanics feel solid — they reframe the how of this chapter as why, and that framing carries straight into the testing and reproducibility of Chapter 37.
  4. Bookmark the CMake and Make manuals against the day you inherit a code that uses them — and you will.