Next: Include Files
Up: More About COMMON
Previous: Initializing COMMON

EQUIVALENCE

Don't use EQUIVALENCE statements.

The EQUIVALENCE statement, as you can read in section 15.7 if you wish, is a way of telling Fortran that two different variables can be stored in the same physical location in the computer's memory.

Back when Fortran was designed, in the late 1950's, computers had tiny physical memories of no more than a few thousand bytes. Today, even the smallest computers generally have memories with several million bytes.

So, in the old days, if programmers could convince themselves that two particular variables would never be needed at the same time, it was to their advantage to tell Fortran that fact so that the running program would use up less memory.

Today, with far larger physical memories (and the development of virtual memories, in case you know what they are), it is no longer necessary to do this except in extreme circumstances. It is too easy to make mistakes with EQUIVALENCE statements, so don't use them.


Next: Include Files
Up: More About COMMON
Previous: Initializing COMMON

Hamlet Project
hamlet@cs.utah.edu