(j3.2006) Disassociated array pointer actual argument corresponding to an optional argument of elemental procedure.
Mon Dec 8 15:38:25 EST 2014
On Mon, 2014-12-08 at 15:12 -0500, Daniel C Chen wrote:
> Is the following program standard conforming?
> integer, pointer :: p1(:)
> integer k
> call sub1(p1, k)
> impure elemental subroutine sub1(arg1, arg2)
> integer, intent(inout), optional :: arg1
> integer, intent(in) :: arg2
> end subroutine
> P1 is disassocated, but its extent is used to scalarize the elemental
> procedure call. Is this code standard conforming?
> The only thing I found that is sort of relevant in the standard is
> [188.8.131.52: p3: (6)]
> "An optional dummy argument that is not present is subject to the
> following restrictions.
> (6) If it is an array, it shall not be supplied as an actual argument
> to an elemental procedure unless an array of the same rank is supplied
> as an actual argument corresponding to a nonoptional dummy argument of
> that elemental procedure."
> Do we need something similar to this for the test case at the above?
I don't think we need something extra for this case, but item (6) ought
to be reworded to start with the absent dummy argument, and then work
backward to the actual arguments. Something like "(6) If it is an array
and the procedure is an elemental procedure, there shall be an array
actual argument of the same rank that corresponds to a nonoptional dummy
argument of that elemental procedure."
> XL Fortran Development - IBM Toronto Software Lab
> Phone: 905-413-3056
> Tie: 969-3056
> Email: cdchen at ca.ibm.com
> J3 mailing list
> J3 at mailman.j3-fortran.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the J3