next up previous contents
Next: Automatic Arrays Up: Procedures and Array Arguments Previous: Dummy Array Arguments

Assumed-shape Arrays

Should declare dummy arrays as assumed-shape arrays:

     INTERFACE
      SUBROUTINE gimlet(a,b)
       ...
     END INTERFACE
      ...
     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
    END PROGRAM

    SUBROUTINE gimlet(a,b)
     REAL, INTENT(IN)   :: a(:), b(:,:)
      ...
    END SUBROUTINE gimlet
Note:

For more information, click here gif


next up previous contents
Next: Automatic Arrays Up: Procedures and Array Arguments Previous: Dummy Array Arguments

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