Specifies module procedures in a generic interface.
Syntax
MODULE PROCEDURE module-procedure-name-list |
- module-procedure-name-list
is a comma-separated list of module-procedure-names.
Description
A MODULE
PROCEDURE statement
appears within an interface block. It is used when the specification
is generic and a specific procedure is defined within the module
rather than as an external procedure. The MODULE
PROCEDURE statement
only names the subprograms; it does not contain the definition of
the interface. The named subprograms must be defined within the
current module or within another module that is accessible by use
association.
Examples
MODULE path ! module data environment; module procedures contained in this ! module have access to this data environment REAL x, y, z ! Generic name substance for procedures air and water INTERFACE substance MODULE PROCEDURE air, water END INTERFACE INTERFACE OPERATOR (*) MODULE PROCEDURE rational_multiply END INTERFACE ... ! Module procedures are preceded by CONTAINS CONTAINS SUBROUTINE air (contents) ... END SUBROUTINE air SUBROUTINE water (x, a, z) ! x is a dummy argument, y is from the module data ! environment a = x + y ... END SUBROUTINE water FUNCTION rational_multiply (x, y) TYPE (rational) :: rational_multiply TYPE (rational), INTENT (IN) :: x, y rational_multiply = ... ... END FUNCTION rational_multiply END MODULE path |
Related statements
FUNCTION,
SUBROUTINE, and
INTERFACE
Related concepts
For information about module procedures, see “Module program unit”.