There are three types of dummy array argument:
INTEGER, DIMENSION(8,8), INTENT(IN) :: explicit_shape
The actual argument that becomes associated with an explicit-shape dummy must conform in size and shape. An explicit INTERFACE is not required in this case. This method of declaring dummy arguments is very inflexible as only arrays of one fixed size can be passed. This form of declaration is only very occasionally appropriate.
INTEGER, INTENT(IN) :: lda ! dummy arg INTEGER, DIMENSION(lda,*) :: assumed_size
The last bound of an assumed-size array remains unspecified, (it contains a *,) and can adopt an assumed value. An explicit INTERFACE is not required. This was the FORTRAN 77 method of passing arrays but has been totally superseeded by the next category.
INTEGER, DIMENSION(:,:), INTENT(IN) :: assumed_shape
All bounds can be inherited from the actual argument. The actual array that corresponds to the dummy must match in type, kind and rank. An explicit INTERFACE must be provided. This type of argument should always used in preference to assumed-size arrays.
Note: an actual argument can be an ALLOCATABLE array but a dummy argument cannot be -- this means effectively that an ALLOCATABLE array must be allocated before being used as an actual argument.
Return to corresponding overview page