[J3] Co-array question
John Reid
John.Reid at stfc.ac.uk
Wed Aug 18 18:58:53 UTC 2021
Mark LeAir via J3 wrote:
>
> Hi,
>
> One of our engineers had the following questions about the co-arrays.
> Can someone from the list answer them?
>
> Does the following program constitute a violation of F2018 C949 (The
> declared type of /source-expr /shall not have a coarray ultimate
> component.)?
>
Seems clear enough that it does. OBJECT is of type TYPE which has a
coarray component.
>
> program main
>
> type :: type
>
> integer, allocatable :: coarray[:]
>
> end type
>
> type(type), save, target :: object
>
> class(*), allocatable :: allocatable
>
> allocate(object%coarray[*]);
>
> allocate(allocatable, source = object)
>
> end
>
> And is the following in violation of any constraint, or is it now a
> conforming program?
>
I think we have an omission here. I see no constraint that disallows it
but it should not be allowed.
> program main
>
> type :: type
>
> integer, allocatable :: coarray[:]
>
> end type
>
> type(type), save, target :: object
>
> class(*), pointer :: pointer
>
> class(*), allocatable :: allocatable
>
> allocate(object%coarray[*]);
>
> pointer => object
>
> allocate(allocatable, source = pointer)
>
> end
>
Cheers,
John.
More information about the J3
mailing list