Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_hammersley.F90
Go to the documentation of this file.
1 
6 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 #include "sll_memory.h"
8 #include "sll_working_precision.h"
9 
10  implicit none
11 
12  public :: &
14 
15  private
16 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17 
18 contains
19 
20 !! !> @brief Returns
21 !! !> @param[in]
22  function sll_f_suite_hamm(n, b)
23  sll_int32, intent(in) :: n
24  sll_int32, intent(in) :: b
25  sll_real64 :: sll_f_suite_hamm
26 
27  sll_int32 :: m, u
28  sll_real64 :: h, k
29 
30  k = 0.0_f64
31  h = 0.0_f64
32  m = n
33  do while (m > 0)
34  k = k + 1
35  u = m/b
36  h = h + b**(-k)*(m - u*b)
37  m = u
38  end do
40  end function sll_f_suite_hamm
41 
42  function vandercorput(n, p1, p2)! p1>p2 !
43  sll_int32, intent(in) :: n
44  sll_int32, intent(in) :: p1
45  sll_int32, intent(in) :: p2
46  sll_real64 :: vandercorput
47 
48  sll_real64 :: s
49  sll_int32 :: m
50 
51  m = n
52  vandercorput = 0._f64
53  s = 1.0_f64
54  do while (m > 0)
55  s = s/p1
56  vandercorput = vandercorput + s*real(mod(p2*mod(m, p1), p1), f64)
57  m = int(m/p1)
58  end do
59  end function vandercorput
60 
61 end module sll_m_hammersley
hamm pseudo-random generator
real(kind=f64) function, public sll_f_suite_hamm(n, b)
real(kind=f64) function vandercorput(n, p1, p2)
    Report Typos and Errors