[J3] Polymorphic dummy arrays

Vipul Parekh parekhvs at gmail.com
Mon Jan 7 17:57:05 EST 2019


On Mon, Jan 7, 2019 at 5:08 PM Steidel, Jon L via J3
<j3 at mailman.j3-fortran.org> wrote:
>
> Happy New Year,
>
>  .. But I cannot find a requirement that a dummy array of polymorphic objects must be assumed shape.  Can someone point me to those words?
> ..
> subroutine func(x)
> !  class(t), dimension(1:2), intent(out) :: x   ! original test
> class(t), dimension(:), intent(out) :: x           ! modified test.
> ..


Jon,

Happy New Year.

I wonder if the key aspect in the code you show is with INTENT(OUT) in
the dummy argument attribute:

You will know section 8.5.8.5 Assumed-size array in 18-007r1 has:

3 8.5.8.5 Assumed-size array
4 1 An assumed-size array is a dummy argument array whose size is
assumed from that of its effective argument, or
5 the associate name of a RANK ( * ) block in a SELECT RANK construct.
The rank and extents may differ for
6 the effective and dummy arguments; only the size of the effective
argument is assumed by the dummy argument.
7 A dummy argument is declared to be an assumed-size array by an
assumed-size-spec or an implied-shape-or8
assumed-size-spec.
9 R821 assumed-implied-spec is [ lower-bound : ] *
10 R822 assumed-size-spec is explicit-shape-spec-list, assumed-implied-spec
11 C833 An object whose array bounds are specified by an
assumed-size-spec shall be a dummy data object.
12 C834 An assumed-size array with the INTENT (OUT) attribute shall
not be polymorphic, finalizable, of a
13 type with an allocatable ultimate component, or of a type for which
default initialization is specified.

Note the constraint C834 above.

Best Regards,
Vipul


More information about the J3 mailing list