Defines how to assign NeutralPopulation to eachother
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(NeutralPopulation), | intent(inout) | :: | n1 | |||
type(NeutralPopulation), | intent(in) | :: | n2 |
subroutine np_assign(n1, n2)
!+ Defines how to assign [[NeutralPopulation]] to eachother
type(NeutralPopulation), intent(in) :: n2
type(NeutralPopulation), intent(inout) :: n1
integer :: i, j, k, ic, ind(3), nx, ny, nz
if(.not.allocated(n1%dens)) then
nx = size(n2%dens,2); ny = size(n2%dens,3); nz = size(n2%dens,4)
allocate(n1%dens(nlevs,nx,ny,nz), source=n2%dens)
else
n1%dens = n2%dens
endif
do ic=1,beam_grid%ngrid
call ind2sub(beam_grid%dims,ic,ind)
i = ind(1) ; j = ind(2) ; k = ind(3)
if (n2%res(i,j,k)%n.ne.0) then
call npr_assign(n1%res(i,j,k), n2%res(i,j,k))
endif
enddo
end subroutine np_assign