Fortran Array Tricks?
I am looking at some old Fortran 77 code that began life as Fortran 66 code. It is full of instances where an array is declared with very large dimensions in the main program, redimensioned to a single element (ARRAY(1))., and used in loops like:
DO 10 I = 1,ITOT
ARRAY(I) = something
10 CONTINUE
Where ITOT is may be as large as the original dimension. This generates "array out of bounds" errors if the array is in a COMMON block but not if it is not and passed as an argument.
Why would one do this? Why does it not work with a "modern" compiler (I have tried at least four).
|