How to Use This Book
This book is large — forty chapters across ten parts — because Fortran done properly is large, and because we teach it from scratch and carry it all the way to parallel supercomputer code. You do not have to read all of it in order. This page explains how the book is built so you can navigate it well.
Choose a reading path
Four tracks run through the book. Every chapter's opening ## Learning Paths box tells you what that
particular chapter offers each track.
- 🔬 Scientist Track — "my Python or MATLAB is too slow." You want the speed and you want it soon. Read Parts I–III to learn the language, then jump to Part V (numerical methods), Part VII (performance), and Part VIII (parallelism). Come back for Part IV if you ever meet legacy code.
- 📖 Standard — comprehensive mastery. Read straight through, Chapter 1 to Chapter 40. This is the path a one- or two-semester course would follow, and the one the progressive project assumes.
- 🔧 Legacy Track — "I inherited FORTRAN 77 and have to understand it." Read Part I for the modern basics, then go straight to Part IV (reading and modernizing old code) and Part IX (real-world code organization). Return to Parts II, V, and VII as your modernization work demands.
- ⚡ HPC Track — "I need parallel code for a cluster." Get the fundamentals in Parts I–III, then go directly to Parts VII (performance) and VIII (parallelism: coarrays, OpenMP, MPI, GPU).
What is in each chapter
Every chapter is a folder of seven files, in this order:
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.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 find the bug; to modernize an old fragment; and to extend the solver. Solutions to the daggered (†) and odd-numbered problems are in Appendix, Answers to Selected Exercises.quiz.md— about twenty quick self-checks with an answer key, to confirm you understood before moving on.case-study-01.mdandcase-study-02.md— two longer, realistic worked scenarios. The first reads and analyzes real code or a real computation; the second builds or optimizes one, a notch harder.key-takeaways.md— a one-page, mostly-tabular reference card: the chapter's syntax, intrinsics, pitfalls, and rules, plus the piece of the solver you just added. Come here to review.further-reading.md— a short, annotated list of where to go deeper.
About the code
Every code example in this book is complete, compilable 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 early (Chapter 2 and Appendix C walk you
through installing the toolchain on Linux, macOS, and Windows).
One rule we hold to strictly: the code in this book was never run while the book was written. Every "expected output" was computed by hand. This is a promise about honesty, not a suggestion that you skip running it — you should compile and run everything, because that is how you learn, and because when your result matches ours you will know you did it right. Legacy FORTRAN 77 constructs appear only in Part IV (and the occasional labeled sidebar), always marked as legacy and always shown beside their modern replacement, so you never confuse "how old code looks" with "how you should write."
The callouts
Short boxed asides recur throughout, each with an icon so you can find the kind you want:
💡 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 you see everything after it. 🐛 Find the Bug — diagnose a broken snippet. 📜 From History — where a feature came from. ⚡ Performance Note — the speed consequence. 🐍 Python Comparison — the same thing in Python, and who wins. 🔧 Modern vs Legacy — the modern way beside the old way.
The running project
If you do one thing beyond reading, do the project. Each chapter closes with a Project Checkpoint that adds one piece to a 2D heat-equation solver. Follow it and, by the Chapter 38 capstone, you will have built a complete parallel simulation you understand end to end. Prefer fluid flow or an N-body system? The structure is identical — swap the physics and keep the scaffolding. The complete reference code lives in Appendix I.
Ready? Chapter 1 makes the case for the whole enterprise; Chapter 2 gets a compiler onto your machine and your first program running. Let's go.