Fortran 90

4.1 Declaring Dummy Arguments
Fortran 90 extends the possibilities for the declaration of dummy arguments in procedures.

Explicit-shape

In FORTRAN 77, arrays that were passed could be declared with an explicit shape (rank and extents)--but this declared shape did NOT have to match the shape of the array actually passed. The procedure's declaration merely specified the rank and extents that would be used internally in the procedure. The extents could be declared as static or adjustable, in the sense that the extents could be provided as procedure arguments. For example,
 SUBROUTINE s1(a,b,c,k,m,n)
 REAL :: a(100,100) ! static
 REAL :: b(m,n)  ! adjustable
 REAL :: c(-10:20,k:n) ! adjustable
This method of declaring dummy arguments is still supported in Fortran 90.

Assumed-size (obsolescent)

FORTRAN 77 also supported assumed-size arrays. An assumed-size declaration gives the programmer more flexibility in specifying the extent of an array, but only in the last index; the others must be explicitly declared. On entry, the subroutine would simply assume that the size of the argument that was passed would be large enough to contain all the input and/or hold all the output.
 SUBROUTINE s2(a,b,c,k,m)
 REAL :: a(100,100) ! static
 REAL :: b(m,*)  ! assumed-size
 REAL :: c(-10:20,k:*) ! assumed-size
This feature relies on the assumption of a linear memory model, which is not necessarily a good model for a distributed memory machine (for example). Thus, assumed-size arrays appear on the deprecated list of features, that is, the list of features which are obsolescent beginning with Fortran 90 and which could be dropped from future versions of the language.

Assumed-shape

New to Fortran 90 are assumed-shape dummy argument declarations. In this declaration method, the shape of the array does not need to be specified fully. Its rank must be given, but the extents are not listed. The declaration of each dimension has the appearance [lower-bound]:[upper-bound]. So for example,
 SUBROUTINE s3(a,b,c,k)
 REAL :: a(100,100) ! static
 REAL :: b(:,:)  ! assumed-shape
 REAL :: c(-10:20,k:) ! assumed-shape
This technique requires an interface block in the calling program (or a USE statement, if the subroutine is in a MODULE) for correct execution.