next up previous contents
Next: Assumed-shape Arrays Up: Procedures and Array Arguments Previous: Procedures and 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; no bound information is passed to the procedure. Consider the following examples,

    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)     ! non conforming
      CALL subby(A3(::2,::4))        ! OK
      CALL subby(RESHAPE(A2,(/8,8/)) ! OK
       ...
    CONTAINS
     SUBROUTINE subby(explicit_shape)
      IMPLICIT NONE
      INTEGER, DIMENSION(8,8) :: explicit_shape
      ...
     END SUBROUTINE subby
    END PROGRAM Main

The bottom line is subby can ``accept any argument as long as it is an tex2html_wrap_inline28614 default INTEGER array''! This is clearly a very inflexible approach which generally should not generally be used.

Return to corresponding overview page gif


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

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.