merge_neutral_populations Subroutine

public subroutine merge_neutral_populations(pop1, pop2)

Merge NeutralPopulations

Arguments

TypeIntentOptionalAttributesName
type(NeutralPopulation), intent(inout) :: pop1

Neutral Population target

type(NeutralPopulation), intent(inout) :: pop2

Neutral Population to merge into target


Calls

proc~~merge_neutral_populations~~CallsGraph proc~merge_neutral_populations merge_neutral_populations proc~ind2sub ind2sub proc~merge_neutral_populations->proc~ind2sub proc~merge_reservoirs merge_reservoirs proc~merge_neutral_populations->proc~merge_reservoirs proc~init_reservoir init_reservoir proc~merge_reservoirs->proc~init_reservoir proc~update_reservoir update_reservoir proc~merge_reservoirs->proc~update_reservoir float float proc~merge_reservoirs->float interface~randu randu proc~merge_reservoirs->interface~randu proc~init_reservoir->interface~randu proc~update_reservoir->proc~init_reservoir proc~update_reservoir->interface~randu interface~randind randind proc~update_reservoir->interface~randind

Called by

proc~~merge_neutral_populations~~CalledByGraph proc~merge_neutral_populations merge_neutral_populations proc~halo halo proc~halo->proc~merge_neutral_populations program~fidasim fidasim program~fidasim->proc~halo

Contents


Source Code

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