An internal procedure is defined by an internal subprogram. Internal procedures can appear in the main program, in an external subprogram, or in a module subprogram. The program unit in which the internal procedure appears is called its host.
An internal procedure takes the following form:
CONTAINS internal-subprogram [internal-subprogram]...
Internal procedures are the same as external procedures, except for the following:
An internal procedure can reference itself (directly or indirectly); it can be referenced in the execution part of its host and in the execution part of any internal procedure contained in the same host (including itself).
The interface of an internal procedure is always explicit.
Every HPF internal subprogram must be of the same extrinsic kind as its host, and any internal subprogram whose extrinsic kind is not given explicitly is assumed to be of that extrinsic kind.
The following example shows an internal procedure:
PROGRAM COLOR_GUIDE ... CONTAINS FUNCTION HUE(BLUE) ! An internal procedure ... END FUNCTION HUE END PROGRAM