neutral_cx_rate Subroutine

public subroutine neutral_cx_rate(denn, res, v_ion, rates)

Get probability of a thermal ion charge exchanging with neutral population within cell

Arguments

TypeIntentOptionalAttributesName
real(kind=Float64), intent(in), dimension(nlevs):: denn

Neutral density

type(NeutralParticleReservoir), intent(in) :: res

Neutral Particle Reservoir

real(kind=Float64), intent(in), dimension(3):: v_ion

Ion velocity [cm/s]

real(kind=Float64), intent(out), dimension(nlevs):: rates

Total charge exchange rate [1/s]


Calls

proc~~neutral_cx_rate~~CallsGraph proc~neutral_cx_rate neutral_cx_rate proc~bb_cx_rates bb_cx_rates proc~neutral_cx_rate->proc~bb_cx_rates interface~interpol_coeff interpol_coeff proc~bb_cx_rates->interface~interpol_coeff

Called by

proc~~neutral_cx_rate~~CalledByGraph proc~neutral_cx_rate neutral_cx_rate proc~get_total_cx_rate get_total_cx_rate proc~get_total_cx_rate->proc~neutral_cx_rate proc~halo halo proc~halo->proc~neutral_cx_rate program~fidasim fidasim program~fidasim->proc~halo proc~dcx dcx program~fidasim->proc~dcx proc~fida_f fida_f program~fidasim->proc~fida_f proc~npa_mc npa_mc program~fidasim->proc~npa_mc proc~fida_weights_mc fida_weights_mc program~fidasim->proc~fida_weights_mc proc~npa_f npa_f program~fidasim->proc~npa_f proc~npa_weights npa_weights program~fidasim->proc~npa_weights proc~fida_mc fida_mc program~fidasim->proc~fida_mc proc~dcx->proc~get_total_cx_rate proc~fida_f->proc~get_total_cx_rate proc~npa_mc->proc~get_total_cx_rate proc~fida_weights_mc->proc~get_total_cx_rate proc~npa_f->proc~get_total_cx_rate proc~npa_weights->proc~get_total_cx_rate proc~fida_mc->proc~get_total_cx_rate

Contents

Source Code


Source Code

subroutine neutral_cx_rate(denn, res, v_ion, rates)
    !+ Get probability of a thermal ion charge exchanging with neutral
    !+ population within cell
    real(Float64), dimension(nlevs), intent(in)  :: denn
        !+ Neutral density
    type(NeutralParticleReservoir), intent(in)   :: res
        !+ Neutral Particle Reservoir
    real(Float64), dimension(3), intent(in)      :: v_ion
        !+ Ion velocity [cm/s]
    real(Float64), dimension(nlevs), intent(out) :: rates
        !+ Total charge exchange rate [1/s]

    integer :: i
    real(Float64), dimension(nlevs) :: rates_i
    real(Float64) :: vn(3), totw

    !! Average CX rate over Reservoir
    rates = 0.d0
    if(res%n.eq.0) return

    totw = sum(res%R%w)
    if(totw.eq.0.d0) return

    do i=1, min(res%n,res%k)
        vn = res%R(i)%v
        call bb_cx_rates(denn,vn,v_ion,rates_i)
        rates = rates + res%R(i)%w*rates_i
    enddo
    rates = rates/totw

end subroutine neutral_cx_rate