Hello Whether 'Allocatable' and 'Pointer' can be mutually used. I understand Pointer denotes to the memory address only, but Allocatable allocates the physical memory to contain the values. WIth pointer definition, where the contents (user_defined values) goes.
I also noticed that there no difference between these two under the following situation. In
Module M1
contains
subroutine passtoSub(s)
real, pointer :: s(:)
s(1) = 10.0
!assign values here
end subroutine passtoSub
end module
program main
use M1
real , allocatable,save :: myarray(:)
allocate myarray(10)
call passtoSub(myarray)
print*, (myarray(I),I=1,ubound(myarray,1))
end program main
This works fine, but how the datas of myarray in Main and Subroutine handled as this code serves the purpose. Just want to understand more on this.