We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee633d7 commit 7ba7baaCopy full SHA for 7ba7baa
src/pre_process/m_perturbation.fpp
@@ -261,13 +261,14 @@ contains
261
! Generate a random unit vector (spherical distribution)
262
function f_unit_vector(theta, eta) result(vec)
263
real(wp), intent(in) :: theta, eta
264
+ real(wp) :: zeta, xi
265
real(wp), dimension(3) :: vec
266
- theta = 2.0_wp*pi*theta
267
- eta = acos(2.0_wp*eta - 1.0_wp)
268
- vec(1) = sin(eta)*cos(theta)
269
- vec(2) = sin(eta)*sin(theta)
270
- vec(3) = cos(eta)
+ xi = 2.0_wp*pi*theta
+ zeta = acos(2.0_wp*eta - 1.0_wp)
+ vec(1) = sin(zeta)*cos(xi)
+ vec(2) = sin(zeta)*sin(xi)
271
+ vec(3) = cos(zeta)
272
273
end function f_unit_vector
274
0 commit comments