ranu Function

public function ranu(a, b) result(res)

uniformly sample in range[a, b)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a

lower bound

real(kind=wp), intent(in) :: b

upper bound

Return Value real(kind=wp)


Source Code

        function ranu(a, b) result(res)
        !! uniformly sample in range[a, b)

            real(kind=wp) :: res
            !> lower bound
            real(kind=wp), intent(IN) :: a
            !> upper bound
            real(kind=wp), intent(IN) :: b

            res = a + ran2() * (b - a)

        end function ranu