Merge NeutralPopulations
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(NeutralPopulation), | intent(inout) | :: | pop1 | Neutral Population target |
||
type(NeutralPopulation), | intent(inout) | :: | pop2 | Neutral Population to merge into target |
subroutine merge_neutral_populations(pop1, pop2)
!+ Merge [[NeutralPopulation]]s
type(NeutralPopulation), intent(inout) :: pop1
!+ Neutral Population target
type(NeutralPopulation), intent(inout) :: pop2
!+ Neutral Population to merge into target
integer :: i, j, k, ic, ind(3)
pop1%dens = pop1%dens + pop2%dens
do ic=1,beam_grid%ngrid
call ind2sub(beam_grid%dims,ic,ind)
i = ind(1) ; j = ind(2) ; k = ind(3)
call merge_reservoirs(pop1%res(i,j,k), pop2%res(i,j,k))
enddo
end subroutine merge_neutral_populations