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: Procedures

Where to go deeper on subroutines, functions, intent, pure/elemental, and array arguments. Sources are tagged Tier 1 (works we are confident exist and recommend) and Tier 2 (real and useful, but confirm the current edition or URL yourself). Procedures are the backbone of every later chapter, so time spent here compounds.

The teaching texts

  • Stephen Chapman, Fortran for Scientists and Engineers (McGraw-Hill). Its procedure chapters are the gentlest thorough treatment of subroutines, functions, argument passing, and intent, with many worked scientific examples in the same spirit as ours. Start here if any section felt fast. Tier 1.
  • Milan Curcic, Modern Fortran: Building Efficient Parallel Applications (Manning). Especially good on why pure and elemental matter — it connects them directly to the parallelism of later chapters, exactly the argument we make in §6.4. Project-driven and modern throughout. Tier 1.

The reference

  • Metcalf, Reid, and Cohen, Modern Fortran Explained (Oxford University Press). The definitive account of the rules this chapter sketches: the precise semantics of intent, the constraints on pure and elemental procedures, argument association, and the three array-argument forms. When you need to know exactly what the standard permits, this is the book. Tier 1.
  • The Fortran 2018 standard (ISO/IEC 1539-1:2018). The final authority. Its clauses on procedures, dummy-argument intents, and pure/elemental requirements are dense but unambiguous — worth consulting once you hit a genuine corner case a compiler and a textbook disagree on. Tier 1.

Free and online

  • fortran-lang.org — the learning resources and "Quickstart tutorial." The sections on procedures and modules cover the same ground as this chapter with runnable snippets, and the material is actively maintained by the modern-Fortran community. The single best free starting point. Tier 1.
  • The GCC / gfortran documentation. Consult it for compiler-specific behavior — how gfortran reports an intent violation, its treatment of the Fortran 2018 "recursive by default" rule, and the diagnostics -Wall and -fcheck=all produce for procedure calls. Tier 1.
  • The Fortran Wiki (fortranwiki.org). Short, focused articles on pure, elemental, keyword and optional arguments, and assumed-shape arrays — handy for a quick refresher on one feature. Community-edited, so cross-check anything surprising. Tier 2.

Tools

  • Compiler Explorer (godbolt.org), with gfortran selected. Paste an elemental function applied to an array, or a pure function called twice in a loop, and watch the compiler hoist and vectorize it. This is the most vivid way to see the optimization payoff §6.4 describes — bookmark it for Chapter 27, where it becomes central. Tier 1.

Suggested order

  1. If any section felt quick, read Chapman's procedure chapters first — they move slowly and repeat the fundamentals with fresh examples.
  2. Skim the fortran-lang.org procedures tutorial and type its snippets; ten minutes of compiling beats an hour of reading here.
  3. When a specific rule bites — "can an elemental function have an optional argument?", "what exactly does intent(out) do to an allocatable component?" — reach for Metcalf, Reid, and Cohen, then confirm the compiler's take in the gfortran docs.
  4. Once you have written a few procedures, open godbolt.org and compare the assembly of a pure function against an identical non-pure one. You will not follow every instruction yet, but you will see that the keyword changed the output — the promise §6.4 makes, made concrete.