I have an array e.g. A(3:7,4:8). So index starts from 3 / 4 and ends with 7 / 8. I would like to change it to A(43:47,44:48) without creating a new array and copying it. Is that possible? The array could be dynamically allocated ones. The values in the array will be changed so it doesn't matter if they are the same or not.
program arrayindex implicit none real, target :: rawA(5,5) real, pointer :: A(:,:) integer :: r,c do r=1,5 do c=1,5 rawA(c,r) = c*10+r end do end do A(3:7,4:8) => rawA print *, A A(43:47,44:48) => rawA print *,A end program arrayindex