Link
"The section (5.2.3) of the F2008 standard referring to the implicit SAVE attribute does not distinguish between the cases of POINTER or not-POINTER."
If in my program (subroutines or functions) I have local pointer variables like
which would be allocated at the initial part of the routine or
pointed to other pointers or
targets or
module procedures
I should not initialize the local pointer variable with => null()?
Or it is different for module procedures or etc.
"The section (5.2.3) of the F2008 standard referring to the implicit SAVE attribute does not distinguish between the cases of POINTER or not-POINTER."
If in my program (subroutines or functions) I have local pointer variables like
Code:
real function f(v)
real, dimension(:), intent(in) :: v
!local variables
real, dimension(:), pointer :: ke => null()
integer :: n
!
n=size(v,1)
allocate(ke(n))
!make a copy
ke=v
!do some computation ...
end function f
which would be allocated at the initial part of the routine or
pointed to other pointers or
targets or
module procedures
I should not initialize the local pointer variable with => null()?
Or it is different for module procedures or etc.