Hey, guys, trying to learn "Pointers as aliases", here.
I am wanting to do some cshift-ing on one dimension of 3 dimensional array that has been over-allocated due to capacity needs in a parallel dimension.
Here is what I have in mind:
But, when I try to compile, I get the following error:
What am I not understanding?
A lesson, please.
Germán
I am wanting to do some cshift-ing on one dimension of 3 dimensional array that has been over-allocated due to capacity needs in a parallel dimension.
Here is what I have in mind:
Code:
program sub
integer , allocatable , dimension(:,:,:) :: strandPos
integer , dimension(:,:), pointer :: stacks
allocate( strandPos(2, 10, 30) )
strandPos = 0
stacks => strandPos(1,1:8,1:20)
write(*,*) stacks
end program sub
But, when I try to compile, I get the following error:
Code:
In file sub.f90:8
stacks => strandPos(1,1:8,1:20)
1
Error: Pointer assignment target is neither TARGET nor POINTER at (1)
What am I not understanding?
A lesson, please.
Germán