Program units, procedures, and subprograms
- The main program
- A module
A submodule
- A block data program unit
- An external function subprogram
- An external subroutine subprogram
An executable program is a collection of program units consisting of one main program and any
number of external subprograms, modules, submodules
, and block data program units.
A subprogram can be invoked by a main program or by another subprogram to perform a particular activity. When a procedure is invoked, the referenced subprogram is executed.
An external or module subprogram can contain multiple ENTRY statements. The subprogram defines a procedure for the SUBROUTINE or FUNCTION statement, as well as one procedure for each ENTRY statement.
An external procedure is defined either by an external subprogram or by a program unit in a programming language other than Fortran.
Main programs, external procedures, block data program units, common blocks, entities with
binding labels, modules, and submodules
are global entities. Internal and module procedures are
local entities.