20 #include "sll_assert.h"
21 #include "sll_memory.h"
22 #include "sll_working_precision.h"
23 #include "sll_particle_representation.h"
53 rand_seed, rank, worldsize)
54 sll_real64,
intent(in) :: alpha, kx
56 sll_int32,
intent(in) :: num_particles
59 sll_int32 :: ncx, ic_x, ic_y
61 sll_real64 :: xmin, ymin, rdx, rdy
63 sll_real32 :: off_x, off_y
64 sll_real64 :: tmp1, tmp2
65 sll_int32,
dimension(:),
intent(in),
optional :: rand_seed
66 sll_int32,
optional :: rank, worldsize
70 if (
present(rand_seed))
then
71 call random_seed(put=rand_seed)
73 if (
present(worldsize))
then
74 weight = real((1.0 + alpha)*(m2d%eta1_max - m2d%eta1_min)* &
75 (m2d%eta2_max - m2d%eta2_min), f32)/real(worldsize*num_particles, f32)
77 weight = real((1.0 + alpha)*(m2d%eta1_max - m2d%eta1_min)* &
78 (m2d%eta2_max - m2d%eta2_min), f32)/real(num_particles, f32)
81 rdx = 1._f64/m2d%delta_eta1
82 rdy = 1._f64/m2d%delta_eta2
99 do while (j <= num_particles)
100 call random_number(x)
101 x = (m2d%eta1_max - xmin)*x + xmin
102 call random_number(y)
103 y = (m2d%eta2_max - ymin)*y + ymin
104 call random_number(z)
105 z = (2.0_f64 + 2.0_f64*alpha)*z
108 set_2dparticle_values(p_group%p_list(j), x, y, weight, xmin, ymin, ncx, ic_x, ic_y, off_x, off_y, rdx, rdy, tmp1, tmp2)
114 sll_assert(
present(rank))
123 rand_seed, rank, worldsize)
124 sll_real64,
intent(in) :: alpha, k
126 sll_int32,
intent(in) :: num_particles
129 sll_int32 :: ncx, ic_x, ic_y
130 sll_real64 :: x, y, xmin, ymin, rdx, rdy
132 sll_real32 :: off_x, off_y
133 sll_real64 :: tmp1, tmp2
134 sll_int32,
dimension(:),
intent(in),
optional :: rand_seed
135 sll_int32,
optional :: rank, worldsize
137 if (
present(rand_seed))
then
138 call random_seed(put=rand_seed)
141 if (
present(worldsize))
then
142 weight = real(m2d%eta1_max - m2d%eta1_min, f32)* &
143 real(m2d%eta2_max - m2d%eta2_min, f32)/ &
144 real(worldsize*num_particles, f32)
146 weight = real(m2d%eta1_max - m2d%eta1_min, f32)* &
147 real(m2d%eta2_max - m2d%eta2_min, f32)/ &
148 real(num_particles, f32)
150 rdx = 1._f64/m2d%delta_eta1
151 rdy = 1._f64/m2d%delta_eta2
157 do while (j <= num_particles)
158 call random_number(x)
159 x = (m2d%eta1_max - xmin)*x + xmin
160 call random_number(y)
161 y = (1._f64 + alpha)*y
163 call random_number(y)
164 y = (m2d%eta2_max - ymin)*y + ymin
165 set_2dparticle_values(p_group%p_list(j), x, y, weight, xmin, ymin, ncx, ic_x, ic_y, off_x, off_y, rdx, rdy, tmp1, tmp2)
171 sll_assert(
present(rank))
175 sll_real64 :: alp, kx, x
182 sll_real64 :: x, y, alp, kx
Cartesian mesh basic types.
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
hamm pseudo-random generator
real(kind=f64) function, public sll_f_suite_hamm(n, b)
subroutine, public sll_s_initial_random_particles_2d(alpha, k, m2d, num_particles, p_group, rand_seed, rank, worldsize)
real(kind=f64) function sll_f_eval_landau(alp, kx, x)
subroutine, public sll_s_initial_random_particles_2d_kh(alpha, kx, m2d, num_particles, p_group, rand_seed, rank, worldsize)
real(kind=f64) function sll_f_eval_kh(alp, kx, x, y)