randu Subroutine

public subroutine randu(randomu)

Generate an array of uniformally-distributed random deviates

Arguments

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

Array of uniform random deviates


Calls

proc~~randu~~CallsGraph proc~randu randu proc~rng_uniform rng_uniform proc~randu->proc~rng_uniform omp_get_thread_num omp_get_thread_num proc~randu->omp_get_thread_num

Called by

proc~~randu~~CalledByGraph proc~randu randu proc~mc_halo mc_halo proc~mc_halo->proc~randu proc~bremsstrahlung bremsstrahlung proc~bremsstrahlung->proc~randu proc~fida_weights_mc fida_weights_mc proc~fida_weights_mc->proc~randu proc~gyro_correction gyro_correction proc~fida_weights_mc->proc~gyro_correction proc~ndmc ndmc proc~ndmc->proc~randu proc~mc_nbi mc_nbi proc~ndmc->proc~mc_nbi proc~mc_nbi->proc~randu proc~gyro_correction->proc~randu proc~read_chords read_chords proc~read_chords->proc~randu proc~npa_mc npa_mc proc~npa_mc->proc~randu proc~mc_fastion mc_fastion proc~mc_fastion->proc~randu proc~fida_mc fida_mc proc~fida_mc->proc~randu proc~fida_mc->proc~gyro_correction proc~dcx dcx proc~dcx->proc~mc_halo proc~fida_f fida_f proc~fida_f->proc~gyro_correction proc~fida_f->proc~mc_fastion proc~neutron_mc neutron_mc proc~neutron_mc->proc~gyro_correction proc~npa_f npa_f proc~npa_f->proc~mc_fastion proc~halo halo proc~halo->proc~mc_halo program~fidasim fidasim program~fidasim->proc~bremsstrahlung program~fidasim->proc~fida_weights_mc program~fidasim->proc~ndmc program~fidasim->proc~read_chords program~fidasim->proc~npa_mc program~fidasim->proc~fida_mc program~fidasim->proc~dcx program~fidasim->proc~fida_f program~fidasim->proc~neutron_mc program~fidasim->proc~npa_f program~fidasim->proc~halo proc~neutron_f neutron_f program~fidasim->proc~neutron_f proc~neutron_f->proc~gyro_correction

Contents

Source Code


Source Code

subroutine randu(randomu)
    !+ Generate an array of uniformally-distributed random deviates
    real(Float64), dimension(:), intent(out) :: randomu
        !+ Array of uniform random deviates

    integer :: i, thread_id

#ifdef _OMP
    thread_id = OMP_get_thread_num() + 1
#else
    thread_id = 1
#endif

    randomu = 0.d0
    do i=1,size(randomu)
        randomu(i) = rng_uniform(rng(thread_id))
    enddo

end subroutine randu