LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Fortran Array Tricks? (https://www.linuxquestions.org/questions/programming-9/fortran-array-tricks-74923/)

RWild 07-22-2003 01:42 PM

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).


All times are GMT -5. The time now is 06:46 PM.