reallocate_rm Function

public function reallocate_rm(p, n, m)

Arguments

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

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


Called by

proc~~reallocate_rm~~CalledByGraph proc~reallocate_rm reallocate_rm interface~reallocate reallocate interface~reallocate->proc~reallocate_rm

Contents

Source Code


Source Code

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