Skip to content

Commit 9a5abde

Browse files
committed
Use dp instead wp
Signed-off-by: Igor S. Gerasimov <foxtranigor@gmail.com>
1 parent 1705354 commit 9a5abde

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/random_generators.f90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
! along with xtb. If not, see <https://www.gnu.org/licenses/>.
1717

1818
module random_generators
19-
use xtb_mctc_accuracy, only: sp, wp
19+
use xtb_mctc_accuracy, only: sp, dp
2020

2121
implicit none
2222

2323
private
2424

2525
interface normal_distribution
2626
module procedure normal_distribution_sp
27-
module procedure normal_distribution_wp
27+
module procedure normal_distribution_dp
2828
end interface normal_distribution
2929

3030
public normal_distribution
@@ -61,18 +61,18 @@ end function normal_distribution_sp
6161
!> @param[in] sigma standard deviation
6262
!> @param[in] mu mean of distribution
6363
!> @return pseudorandom value
64-
real(wp) function normal_distribution_wp(sigma, mu) result(randval)
65-
real(wp), intent(in) :: sigma, mu
66-
real(wp), parameter :: two_pi = 2.0_wp * 4.0_wp * atan(1.0_wp)
67-
real(wp) :: u(2), mag
64+
real(dp) function normal_distribution_dp(sigma, mu) result(randval)
65+
real(dp), intent(in) :: sigma, mu
66+
real(dp), parameter :: two_pi = 2.0_dp * 4.0_dp * atan(1.0_dp)
67+
real(dp) :: u(2), mag
6868

69-
u = 0.0_wp
70-
do while (u(1) == 0.0_wp)
69+
u = 0.0_dp
70+
do while (u(1) == 0.0_dp)
7171
call random_number(u)
7272
end do
73-
mag = sigma * sqrt(-2.0_wp * log(u(1)))
73+
mag = sigma * sqrt(-2.0_dp * log(u(1)))
7474
randval = mag * cos(two_pi * u(2)) + mu
7575

76-
end function normal_distribution_wp
76+
end function normal_distribution_dp
7777

7878
end module random_generators

0 commit comments

Comments
 (0)