Intel® Fortran Compiler 16.0 User and Reference Guide

Dummy Procedure Arguments

If an actual argument is a procedure, its corresponding dummy argument is a dummy procedure. Dummy procedures can appear in function or subroutine subprograms.

The actual argument must be the specific name of an external, module, intrinsic, or another dummy procedure. If the specific name is also a generic name, only the specific name is associated with the dummy argument. Not all specific intrinsic procedures can appear as actual arguments. (For more information, see table Specific Functions Not Allowed as Actual Arguments in Intrinsic Procedures Overview.)

The actual argument and corresponding dummy procedure must both be subroutines or both be functions.

If the interface of the dummy procedure is explicit, the type and kind parameters, and rank of the associated actual procedure must be the same as that of the dummy procedure.

If the interface of the dummy procedure is implicit and the procedure is referenced as a subroutine, the actual argument must be a subroutine or a dummy procedure.

If the interface of the dummy procedure is implicit and the procedure is referenced as a function or is explicitly typed, the actual argument must be a function or a dummy procedure.

Dummy procedures can be declared optional, but they must not be declared with an intent.

The following is an example of a procedure used as an argument:

  REAL FUNCTION LGFUNC(BAR)
    INTERFACE
      REAL FUNCTION BAR(Y)
        REAL, INTENT(IN) :: Y
      END
    END INTERFACE
    ...
    LGFUNC = BAR(2.0)
    ...
  END FUNCTION LGFUNC

See Also