> On Mar 7, 2018, at 11:08 AM, Anton Shterenlikht <[log in to unmask]> wrote:
>
> The following program seems to be conforming in F2008 and F2018:
>
Iām not so sure. In the argument association rules in the standard (15.5.2.6 Allocatable dummy variables, para 3) I see that for a dummy argument that is allocatable, we require:
ā The corank of the actual argument shall be the same as that of the dummy argument.ā
This prevents the procedure from allocating or deallocating a dummy that is not a coarray when the actual is a coarray.
Cheers,
Bill
> module m
> contains
> subroutine s( a )
> integer, intent(inout), allocatable :: a(:)
> if (.not. allocated(a) ) error stop
> end subroutine s
> end module m
>
> program p
> use m
> integer, allocatable :: i(:)[:,:,:]
> call s( i )
> end program p
>
> However, is there any way for a procedure to find
> out whether the passed variable is a coarray or a non-coarray?
>
> 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
|