Update [NeutralPopulation]] pop
at ind
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(NeutralPopulation), | intent(inout) | :: | pop | Neutral Population |
||
integer(kind=Int32), | intent(in), | dimension(3) | :: | ind | beam_grid indices |
|
real(kind=Float64), | intent(in), | dimension(3) | :: | vn | Neutral particle velocity [cm/s] |
|
real(kind=Float64), | intent(in), | dimension(:) | :: | dens | Neutral density [neutrals/cm^3] |
subroutine update_neutrals(pop, ind, vn, dens)
!+Update [NeutralPopulation]] `pop` at `ind`
type(NeutralPopulation), intent(inout) :: pop
!+ Neutral Population
integer(Int32), dimension(3), intent(in) :: ind
!+ [[libfida:beam_grid]] indices
real(Float64), dimension(3), intent(in) :: vn
!+ Neutral particle velocity [cm/s]
real(Float64), dimension(:), intent(in) :: dens
!+ Neutral density [neutrals/cm^3]
integer :: i, j, k
i = ind(1) ; j = ind(2) ; k = ind(3)
!$OMP CRITICAL(update_neutrals_1)
pop%dens(:,i,j,k) = pop%dens(:,i,j,k) + dens
!$OMP END CRITICAL(update_neutrals_1)
call update_reservoir(pop%res(i,j,k), vn, sum(dens))
end subroutine update_neutrals