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: Modernizing Legacy Fortran
Modernization sits at the intersection of two literatures: the Fortran-specific "what does this old construct become?" and the language-agnostic discipline of changing working code safely. Read from both. Sources are tagged Tier 1 (confident, recommended) and Tier 2 (real and worth seeking; confirm the current edition/URL yourself).
The Fortran reference for the "after"
- Metcalf, Reid, and Cohen, Modern Fortran Explained (Oxford University Press). The definitive
account of the modern features you are migrating toward — modules,
intent, assumed-shape,error stop,transfer. When you need the exact rule for a replacement, this is the book. Tier 1. - Stephen Chapman, Fortran for Scientists and Engineers (McGraw-Hill). Its chapters contrasting the obsolescent features with their modern replacements map almost one-to-one onto this chapter's recipe. Tier 1.
The discipline of changing working code
- Michael Feathers, Working Effectively with Legacy Code (Prentice Hall). The source of the "characterization test" idea and of the chapter's epigraph. Not Fortran-specific, but the mindset — pin the behavior, then change the code — is exactly what a scientific migration needs. Tier 1.
- Martin Fowler, Refactoring: Improving the Design of Existing Code (Addison-Wesley). The canonical catalogue of small, behavior-preserving transformations. Read it for how to think about a refactoring step, even though its examples are not in Fortran. Tier 1.
Tools that do the mechanical steps for you
findent. An open-source tool that converts fixed-form to free-form and reindents; it automates the bulk of steps 1–2. Review its diff — automation is reliable but not infallible on continuation lines. Tier 1.fprettify. A configurable Fortran source formatter (whitespace, indentation, keyword case) useful for imposing a consistent modern style across a migrated codebase. Tier 1.plusFORT(Polyhedron) andCamFort(a Cambridge/Kent research tool). Heavier machinery that can restructureGOTOs and analyze/units-check old code. Worth knowing exist when a migration is large enough to justify them. Tier 2.
Free and online
fortran-lang.org— learning and "quickstart" material. The community hub's guidance on modern style is the reference implementation of the conventions this book teaches; its blog and Discourse carry practical modernization discussions. Tier 1.- The GCC /
gfortrandocumentation. Read the pages on-std=legacy(to build the "before") and-std=f2018with-Walland-fcheck=all(to build and check the "after"). The list of obsolescent and deleted features tells you what a modern compiler will and will not still accept. Tier 1.
Primary source
- ISO/IEC 1539-1:2018 (the Fortran 2018 standard). The final authority on what each modern construct means and on which older features are "obsolescent" versus "deleted." You will rarely read it cover to cover, but it settles arguments. Tier 1.
Suggested order
- Skim the obsolescent-features section of the
gfortrandocs or Chapman — it is the mirror image of this chapter's recipe and orients you to what needs replacing. - Read the first three chapters of Feathers for the safety mindset (reference-first, one change at a time) before you touch a real code.
- Keep Metcalf/Reid/Cohen at hand for the exact modern syntax of each replacement as you work.
- Try
findenton a small fixed-form file to see steps 1–2 done automatically — then read the diff, so you learn what the tool did and where it might not have.