Update lookup array -- The lookup array returns the local (MPI rank) index of a centroid when given the global ID of that centroid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ResPart_set), | intent(inout) | :: | this |
Set of resolved particles |
pure subroutine ResPart_set_UpdateLookup(this) !> Update lookup array -- The lookup array returns ! the local (MPI rank) index of a centroid when ! given the global ID of that centroid implicit none class(ResPart_set), intent(inout) :: this !! Set of resolved particles ! Work variables integer :: n ! Allocate global lookup array if (.not.allocated(this%lookup)) allocate(this%lookup(this%count)) if (size(this%lookup).ne. this%count) then deallocate(this%lookup) allocate(this%lookup(this%count)) end if ! Update array this%lookup(:)=0 select type (particles =>this%p) type is (ResPart_obj) do n=1,this%count_ this%lookup(particles(n)%id)=n end do end select return end subroutine ResPart_set_UpdateLookup