Next: Automatic Arrays
Up: Procedures and Arrays
Previous: Explicit-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:
- the actual arguments cannot be a vector subscripted array,
- the actual argument cannot be an assumed-size array.
- in the procedure, bounds begin at 1.
For more information, click here
Next: Automatic Arrays
Up: Procedures and Arrays
Previous: Explicit-shape Arrays
©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997Not for commercial use.