reallocate_iv Function

public function reallocate_iv(p, n)

Arguments

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

Return Value integer(kind=I4B), DIMENSION(:),POINTER


Called by

proc~~reallocate_iv~~CalledByGraph proc~reallocate_iv reallocate_iv interface~reallocate reallocate interface~reallocate->proc~reallocate_iv

Contents

Source Code


Source Code

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