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

Bill Long longb
Wed Sep 29 15:43:12 EDT 2010



Jim Xia wrote:
> 
> The standard says this
> 
> 
> 
> So does it mean sequence association is not allowed for coarray case. 
>  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'.   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.

Cheers,
Bill





> Is this intended to be disallowed, or is this an oversight?
> 
> 
> 
> 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
> 

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list