m_spread Subroutine

public subroutine m_spread(n, m_max, sigma_tot, sigma)

Spreads the total charge exchange cross section, sigma_tot, among the non-filled m states of sigma according to an exponential

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: n

Initial atomic energy level/state

integer, intent(in) :: m_max

Number of m states in sigma

real(kind=Float64), intent(in) :: sigma_tot

Amount of "cross section" to spread about the non-filled m state of sigma

real(kind=Float64), intent(inout), dimension(m_max):: sigma

Array of cross sections from the n state to m=1..m_max []


Called by

proc~~m_spread~~CalledByGraph proc~m_spread m_spread proc~p_cx_n p_cx_n proc~p_cx_n->proc~m_spread proc~p_cx_2 p_cx_2 proc~p_cx_n->proc~p_cx_2 proc~p_cx_3 p_cx_3 proc~p_cx_n->proc~p_cx_3 proc~p_cx_2->proc~m_spread proc~p_cx_3->proc~m_spread proc~p_cx p_cx proc~p_cx->proc~p_cx_n proc~p_cx_n_m p_cx_n_m proc~p_cx_n_m->proc~p_cx_n proc~write_bb_h_h write_bb_H_H proc~write_bb_h_h->proc~p_cx program~generate_tables generate_tables program~generate_tables->proc~write_bb_h_h

Contents

Source Code


Source Code

subroutine m_spread(n, m_max, sigma_tot, sigma)
    !+ Spreads the total charge exchange cross section, `sigma_tot`,
    !+ among the non-filled m states of `sigma` according to an exponential
    integer, intent(in)                            :: n
        !+ Initial atomic energy level/state
    integer, intent(in)                            :: m_max
        !+ Number of m states in `sigma`
    real(Float64), intent(in)                      :: sigma_tot
        !+ Amount of "cross section" to spread about the non-filled m state of sigma
    real(Float64), dimension(m_max), intent(inout) :: sigma
        !+ Array of cross sections from the `n` state to m=1..`m_max` [\(cm^2\)]
    real(Float64) :: En, Em
    real(Float64) :: norm_fac
    real(Float64), dimension(m_max) :: sigma_m
    integer :: m

    sigma_m = 0.d0
    En = 13.6/(real(n)**2.0)
    do m=1,m_max
        Em = 13.6/(real(m)**2.0)
        if(sigma(m).eq.0.d0) then
            sigma_m(m) = (sigma_tot/sqrt(2.0*PI))*exp(-0.5*(En-Em)**2.0)
        endif
    enddo

    norm_fac = sigma_tot/sum(sigma_m)
    do m=1,m_max
        if(sigma(m).eq.0.d0) sigma(m) = sigma_m(m)*norm_fac
        if(sigma(m).ne.sigma(m)) sigma(m) = 0.d0
    enddo

end subroutine m_spread