Generate an array of normally-distributed random deviates
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=Float64), | intent(out), | dimension(:) | :: | randomn | Array of normal random deviates |
subroutine randn(randomn)
!+ Generate an array of normally-distributed random deviates
real(Float64), dimension(:), intent(out) :: randomn
!+ Array of normal random deviates
integer :: i, thread_id
#ifdef _OMP
thread_id = OMP_get_thread_num() + 1
#else
thread_id = 1
#endif
randomn = 0.d0
do i=1,size(randomn)
randomn(i) = rng_normal(rng(thread_id))
enddo
end subroutine randn