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: I/O and Formatted Output
Fortran I/O is broad, and this chapter taught the working subset. When you need the exact rule for a descriptor, an access mode, or a namelist edge case, these are where to look. Sources are tagged Tier 1 (confident, recommended) and Tier 2 (real and worth seeking; confirm the current edition/URL yourself).
The reference you will reach for first
- Appendix F — I/O and Format Reference (this
book). The full edit-descriptor catalog (
g,en,d,l,b/o/z, scale factors), the format reversion rules, and a table ofopen/inquirespecifiers. Keep it beside you while you write I/O. Tier 1.
The canonical books
- Stephen Chapman, Fortran for Scientists and Engineers (McGraw-Hill). Its formatted-I/O and file-processing chapters are thorough and example-driven, at exactly this book's level; the best place to see more worked format strings. Tier 1.
- Metcalf, Reid, and Cohen, Modern Fortran Explained (Oxford University Press). The definitive account of the I/O statements and the edit descriptors, including the parts we deferred — non-advancing I/O, asynchronous transfer, and the precise semantics of list-directed and namelist I/O. The book to settle an argument about what the standard actually says. Tier 1.
- Milan Curcic, Modern Fortran (Manning). Practical, modern-style I/O in the context of real programs, with good coverage of reading and writing data files the way working code does. Tier 1.
Free and online
- The GCC /
gfortrandocumentation. The "GNU Fortran" manual documents how this compiler treats the processor-defined corners you must not guess about: the units ofrecl, the default rounding of formatted output,newunitbehavior, and the exact form of list-directed and namelist output. When output does not match your hand computation, check here first. Tier 1. fortran-lang.org— Learn. The community tutorials include clear, current introductions to formatted I/O and file handling in modern style. Tier 1.- The ISO/IEC 1539-1 Fortran standard (2018). Clause 12 (I/O) and Clause 13 (formatting) are the authoritative source. Dense, but definitive when a subtle question about records, connection modes, or edit descriptors has to be answered exactly. Tier 2 (specific clause numbers vary by edition — verify).
Where this chapter points next
- Unidata NetCDF and The HDF Group's HDF5 user guides. The self-describing, portable formats that solve the "raw binary is not self-describing" problem of §7.5 — the subject of Chapter 25. Skim their "what problem does this solve" introductions now; you will use them in earnest in Part VI. Tier 1.
- The VTK file-format documentation (Kitware). How to write simulation output that ParaView and VisIt can visualize, built directly on the formatted and binary I/O of this chapter — see Chapter 26. Tier 2.
Suggested order
- Bookmark Appendix F and the gfortran manual now — between them they answer almost every "what exactly does this print?" question.
- Read Chapman's I/O chapters alongside this one for more worked examples, especially of file processing.
- When a format or access mode surprises you, check gfortran's processor-specific behavior before assuming a bug — most I/O surprises are documented, defined choices, not errors.
- Reach for Metcalf/Reid/Cohen when you need the precise standard semantics — non-advancing I/O and the full namelist rules especially.
- Skim the NetCDF/HDF5 introductions to see where scientific I/O is headed once text and raw binary stop scaling.