Identifies an intrinsic procedure.
Syntax
The syntax of the type declaration statement with the INTRINSIC attribute is:
type , attrib-list :: intrinsic-function-name-list |
- type
is a valid type specification (INTEGER, REAL, LOGICAL, CHARACTER, TYPE(name), etc.).
- attrib-list
is a comma-separated list of attributes including INTRINSIC and optionally those attributes compatible with
it, namely:
Table 10-30 Title not available (INTRINSIC (statement and attribute))
- intrinsic-function-name-list
is a comma-separated list of intrinsic-function-names. (Note that subroutine names cannot appear in
type statements, so that intrinsic subroutine names can only be
identified as such by use of the INTRINSIC statement, described below.)
The syntax of the INTRINSIC statement is:
INTRINSIC intrinsic-procedure-name-list |
where intrinsic-procedure-name-list is a comma-separated list of procedure names.
Note that, like the EXTERNAL statement, the INTRINSIC statement does not have optional colons.
Description
The INTRINSIC statement and attribute identifies a specific
or generic name as that of an intrinsic procedure, enabling it to
be used as an actual argument. (Only a specific function name—or
a generic name that is the same as the specific name—can
be used as an actual argument; see “Procedure
dummy argument”.) The INTRINSIC statement is necessary to inform the compiler
that a name is intrinsic and is not the name of a variable. Whenever
an intrinsic name is passed as an actual argument and no other appearance
of the name in the same scoping unit indicates that it is a procedure,
it must be specified by the calling program in an INTRINSIC statement, or (if a function name) in a type declaration statement
that includes the INTRINSIC attribute.
Each name
can appear only once in an INTRINSIC statement and in at most one INTRINSIC statement within the same scoping unit. Also,
a name cannot appear in both an EXTERNAL and an INTRINSIC statement within the same scoping unit.
Examples
SUBROUTINE subr ! caller DOUBLE PRECISION :: dsin,x,y,func INTRINSIC dsin ... y = func(dsin,x) ... END SUBROUTINE subr DOUBLE PRECISION FUNCTION func(proc,y) ! callee DOUBLE PRECISION :: y, proc ... func = proc(y) ... END FUNCTION func |
Related statements
EXTERNAL
Related concepts
For additional information about passing user-defined and
intrinsic procedures as arguments, see “Procedure
dummy argument”. Intrinsic procedures are described in “Intrinsic
procedure specifications”.