If Compiler A is the one I think it is, I filed a bug with them in January, 2012 for this problem. The issue with them is still open.
As John noted, Compiler B is correct. They syntax rules that cover this are R908 and R909.
Cheers,
Bill
> On May 1, 2018, at 7:58 AM, Anton Shterenlikht <[log in to unmask]> wrote:
>
> For coarrays of DT, components follow the image selector,
> as in X[...]%...
>
> For array coarrays, the array section precedes the image
> selector, as in X(... : ... )[...].
>
> What about coarray substrings?
> Does the substring spec appear
> before or after the image selector?
> Can somebody point me to the relevant place in DIS please.
>
> If I put the substring before the image selector:
>
> character( len=2 ) a[*]
> if ( this_image() .eq. 1 ) a(2:2)[2] = 'Z'
> a(1:1) = "X"
> end
>
> compiler A accepts, compiler B rejects with:
>
> Unknown statement. Expected assignment statement but found "[" instead of "=" or "=>".
>
> If I put the other way round:
>
> character( len=2 ) a[*]
> if ( this_image() .eq. 1 ) a[2](2:2) = 'Z'
> a(1:1) = "X"
> end
>
> then compiler B accpepts, but A rejects with:
>
> Syntax error, found '(' when expecting one of: => = . %
>
> Thanks
>
> Anton
Bill Long [log in to unmask]
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
|