(j3.2006) (SC22WG5.4469) Question on CONTIGUOUS
Bader, Reinhold
Reinhold.Bader
Sun Jun 5 18:39:31 EDT 2011
Hello all,
Consider the following program:
module mod_cont
contains
subroutine fcont(x)
real, contiguous :: x(:)
integer :: i
x = (/ (real(i),i=1,size(x)) /)
end subroutine fcont
end module mod_cont
program cont
use mod_cont
implicit none
real :: x(45)
call fcont(x(1::3))
end program
Question: Does this program conform to the Fortran 2008 standard?
Reason: Of three compilers that accept the CONTIGUOUS attribute, one
rejects the above, and two accept it. Given 5.3.7 para 1 I would tend to
conclude that the code is invalid.
From a usability point of view I'd consider it a nice feature if the processor would
do the necessary copy-in/out if the actual argument is non-contiguous. If the code
is deemed invalid - why was it decided to not support this?
Regards
Reinhold
More information about the J3
mailing list