non-contiguous target error

Cesar Philippidis cesar_philippidis@mentor.com
Fri May 18 13:42:00 GMT 2018


On 05/18/2018 02:08 AM, Arjen Markus wrote:

>> I noticed that gfortran 8 now errors when contiguous pointers point
>> to non-explicitly contiguous targets. E.g.
>> 
>> program test implicit none real,pointer :: p1(:) 
>>  real,pointer,contiguous :: p2(:,:,:)
>> 
>>  allocate(p1(12))
>> 
>>  p2(1:2,1:2,1:2) => p1(4:) end program
>> 
>> This behavior seems to be too strict. Maybe it should be a
>> warning?
>> 
> 
> I do not have gfortran 8 available, so I cannot check my idea, but
> the array section p1(4:) is 9 elements long and the pointer p2 is 8
> elements. Could the error message come from that discrepancy?

Good point, but the program still fails when I allocate 20 elements for p1.

Cesar



More information about the Fortran mailing list