init_reservoir Subroutine

public subroutine init_reservoir(res)

Initialize reservoir

Arguments

TypeIntentOptionalAttributesName
type(NeutralParticleReservoir), intent(inout) :: res

Neutral Particle Reservoir

Size of reservoir


Calls

proc~~init_reservoir~~CallsGraph proc~init_reservoir init_reservoir interface~randu randu proc~init_reservoir->interface~randu

Called by

proc~~init_reservoir~~CalledByGraph proc~init_reservoir init_reservoir proc~npr_assign npr_assign proc~npr_assign->proc~init_reservoir proc~merge_reservoirs merge_reservoirs proc~merge_reservoirs->proc~init_reservoir proc~update_reservoir update_reservoir proc~merge_reservoirs->proc~update_reservoir proc~update_reservoir->proc~init_reservoir proc~parallel_merge_reservoirs parallel_merge_reservoirs proc~parallel_merge_reservoirs->proc~init_reservoir proc~parallel_merge_reservoirs->proc~merge_reservoirs proc~read_neutral_population read_neutral_population proc~read_neutral_population->proc~init_reservoir proc~read_neutrals read_neutrals proc~read_neutrals->proc~read_neutral_population proc~np_assign np_assign proc~np_assign->proc~npr_assign interface~assignment(=) assignment(=) interface~assignment(=)->proc~npr_assign interface~assignment(=)->proc~np_assign proc~merge_neutral_populations merge_neutral_populations proc~merge_neutral_populations->proc~merge_reservoirs proc~dcx dcx proc~dcx->proc~parallel_merge_reservoirs proc~parallel_merge_populations parallel_merge_populations proc~dcx->proc~parallel_merge_populations proc~store_photon_birth store_photon_birth proc~dcx->proc~store_photon_birth proc~store_neutrals store_neutrals proc~dcx->proc~store_neutrals proc~fida_f fida_f proc~fida_f->proc~parallel_merge_reservoirs proc~fida_f->proc~store_photon_birth proc~fida_mc fida_mc proc~fida_mc->proc~parallel_merge_reservoirs proc~fida_mc->proc~store_photon_birth proc~pfida_f pfida_f proc~pfida_f->proc~parallel_merge_reservoirs proc~pfida_f->proc~store_photon_birth proc~update_neutrals update_neutrals proc~update_neutrals->proc~update_reservoir proc~halo halo proc~halo->proc~parallel_merge_reservoirs proc~halo->proc~merge_neutral_populations proc~halo->proc~update_neutrals proc~halo->proc~parallel_merge_populations proc~halo->proc~store_photon_birth proc~pfida_mc pfida_mc proc~pfida_mc->proc~parallel_merge_reservoirs proc~pfida_mc->proc~store_photon_birth proc~parallel_merge_populations->proc~parallel_merge_reservoirs proc~store_photon_birth->proc~update_reservoir program~fidasim fidasim program~fidasim->proc~read_neutrals program~fidasim->proc~dcx program~fidasim->proc~fida_f program~fidasim->proc~fida_mc program~fidasim->proc~pfida_f program~fidasim->proc~halo program~fidasim->proc~pfida_mc proc~ndmc ndmc program~fidasim->proc~ndmc proc~store_neutrals->proc~update_neutrals proc~ndmc->proc~parallel_merge_populations proc~ndmc->proc~store_neutrals

Contents

Source Code


Source Code

subroutine init_reservoir(res)
    !+ Initialize reservoir
    type(NeutralParticleReservoir), intent(inout) :: res
        !+ Neutral Particle Reservoir
    !integer, intent(in) :: k
        !+ Size of reservoir

    real(Float64) :: randomu(2)

    if (res%n.lt.1) then
        res%n = 1
        res%k = reservoir_size
        call randu(randomu)
        res%W = exp(log(randomu(1))/res%k)
        res%i = res%k + floor(log(randomu(2))/log(1.0-res%W)) + 1
    endif

end subroutine init_reservoir