Introduction to Fortran Programming

The Language of Supercomputers

Modern Fortran for Scientists, Engineers, and High-Performance Computing

DataField.Dev


From Hello, world to parallel supercomputer code.

A free, open textbook that teaches Modern Fortran (2018 standard, gfortran) from scratch — for the physicists, chemists, engineers, and earth scientists who meet Fortran in their research codes; for the computational scientists who need performance past Python and MATLAB; and for anyone modernizing legacy FORTRAN 77 without breaking it. Along the way you will build one thing yourself, from a fifty-line program into a parallel, validated, optimized simulation: a 2D heat-equation solver.


First edition — 2026.

© 2026 DataField.Dev. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0). You are free to read, share, and adapt it, including for commercial purposes, provided you give appropriate credit and license your adaptations under the same terms. All code samples are additionally released under the MIT License, so you may reuse them in your own projects without the share-alike requirement.

The code in this book is written for gfortran version 10 or later and conforms to the Fortran 2018 standard. It is meant to be read, compiled, and run — but, for honesty about what has been tested, no program in this book was executed while it was being written; every "expected output" was worked out by hand. If you find a discrepancy, you have found a bug, and we would like to hear about it.