FORTRAN 77 Language Reference

Restrictions

The DO variable must not be modified in any way within the range of the DO loop.

Control must not jump into the range of a DO loop from outside its range.