I am getting failure in my program on copying array. I have written test that simulates call hierarchy of my program. It fails either. I am not sure, if it is is totally language-correct. But it doesn’t look wrong. The program fails with access violation error on call to s2 subroutine, when array copy performed. What is wrong? The fortran source or pgi generated machine code?
tested on pvf 13.10 on win 7.
subroutine s2(A) real :: A(:) print*, 'size=', size(A) end subroutine s1(P1) real, pointer :: P1(:,:,:,:) print*, 'size=', size(P1(1,1,:,1)) call s2(P1(1,1,:,1)) end program pr real, allocatable, target:: R(:,:,:,:) real, pointer :: P(:,:,:,:) allocate(R(3,4,5,6)) P => R call s1(P) end