Chapter 21. Introduction to
Fortran 90 Language Features
21.0 Introduction
Fortran 90 is in many respects a backwards-compatible modernization of
the
long-used (and much abused) Fortran 77 language, but it is also, in
other respects,
a new language for parallel programming on present and future
multiprocessor
machines. These twin design goals of the language sometimes add
confusion to the
process of becoming fluent in Fortran 90 programming.
In a certain trivial sense, Fortran 90 is strictly backwards-compatible
with
Fortran 77. That is, any Fortran 90 compiler is supposed to be able to
compile
any legacy Fortran 77 code without error. The reason for terming this
compatibility
trivial, however, is that you have to tell the compiler (usually via a
source file name
ending in “.f” or “.for”) that
it is dealing with a Fortran 77 file. If you instead
try to pass off Fortran 77 code as native Fortran 90 (e.g., by naming
the source file
something ending in “.f90”) it will not always work
correctly!
It is best, therefore, to approach Fortran 90 as a new computer
language, albeit
one with a lot in common with Fortran 77. Indeed, in such terms,
Fortran 90 is a
fairly big language, with a large number of new constructions and
intrinsic functions.
Here, in one short chapter, we do not pretend to provide a complete
description
of the language. Luckily, there are good books that do exactly that.
Our favorite
one is by Metcalf and Reid [1], cited throughout this chapter as
“M&R.” Other good
starting points include [2] and [3].
Our goal, in the remainder of this chapter, is to give a good, working
description
of those Fortran 90 language features that are not immediately
self-explanatory
to Fortran 77 programmers, with particular emphasis on those that occur
most
frequently in the Fortran 90 versions of the Numerical Recipes
routines. This
chapter, by itself, will not teach you to write Fortran 90 code. But it
ought to help
you acquire a reading knowledge of the language, and perhaps provide
enough of
a head start that you can rapidly pick up the rest of what you need to
know from
M&R or another Fortran 90 reference book.
CITED REFERENCES AND
FURTHER READING:
Metcalf,
M., and Reid, J. 1996, Fortran 90/95 Explained (Oxford: Oxford
University Press). [1]
Kerrigan,
J.F. 1993, Migrating to Fortran 90 (Sebastopol, CA:
O’Reilly). [2]
Brainerd,
W.S., Goldberg, C.H., and Adams, J.C. 1996, Programmer’s
Guide to Fortran 90, 3rd
ed.
(New York: Springer-Verlag). [3]
|