reallocate_rv Function

public function reallocate_rv(p, n)

Arguments

Type IntentOptional AttributesName
real(kind=SP), DIMENSION(:), POINTER:: p
integer(kind=I4B), intent(in) :: n

Return Value real(kind=SP), DIMENSION(:),POINTER


Called by

proc~~reallocate_rv~~CalledByGraph proc~reallocate_rv reallocate_rv interface~reallocate reallocate interface~reallocate->proc~reallocate_rv

Contents

Source Code


Source Code

	FUNCTION reallocate_rv(p,n)
	REAL(SP), DIMENSION(:), POINTER :: p, reallocate_rv
	INTEGER(I4B), INTENT(IN) :: n
	INTEGER(I4B) :: nold,ierr
	allocate(reallocate_rv(n),stat=ierr)
	if (ierr /= 0) call &
		nrerror('reallocate_rv: problem in attempt to allocate memory')
	if (.not. associated(p)) RETURN
	nold=size(p)
	reallocate_rv(1:min(nold,n))=p(1:min(nold,n))
	deallocate(p)
	END FUNCTION reallocate_rv