next up previous contents
Next: External Subroutine Example Up: External Procedures Previous: External Procedures

 

External Subroutine Syntax

Syntax of a (non-recursive) subroutine declaration:

 
SUBROUTINE < procname >[ (< dummy args >) ]

< declaration of dummy args >

...

< declaration of local objects >

...

< executable stmts >

...

[ CONTAINS

< internal procedure definitions > ]

END [ SUBROUTINE [< procname > ] ]

SUBROUTINE s may contain internal procedures but only if they themselves are not already internal.

  figure9027
Figure 23: Schematic Diagram of a Subroutine

The structure is similar to that of the main PROGRAM unit except a SUBROUTINE can be parameterised (with arguments) and the type and kind of these must be specified in the declarations section. A SUBROUTINE may include calls to other program units either internal, external or visible by USE association (defined in a module and USE d in the procedure.

Return to corresponding overview page gif




next up previous contents
Next: External Subroutine Example Up: External Procedures Previous: External Procedures

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