reallocate_im Function

public function reallocate_im(p, n, m)

Arguments

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

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


Called by

proc~~reallocate_im~~CalledByGraph proc~reallocate_im reallocate_im interface~reallocate reallocate interface~reallocate->proc~reallocate_im

Contents

Source Code


Source Code

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