randn Subroutine

public subroutine randn(randomn)

Generate an array of normally-distributed random deviates

Arguments

Type IntentOptional AttributesName
real(kind=Float64), intent(out), dimension(:):: randomn

Array of normal random deviates


Calls

proc~~randn~~CallsGraph proc~randn randn omp_get_thread_num omp_get_thread_num proc~randn->omp_get_thread_num proc~rng_normal rng_normal proc~randn->proc~rng_normal proc~rng_uniform rng_uniform proc~rng_normal->proc~rng_uniform

Called by

proc~~randn~~CalledByGraph proc~randn randn proc~mc_nbi mc_nbi proc~mc_nbi->proc~randn proc~mc_halo mc_halo proc~mc_halo->proc~randn proc~dcx dcx proc~dcx->proc~mc_halo proc~ndmc ndmc proc~ndmc->proc~mc_nbi proc~halo halo proc~halo->proc~mc_halo program~fidasim fidasim program~fidasim->proc~dcx program~fidasim->proc~ndmc program~fidasim->proc~halo

Contents

Source Code


Source Code

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