8 Program Units and Procedures

A Fortran 90 program consists of one or more program units. The principal kinds of program units are: the main program, external subprograms (user-written functions and subroutines), modules, and block data program units.

A procedure can be invoked during program execution to perform a specific task. There are several kinds of procedures, as follows:

Kind of Procedure  Description 
External Procedure  A procedure that is not part of any other program unit. 
Module Procedure  A procedure defined within a module 
Internal Procedure  A procedure (other than a statement function) contained within a main program, function, or subroutine 
Intrinsic Procedure  A procedure defined by the Fortran language 
Dummy Procedure  A dummy argument specified as a procedure or appearing in a procedure reference 
Statement function  A computing procedure defined by a single statement  

A function is invoked in an expression and returns a single value (function result) that is used to evaluate the expression. A subroutine is invoked in a CALL statement or by a defined assignment statement, and does not return a particular value.

Recursion (direct or indirect) is permitted for functions and subroutines.

A procedure interface refers to the properties of a procedure that interact with or are of concern to the calling program. A procedure interface can be explicitly defined in interface blocks. All program units, except block data program units, can contain interface blocks.

This chapter contains information on the following topics:

For More Information:


Previous Page Next Page Table of Contents