HP Fortran Programmer's Reference (September 2007)

Arrays
Array declarations
Chapter 362
If a procedure has an argument that is an assumed-shape array, its interface must be explicit
within the calling program unit. A procedure’s interface is explicit if it is an internal
procedure within the caller procedure or if the interface is declared in an interface block
within the caller.
For example, to call the external subroutine initialize in the previous example, its interface
must appear in an interface block, as in the following:
PROGRAM main
INTEGER :: parts(0:100)
COMPLEX :: coeffs(100)
REAL :: omega(-2:+3, -1:+3, 0:3, 1:3, 2:3)
INTERFACE
SUBROUTINE initialize (a,b,c,n)
INTEGER :: n
INTEGER :: a(:)
COMPLEX :: b(ABS(n):)
REAL, DIMENSION(:,:,:,:,:) :: c
END SUBROUTINE initialize
END INTERFACE
CALL initialize(parts,coeffs,omega,lbound(omega,1))
.
.
.
END PROGRAM main
SUBROUTINE initialize (a,b,c,n)
INTEGER :: n
INTEGER :: a(:)
COMPLEX :: b(ABS(n):)
REAL, DIMENSION(:,:,:,:,:) :: c
.
.
.
END SUBROUTINE initialize
For more information about:
Internal procedures, see “Internal procedures” on page 167
Interface blocks, see “Procedure interface” on page 181
Arrays used as dummy arguments, see “Array dummy argument” on page 172