HP Fortran Programmer's Reference (September 2007)

Program units and procedures
Terminology and concepts
Chapter 7156
Procedures
A procedure is a subroutine or function that contains a sequence of statements and that
may be invoked during program execution. Depending on where and how it is used, a
procedure can be one of the following:
Intrinsic procedures are defined by the language and are available for use without any
declaration or definition. Intrinsic procedures implement common computations that are
important to scientific and engineering applications. Intrinsic procedures are described in
detail in Chapter 11, “Intrinsic procedures,” on page 501.
•Anexternal procedure is a separately compilable program unit whose name and any
additional entry points have global scope. External procedures are described in “External
procedures” on page 161.
•Aninternal procedure has more limited accessibility than an external procedure. It can
appear only within a main program unit or an external procedure and cannot be accessed
outside of its hosting program unit. Internal procedures are described in “Internal
procedures” on page 167.
•Amodule procedure can be defined only within a module program unit and can be
accessed only by use association. Module procedures are described in “Modules” on
page 190.
Scope
All defined Fortran entities have a
scope
within which their properties are known. For
example, a label used within a subprogram cannot be referenced directly from outside the
subprogram; the subprogram is the scoping unit of the label. A variable declared within a
subprogram has a scope that is the subprogram. A common block name can be used in any
program unit, and it refers to the same entity—that is, the name has global scope. At the
other extreme, the index variable used within an implied-DO loop in a DATA statement or array
constructor has a scope consisting only of the implied-DO loop construct itself.
Association
If the concept of scope limits the accessibility of entities, then the concept of association
permits different entities to become accessible to each other in the same or different scope.
The different types of association are:
Argument association is the association that is established between actual arguments
and dummy arguments during a procedure reference. For more information, see
Argument association” on page 171.