I have always regarded Fortran 95 as the unwanted step-child of a Fortran IV mother and an unknown father. So, when I was called upon recently to provide support for some Fortran programmers, I picked up Chapman’s book to find the real story.
The book is targeted both at those who are learning Fortran in introductory programming courses, and at professional engineers and scientists who require an on-the-job reference. In this (second) edition (the first came out in 1998 [1]), the coverage of numerical methods and libraries has been reduced, and a chapter about “undesirable, obsolescent and deleted features of the language” has been added. The emphasis throughout is on top-down design methodologies, with enforced explicit typing of variables; portability is also stressed. Most chapters include examples (which can also be downloaded from a Web page) and exercises; answers to the latter can be downloaded by those who acquire an associated instructor’s manual.
The first chapter introduces readers to processing and storage concepts, with particular emphasis on two’s complement and other number-storage systems. There are some comments about the evolution of Fortran, with a sample program in Fortran I, Fortran 77, and Fortran 90.
In chapter 2, the basic elements of Fortran are introduced. A first-time user could be a little puzzled by the way some of the statements here are presented. For instance, why are there asterisks in “READ(*,*) i, j”? The reader will not actually find out until chapter 5. I found myself irritated by the author’s pious insistence on using “IMPLICIT NONE” at the start of every sub-program; this, of course, is a reflection of my own shortcomings in that regard!
Branching structures are introduced in chapter 3, and the reader is encouraged to use pseudocode and flow-chart procedures in the top-down design of programs that might use such structures. The example programs are appropriate both for scientists (light-ray refraction) and for others (day-of-week calculation).
Loops and character manipulation are addressed in chapter 4. Strange bedfellows, you might say. Actually, they fit together quite sensibly, as shown in the examples of case-insensitive string comparisons.
Chapter 5 provides an introduction to input/output concepts like FORMAT statements and scratch file access. The more advanced FORMAT descriptors and file positioning statements are covered in chapter 14.
In a similar vein, chapter 6 introduces one-dimension arrays, with multi-dimension arrays, and more advanced statements (like WHERE and FORALL) covered in chapter 8. Chapter 7 introduces procedures (subroutines, functions, and modules), with some additional features (like SAVE statements and PURE function declarations) being covered in chapter 9; there are some further additional features discussed in chapter 13 (INTERFACE and USE statements).
In the remaining chapters, I found a more detailed coverage of character variables, and some details about COMPLEX data types. I also learned how to use KIND attributes, structures, and pointers; these are things I had not encountered in my previous Fortran experience, and I have to admit that they could be really useful.
So, my views on Fortran 95’s parentage have changed somewhat after reading this book. The range and clarity of representative example programs included in the book is truly outstanding. For those who find themselves having to write Fortran programs, this is probably the best current guide available.