Passed-Object Dummy Arguments

A procedure component or a binding procedure (type-bound procedure) can be declared to have a passed-object dummy argument. This kind of argument is associated with a special actual argument, which is not explicitly written in the actual argument list. The appropriate actual argument is then added to the argument list.

A passed-object dummy argument must be a scalar. It must not be a pointer, must not be allocatable, and all its length type parameters must be assumed. Its declared type must be the type in which the component or binding procedure appears.

The determination of the passed-object dummy argument depends on the following:

The following rules apply to PASS and NOPASS:

The following shows an example of a passed-object dummy argument:

TYPE my_type
  INTEGER  :: count
  PROCEDURE(abs_iface),POINTER, PASS (me) :: proc_ptr
END TYPE
ABSTRACT INTERFACE
  SUBROUTINE abs_iface (da, me)
    IMPORT my_type
    REAL           :: da
    CLASS(my_type) :: me
  END SUBROUTINE
END INTERFACE
. . . 
TYPE (my_type) :: var
my_var => my_subroutine
CALL my_var%proc_ptr (100.0)

The above call statement is the same as CALL my_subroutine (100.0, var).

See Also