MORE INFORMATION ON Data_flow.f
Data flow anomalies may result when adequate attention is not directed
to the sequential pattern of definitions, references and undefinitions
of values for variables. Two general rules concerning the order of these
events along each path from the start of a program to a stop are cited as being
guidelines for analysis:
1. A reference must be preceded by an assignment, without an intervening undefinition.
A number of things can cause either or both rules to be violated. One of the most obvious cases
of a violation of the first rule is forgetting to initialize a variable. Spelling errors,
misplaced statements and confusion of names can also cause this.
2. A definition must be followed by a reference, before another definition or undefinition.
One may also forget that a variable is already defined, or that it will not be used later.
This may constitute a violation of the second rule.
In the first example of Data_flow.f, anomalies of both types 1 and 2 exist. The function AREAC is executed
without initialization of the first argument, and there is simultaneously no use of PI
in the subroutine DOLS after it is assigned a value in the first statement.
Evidently, a spelling error has occurred; PI should be P or vice versa.
In the second example, the variable P is referenced before definition (a type 1 anomaly), and the
variable PI is defined but never referenced afterwards (anomaly of type 2). Again, the programmer
probably intended P to be PI, or conversely.