next up previous contents
Next: Function Syntax Up: Program Units Previous: Subroutine Syntax

 

External Subroutine Example

An external procedure may invoke a further external procedure,

  SUBROUTINE sub1(a,b,c)
   IMPLICIT NONE
   EXTERNAL sum_sq  ! Should declare or use an INTERFACE
   REAL :: a, b, c, s
     ...
    CALL sum_sq(a,b,c,s)
    ...
  END SUBROUTINE sub1

calls,

  SUBROUTINE sum_sq(aa,bb,cc,ss)
   IMPLICIT NONE
   REAL, INTENT(IN) :: aa, bb, cc
   REAL, INTENT(OUT) :: ss
    ss = aa*aa + bb*bb + cc*cc
  END SUBROUTINE sum_sq

For more information, click here gif


next up previous contents
Next: Function Syntax Up: Program Units Previous: Subroutine Syntax

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.