References to Specific Names
In a scoping unit, a procedure name is established to be specific if it is not established to be generic and any of the following is true:
- The scoping unit contains an interface body with that procedure name.
- The scoping unit contains an internal procedure, module procedure, or statement function with that procedure name.
- The procedure name is the same as the name of a generic intrinsic procedure, and it is specified with the INTRINSIC attribute in that scoping unit.
- The procedure name is specified with the EXTERNAL attribute in that scoping unit.
- The procedure name is established to be specific in a module, and the scoping unit contains a USE statement making that procedure name accessible.
- The scoping unit contains no declarations for that procedure name, but the procedure name is established to be specific in a host scoping unit.
To resolve a reference to a procedure name established to be specific, the following rules are used in the order shown:
- If either of the following is true, the dummy argument is a dummy procedure and the reference is to that dummy procedure:
- The scoping unit is a subprogram, and it contains an interface body with that procedure name.
- The procedure name has been declared EXTERNAL, and the procedure name is a dummy argument of that subprogram.
The procedure invoked by the reference is the one supplied as the corresponding actual argument.
- If the scoping unit contains an interface body or the procedure name has been declared EXTERNAL, and Rule 1 does not apply, the reference is to an external procedure with that name.
- If the scoping unit contains an internal procedure or statement function with that procedure name, the reference is to that entity.
- If the procedure name has been declared INTRINSIC in the scoping unit, the reference is to the intrinsic procedure with that name.
- If the scoping unit contains a USE statement that makes the name of a module procedure accessible, the reference is to that procedure. (The USE statement allows renaming, so the name referenced may differ from the name of the module procedure.)
- If none of the preceding rules apply, the reference is resolved by applying these rules to the host scoping unit.