USER_PROBLEM: Update functions for random numbers.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
f2f19201aa
commit
112a4dac27
@ -111,7 +111,7 @@ module user_problem
|
||||
use equations , only : magnetized, csnd, csnd2
|
||||
use helpers , only : print_section, print_parameter
|
||||
use parameters , only : get_parameter
|
||||
use random , only : randomu, randomn
|
||||
use random , only : randuni, randsym
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
@ -296,9 +296,9 @@ module user_problem
|
||||
!
|
||||
fc = 1.0d+00 / sqrt(1.0d+00 * nper)
|
||||
do n = 1, nper
|
||||
thh = pi2 * randomu()
|
||||
thh = pi2 * randuni()
|
||||
#if NDIMS == 3
|
||||
thv = pi * randomn()
|
||||
thv = pi * randsym()
|
||||
ux(n) = cos(thh) * cos(thv)
|
||||
uy(n) = sin(thh) * cos(thv)
|
||||
uz(n) = sin(thv)
|
||||
@ -307,8 +307,8 @@ module user_problem
|
||||
kz(n) = pi2 * kper * uz(n)
|
||||
tt = 0.0d+00
|
||||
do while(tt == 0.0d+00)
|
||||
thh = pi2 * randomu()
|
||||
thv = pi * randomn()
|
||||
thh = pi2 * randuni()
|
||||
thv = pi * randsym()
|
||||
tx = cos(thh) * cos(thv)
|
||||
ty = sin(thh) * cos(thv)
|
||||
tz = sin(thv)
|
||||
@ -328,7 +328,7 @@ module user_problem
|
||||
uy(n) = fc * cos(thh)
|
||||
uz(n) = 0.0d+00
|
||||
#endif /* NDIMS == 3 */
|
||||
ph(n) = pi2 * randomu()
|
||||
ph(n) = pi2 * randuni()
|
||||
end do
|
||||
|
||||
end if ! status
|
||||
@ -460,7 +460,7 @@ module user_problem
|
||||
use equations , only : idn, ivx, ivy, ivz, ipr, ibx, iby, ibz, ibp
|
||||
use equations , only : csnd2
|
||||
use operators , only : curl
|
||||
use random , only : randomn, randomu
|
||||
use random , only : randsym
|
||||
|
||||
! local variables are not implicit by default
|
||||
!
|
||||
@ -593,10 +593,10 @@ module user_problem
|
||||
!
|
||||
vv = 0.0d+00
|
||||
do while(vv == 0.0d+00)
|
||||
vx = randomn()
|
||||
vy = randomn()
|
||||
vx = randsym()
|
||||
vy = randsym()
|
||||
#if NDIMS == 3
|
||||
vz = randomn()
|
||||
vz = randsym()
|
||||
#endif /* NDIMS == 3 */
|
||||
|
||||
#if NDIMS == 3
|
||||
@ -649,10 +649,10 @@ module user_problem
|
||||
pp = 0.0d+00
|
||||
do while(pp == 0.0d+00)
|
||||
#if NDIMS == 3
|
||||
px = randomn()
|
||||
py = randomn()
|
||||
px = randsym()
|
||||
py = randsym()
|
||||
#endif /* NDIMS == 3 */
|
||||
pz = randomn()
|
||||
pz = randsym()
|
||||
|
||||
#if NDIMS == 3
|
||||
pp = sqrt(px * px + py * py + pz * pz)
|
||||
|
Loading…
x
Reference in New Issue
Block a user