If a user-defined procedure is used in a context that requires it to be
pure, then its interface must be explicit in the scope of that use, and
that interface must specify the PURE attribute.
This attribute is specified in the function-stmt or
subroutine-stmt by an extension of rules R1217 (for prefix) and
R1220 (for subroutine-stmt) in the
Fortran 90 standard. Rule R1216 (for function-stmt) is
not changed, but is rewritten here as Rule
for clarity.
XBNF
prefix -to -rule
to
to is prefix-spec [ prefix-spec ] ...
prefix-spec -to -rule
to
to is type-spec
-to or RECURSIVE
-to or PURE
-to or extrinsic-prefix
function-stmt -to -rule
to
to is [ prefix ] FUNCTION function-name function-stuff
function-stuff -to -rule
to
to is ( [ dummy-arg-name-list ] ) [ RESULT ( result-name ) ]
subroutine-stmt -to -rule
to
to is [ prefix ] SUBROUTINE subroutine-name subroutine-stuff
subroutine-stuff -to -rule
to
to is [ ( [ dummy-arg-list ] ) ]
XBNF
(For a discussion of the extrinsic-prefix
(Rule
), see Section
.)
A procedure with the PURE attribute is referred to as a ``pure procedure'' in the following constraints.