forked from open-atmos/PyPartMC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrand.F90
33 lines (22 loc) · 955 Bytes
/
rand.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
!###################################################################################################
! This file is a part of PyPartMC licensed under the GNU General Public License v3 (LICENSE file) #
! Copyright (C) 2022 University of Illinois Urbana-Champaign #
! Authors: https://github.com/open-atmos/PyPartMC/graphs/contributors #
!###################################################################################################
module PyPartMC_rand
use iso_c_binding
use pmc_rand
implicit none
contains
subroutine f_pmc_srand(seed) bind(C)
integer(c_int) :: seed
integer(c_int) :: offset = 0 ! MPI not used
call pmc_srand(seed, offset)
end subroutine
subroutine f_rand_normal(mean, stddev, val) bind(C)
real(c_double) :: mean
real(c_double) :: stddev
real(c_double) :: val
val = rand_normal(mean, stddev)
end subroutine
end module