arth_r Function

public function arth_r(first, increment, n)

Arguments

Type IntentOptional AttributesName
real(kind=SP), intent(in) :: first
real(kind=SP), intent(in) :: increment
integer(kind=I4B), intent(in) :: n

Return Value real(kind=SP), DIMENSION(n)


Called by

proc~~arth_r~~CalledByGraph proc~arth_r arth_r interface~arth arth interface~arth->proc~arth_r

Contents

Source Code


Source Code

	FUNCTION arth_r(first,increment,n)
	REAL(SP), INTENT(IN) :: first,increment
	INTEGER(I4B), INTENT(IN) :: n
	REAL(SP), DIMENSION(n) :: arth_r
	INTEGER(I4B) :: k,k2
	REAL(SP) :: temp
	if (n > 0) arth_r(1)=first
	if (n <= NPAR_ARTH) then
		do k=2,n
			arth_r(k)=arth_r(k-1)+increment
		end do
	else
		do k=2,NPAR2_ARTH
			arth_r(k)=arth_r(k-1)+increment
		end do
		temp=increment*NPAR2_ARTH
		k=NPAR2_ARTH
		do
			if (k >= n) exit
			k2=k+k
			arth_r(k+1:min(k2,n))=temp+arth_r(1:min(k,n-k))
			temp=temp+temp
			k=k2
		end do
	end if
	END FUNCTION arth_r