next up previous contents
Next: What Appears in an Up: Program Units Previous: Implicit SAVE Attribute and

Procedure Interfaces

For EXTERNAL procedures it is possible to provide an explicit interface for a procedure. Consider:

    SUBROUTINE expsum( n, k, x, sum )! in interface
     IMPLICIT NONE
     INTEGER, INTENT(IN) :: n        ! in interface
     REAL, INTENT(IN) :: k,x         ! in interface
     REAL, INTENT(OUT) :: sum        ! in interface
     REAL, SAVE :: cool_time
      ...
    END SUBROUTINE expsum            ! in interface

The explicit INTERFACE for this routine is given by the statements:

    INTERFACE ! for EXTERNAL procedure
     SUBROUTINE expsum( n, k, x, sum )
      INTEGER, INTENT(IN) :: n
      REAL, INTENT(IN) :: k,x
      REAL, INTENT(OUT)  :: sum
     END SUBROUTINE expsum
    END INTERFACE
This could be included in the declarations part of any other program unit which calls expsum.

Interfaces are not needed for internal (or module) procedures.

For more information, click here gif


next up previous contents
Next: What Appears in an Up: Program Units Previous: Implicit SAVE Attribute and

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.