store_neutrals_cell Subroutine

public subroutine store_neutrals_cell(ind, neut_type, dens, store_iter)

Arguments

Type IntentOptional AttributesName
integer(kind=Int32), intent(in), dimension(3):: ind

beam_grid indices

integer, value:: neut_type

Neutral type

real(kind=Float64), intent(in), dimension(:):: dens

Neutral density [neutrals/cm^3]

logical, intent(in), optional :: store_iter

Store DCX/Halo iteration density in halo_iter_dens


Called by

proc~~store_neutrals_cell~~CalledByGraph proc~store_neutrals_cell store_neutrals_cell interface~store_neutrals store_neutrals interface~store_neutrals->proc~store_neutrals_cell proc~dcx dcx proc~dcx->interface~store_neutrals proc~ndmc ndmc proc~ndmc->interface~store_neutrals proc~halo halo proc~halo->interface~store_neutrals program~fidasim fidasim program~fidasim->proc~dcx program~fidasim->proc~ndmc program~fidasim->proc~halo

Contents

Source Code


Source Code

subroutine store_neutrals_cell(ind, neut_type, dens, store_iter)
    !Store neutrals in [[libfida:neut]] at indices `ind`
    integer(Int32), dimension(3), intent(in) :: ind
        !+ [[libfida:beam_grid]] indices
    integer, value                           :: neut_type
        !+ Neutral type
    real(Float64), dimension(:), intent(in)  :: dens
        !+ Neutral density [neutrals/cm^3]
    logical, intent(in), optional            :: store_iter
        !+ Store DCX/Halo iteration density in [[libfida:halo_iter_dens]]
    logical :: iter

    if(present(store_iter)) then
        iter = store_iter
    else
        iter = .False.
    endif

    !$OMP CRITICAL(store_neutrals_1)
    if(iter) halo_iter_dens(neut_type) = halo_iter_dens(neut_type) + sum(dens)
    neut%dens(:,neut_type,ind(1),ind(2),ind(3)) = &
        neut%dens(:,neut_type,ind(1),ind(2),ind(3))+dens ![neutrals/cm^3]
    !$OMP END CRITICAL(store_neutrals_1)

end subroutine store_neutrals_cell