arth_i Function

public function arth_i(first, increment, n)

Arguments

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

Return Value integer(kind=I4B), DIMENSION(n)


Called by

proc~~arth_i~~CalledByGraph proc~arth_i arth_i proc~upper_triangle upper_triangle proc~upper_triangle->proc~arth_i interface~arth arth interface~arth->proc~arth_i proc~lower_triangle lower_triangle proc~lower_triangle->proc~arth_i

Contents

Source Code


Source Code

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