next up previous contents
Next: Required Interfaces Up: Procedure Interfaces Previous: Procedure Interfaces

 

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

The above interface includes information about the number, type, kind and rank of the dummy arguments of the procedure expsum.

Using an INTERFACE provides for better optimisation and type checking, and allows separate compilation to be performed.

Return to corresponding overview page gif


next up previous contents
Next: Required Interfaces Up: Procedure Interfaces Previous: Procedure Interfaces

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.