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

 

Automatic Arrays

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

Consider,
    PROGRAM Main
     IMPLICIT NONE
      INTEGER :: IX, IY
     .....
      CALL une_bus_riot(IX,2,3)
      CALL une_bus_riot(IY,7,2)
    CONTAINS
     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
    END PROGRAM

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 Arrays Previous: Assumed-shape Arrays

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.