arth_d Function

public function arth_d(first, increment, n)

Arguments

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

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


Called by

proc~~arth_d~~CalledByGraph proc~arth_d arth_d interface~arth arth interface~arth->proc~arth_d

Contents

Source Code


Source Code

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