[J3] Question on dummy CLASS(*) pointer arguments

Vipul Parekh parekhvs at gmail.com
Wed Nov 29 18:07:15 UTC 2023


On Wed, Nov 29, 2023 at 12:46 PM Clune, Thomas L. (GSFC-6101) via J3 <
j3 at mailman.j3-fortran.org> wrote:

> ..
>
> This is disallowed by the standard, presumably because the pointer array x
> could become associated with some other type.   However, since the dummy
> pointer has the INTENT(IN) attribute, I do not immediately see what could
> go wrong.   Is it simply that processors may want to have different
> representations for POINTER objects that we don’t want to force the
> conversion here?* ..*
>

Go figure!

It will be interesting to read of the replies and the follow-up to this by
the committee, if any!  Especially because you can do (and work around) by
the following:

   real, pointer :: x(:)
   class(*), pointer :: p(:)
   ..
   p => x
   call s( p )
   ..
contains
   subroutine s(a)
      class(*), pointer, intent(in) :: a(:)
      ..
   end subroutine s
end

Regards,
Vipul Parekh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20231129/badd7f85/attachment.htm>


More information about the J3 mailing list