I found it odd that deallocated pointers still have their shape information, even though "associated" returns .false. I suppose I expected to get an error, or at least zeroes. Is there a good reason for this behavior? Perhaps it makes sense but I can't see how.
program test_alloc implicit none integer, pointer :: perms(:,:)=>null() print*,"associated",associated(perms) print*,"shape",shape(perms) allocate(perms(3,5)) print*,"associated",associated(perms) print*,"shape",shape(perms) deallocate(perms) print*,"associated",associated(perms) print*,"shape",shape(perms) perms=>null() print*,"associated",associated(perms) print*,"shape",shape(perms) end program test_alloc
associated F shape 0 0 associated T shape 3 5 associated F shape 3 5 associated F shape 3 5