(j3.2006) is sequence association allowed for coarray dummy

Jim Xia jimxia
Wed Sep 29 16:13:07 EDT 2010


j3-bounces at j3-fortran.org wrote on 09/29/2010 03:43:12 PM:

> Jim Xia wrote:
> > 
> >  Consider the following case
> > 
> > interface
> >     subroutine sub (x)
> >         real x(10)[*]
> >     end subroutine
> > end interface
> > ...
> > real, save :: x(100)[*]
> > ...
> > call sub (x(10)) !<--x(10) is not simply contiguous
> > 
> 
> The standard also says that if the dummy argument is a coarray, the 
> corresponding actual argument has to be a coarray.  I don't think that 
> x(10) qualifies as a 'coarray'. 


Hmm..., are you saying the example given in NOTE 12.29 is illegal?

Then, how do you interp this paragraph from 2.4.7





                                        But, suppose it were allowed. Then 

> consider this case (same interface for sub and declaration for X as 
above)
> 
> 
> subroutine sub1(y)
>     real y(:)[*]
>     call sub(y(10))
> end
> 
> call sub1 (x(1:10:2))
> 
> The sequence formed by the elements of Y in sub1 are not contiguous in 
> memory.  The underlying point of many of these restrictions is to avoid 
> copy-in/copy-out for a coarray-coarray argument association.

I'm not debating whether copy-in/copy-out should be allowed, in fact I 
think the current rules are fine except for the example I've send out. 
That's a particular case in sequence association where the actual argument 
is NOT required to be an array designator.  We simply missed that case in 
defining the rules.  In my opinion we should allow this.

Cheers,

Jim Xia

XL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444  Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM

http://www.ibm.com/software/awdtools/fortran/xlfortran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20100929/9c5280ae/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 4244 bytes
Desc: not available
URL: <http://j3-fortran.org/pipermail/j3/attachments/20100929/9c5280ae/attachment-0001.gif>



More information about the J3 mailing list