next up previous contents
Next: Assumed-shape Arrays Up: Procedures and Arrays Previous: Dummy Array Arguments

 

Explicit-shape Arrays

A dummy argument that is an explicit-shape array must conform in size and shape to the associated actual argument

    PROGRAM Main
     IMPLICIT NONE
      INTEGER, DIMENSION(8,8)   :: A1
      INTEGER, DIMENSION(64)    :: A2
      INTEGER, DIMENSION(16,32) :: A3
       ...
      CALL subby(A1)                 ! OK
      CALL subby(A2)                 ! ERROR
      CALL subby(A3(::2,::4))        ! OK
      CALL subby(RESHAPE(A2,(/8,8/)) ! OK
      ...
    CONTAINS
     SUBROUTINE subby(expl_shape)
      INTEGER, DIMENSION(8,8) :: expl_shape
      ...
     END SUBROUTINE subby
    END PROGRAM Main

For more information, click here gif


next up previous contents
Next: Assumed-shape Arrays Up: Procedures and Arrays Previous: Dummy Array Arguments

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