Skip to content

Commit 7ba7baa

Browse files
author
Hyeoksu Lee
committed
fix minor
1 parent ee633d7 commit 7ba7baa

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/pre_process/m_perturbation.fpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,14 @@ contains
261261
! Generate a random unit vector (spherical distribution)
262262
function f_unit_vector(theta, eta) result(vec)
263263
real(wp), intent(in) :: theta, eta
264+
real(wp) :: zeta, xi
264265
real(wp), dimension(3) :: vec
265266

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)
267+
xi = 2.0_wp*pi*theta
268+
zeta = acos(2.0_wp*eta - 1.0_wp)
269+
vec(1) = sin(zeta)*cos(xi)
270+
vec(2) = sin(zeta)*sin(xi)
271+
vec(3) = cos(zeta)
271272

272273
end function f_unit_vector
273274

0 commit comments

Comments
 (0)