Next: Automatic Arrays
Up: Procedures and Array Arguments
Previous: Dummy Array Arguments
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:
- an explicit INTERFACE block is mandatory.
- the actual arguments cannot be a vector subscripted array,
- the actual argument cannot be an assumed-size array.
- in procedure bounds begin at 1.
For more information, click here
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 1996Not for commercial use.