next up previous contents
Next: Array-valued Functions Up: Procedures and Array Arguments Previous: Assumed-shape Arrays

Automatic Arrays

Other arrays can depend on dummy arguments, these are called automatic arrays and:

Consider,
     INTERFACE ! etc
      ...
     END INTERFACE
      ...
     CALL une_bus_riot(IX,2,3)
     CALL une_bus_riot(IY,7,2)
    END PROGRAM 

    SUBROUTINE une_bus_riot(A,M,N)
     INTEGER, INTENT(IN) :: M, N
     INTEGER, INTENT(INOUT) :: A(:,:)
     REAL :: A1(M,N)                 ! auto
     REAL :: A2(SIZE(A,1),SIZE(A,2)) ! auto
      ...
    END SUBROUTINE

The SIZE intrinsic or dummy arguments can be used to declare automatic arrays. A1 and A2 may have different sizes for different calls.

For more information, click here gif

Now try this question gif


next up previous contents
Next: Array-valued Functions Up: Procedures and Array Arguments Previous: Assumed-shape Arrays

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.