Arrays in Subroutines, Fortran 77

I am trying to understand the Fortran code contained in: http://heath.cs.illinois.edu/courses/cs598mh/george_liu.pdf

In particular, array variable declarations in subroutines. Here's an example:

      SUBROUTINE ROOTLS (ROOT, XADJ, ADJNCY, MASK, NLVL, XLS, LS)
C
         INTEGER ADJNCY(1), LS(1), MASK(1), XLS(1)
         INTEGER XADJ(1), I, J, JSTOP, JSTRT, LBEGIN

      

I'm confused (1)

after the name of the array like ADJNCY(1)

and XADJ(1)

. These arrays are definitely more than one. What does (1)

these ads do?

+3


source to share


1 answer


In fact, this is not FORTRAN 77, but FORTRAN 66; -)

(1)

is a dirty hack in FORTRAN 66 to create something like an array of the intended size. In FORTRAN 77, this is standardized to (*)

.



Estimated size means that the actual array depends on the length of the actual array passed to the routine. Note, however, that the shape of the array is not necessarily preserved! Se is here for a great explanation of this.

+3


source







All Articles