next up previous contents
Next: Argument Intent Up: Program Units Previous: What Appears in an

Interface Example

The following program includes an explicit interface,

    PROGRAM interface_example
     IMPLICIT NONE

     INTERFACE
      SUBROUTINE expsum(N,K,X,sum)
       INTEGER, INTENT(IN) :: N
       REAL, INTENT(IN) :: K,X
       REAL, INTENT(OUT) :: sum
      END SUBROUTINE expsum
     END INTERFACE

     REAL :: sum
      ...
     CALL expsum(10,0.5,0.1,sum)
      ...
    END PROGRAM interface_example

Explicit interfaces permit separate compilation, optimisation and type checking.

For more information, click here gif


next up previous contents
Next: Argument Intent Up: Program Units Previous: What Appears in an

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