next up previous contents
Next: Automatic Arrays Up: Procedures and Arrays Previous: Explicit-shape Arrays

 

Assumed-shape Arrays

Should declare dummy arrays as assumed-shape arrays:

    PROGRAM Main
     IMPLICIT NONE
      REAL, DIMENSION(40)    :: X
      REAL, DIMENSION(40,40) :: Y
       ...
      CALL gimlet(X,Y)
      CALL gimlet(X(1:39:2),Y(2:4,4:4))
      CALL gimlet(X(1:39:2),Y(2:4,4)) ! invalid
    CONTAINS
     SUBROUTINE gimlet(a,b)
      REAL, INTENT(IN)   :: a(:), b(:,:)
        ...
     END SUBROUTINE gimlet
    END PROGRAM
Note:

For more information, click here gif


next up previous contents
Next: Automatic Arrays Up: Procedures and Arrays Previous: Explicit-shape Arrays

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