PROGRAM INDICES
INTEGER, POINTER, DIMENSION(:) :: a, b
ALLOCATE(a(0:1))
a(0) = 1
a(1) = 2
b => a
WRITE(*,*) LBOUND(b,1) !__ = 0
WRITE(*,*) UBOUND(b,1) !__ = 1
WRITE(*,*)
b => a(:)
WRITE(*,*) LBOUND(b,1) !__ = 1
WRITE(*,*) UBOUND(b,1) !__ = 2
END PROGRAM INDICES
Apparently, the boundaries of indices are only kept if I do not specify (:). Though, this makes it impossible for me to work with parts of a large array (e.g. x => y(:,:,:, j)) since all the indices get shifted to start from 1. Is there any way to have a pointer to a subfield without shifting the boundaries of indices? Or do i have to allocate another array for that?
Thanks
Dino