get_total_cx_rate Subroutine

public subroutine get_total_cx_rate(ind, pos, v_ion, types, rate_tot)

Get probability of a thermal ion charge exchanging with types neutrals

Arguments

TypeIntentOptionalAttributesName
integer(kind=Int32), intent(in), dimension(3):: ind

beam_grid indices

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

Interaction position in beam grid coordinates

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

Ion velocity [cm/s]

integer(kind=Int32), intent(in), dimension(:):: types

Neutral types

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

Total charge exchange rate [1/s]


Calls

proc~~get_total_cx_rate~~CallsGraph proc~get_total_cx_rate get_total_cx_rate proc~neutral_cx_rate neutral_cx_rate proc~get_total_cx_rate->proc~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~~get_total_cx_rate~~CalledByGraph proc~get_total_cx_rate get_total_cx_rate proc~dcx dcx proc~dcx->proc~get_total_cx_rate proc~fida_f fida_f proc~fida_f->proc~get_total_cx_rate proc~npa_mc npa_mc proc~npa_mc->proc~get_total_cx_rate proc~fida_weights_mc fida_weights_mc proc~fida_weights_mc->proc~get_total_cx_rate proc~npa_f npa_f proc~npa_f->proc~get_total_cx_rate proc~npa_weights npa_weights proc~npa_weights->proc~get_total_cx_rate proc~fida_mc fida_mc proc~fida_mc->proc~get_total_cx_rate program~fidasim fidasim program~fidasim->proc~dcx program~fidasim->proc~fida_f program~fidasim->proc~npa_mc program~fidasim->proc~fida_weights_mc program~fidasim->proc~npa_f program~fidasim->proc~npa_weights program~fidasim->proc~fida_mc

Contents

Source Code


Source Code

subroutine get_total_cx_rate(ind, pos, v_ion, types, rate_tot)
    !+ Get probability of a thermal ion charge exchanging with `types` neutrals
    integer(Int32), dimension(3), intent(in)     :: ind
        !+ [[libfida:beam_grid]] indices
    real(Float64), dimension(3), intent(in)      :: pos
        !+ Interaction position in beam grid coordinates
    real(Float64), dimension(3), intent(in)      :: v_ion
        !+ Ion velocity [cm/s]
    integer(Int32), dimension(:), intent(in)     :: types
        !+ Neutral types
    real(Float64), dimension(nlevs), intent(out) :: rate_tot
        !+ Total charge exchange rate [1/s]

    integer :: n, i, j, k, ii
    type(LocalProfiles) :: plasma
    type(NeutralParticleReservoir) :: res
    real(Float64), dimension(nlevs) :: rates, denn
    real(Float64), dimension(3) :: vn

    n = size(types)

    rate_tot = 0.0
    i = ind(1) ; j = ind(2) ; k = ind(3)
    do ii=1,n
        select case (types(ii))
            case (nbif_type)
                denn = neut%full%dens(:,i,j,k)
                res = neut%full%res(i,j,k)
            case (nbih_type)
                denn = neut%half%dens(:,i,j,k)
                res = neut%half%res(i,j,k)
            case (nbit_type)
                denn = neut%third%dens(:,i,j,k)
                res = neut%third%res(i,j,k)
            case (dcx_type)
                denn = neut%dcx%dens(:,i,j,k)
                res = neut%dcx%res(i,j,k)
            case (halo_type)
                denn = neut%halo%dens(:,i,j,k)
                res = neut%halo%res(i,j,k)
        end select
        call neutral_cx_rate(denn, res, v_ion, rates)
        rate_tot = rate_tot + rates
    enddo

end subroutine get_total_cx_rate