Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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