reallocate_hv Function

public function reallocate_hv(p, n)

Arguments

Type IntentOptional AttributesName
character(len=1), DIMENSION(:), POINTER:: p
integer(kind=I4B), intent(in) :: n

Return Value character(len=1), DIMENSION(:),POINTER


Called by

proc~~reallocate_hv~~CalledByGraph proc~reallocate_hv reallocate_hv interface~reallocate reallocate interface~reallocate->proc~reallocate_hv

Contents

Source Code


Source Code

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