ResPart_set_UpdateLookup Subroutine

private 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

Type Bound

ResPart_set

Arguments

Type IntentOptional Attributes Name
class(ResPart_set), intent(inout) :: this

Set of resolved particles


Calls

proc~~respart_set_updatelookup~~CallsGraph proc~respart_set_updatelookup ResPart_set%ResPart_set_UpdateLookup particles particles proc~respart_set_updatelookup->particles

Called by

proc~~respart_set_updatelookup~~CalledByGraph proc~respart_set_updatelookup ResPart_set%ResPart_set_UpdateLookup proc~cdifs_obj_advancesolutionrp cdifs_obj_AdvanceSolutionRP proc~cdifs_obj_advancesolutionrp->proc~respart_set_updatelookup proc~respart_set_gethydroforces ResPart_set%ResPart_set_GetHydroForces proc~cdifs_obj_advancesolutionrp->proc~respart_set_gethydroforces proc~grans_obj_advancesolution grans_obj_AdvanceSolution proc~grans_obj_advancesolution->proc~respart_set_updatelookup proc~respart_set_gethydroforces->proc~respart_set_updatelookup proc~respart_set_readh5hut ResPart_set%ResPart_set_ReadH5HUT proc~respart_set_readh5hut->proc~respart_set_updatelookup proc~respart_set_readhdf5 ResPart_set%ResPart_set_ReadHDF5 proc~respart_set_readhdf5->proc~respart_set_updatelookup interface~grans_obj_advancesolution grans_obj%grans_obj_AdvanceSolution interface~grans_obj_advancesolution->proc~grans_obj_advancesolution proc~cdifs_obj_advancesolution cdifs_obj_AdvanceSolution proc~cdifs_obj_advancesolution->proc~cdifs_obj_advancesolutionrp interface~cdifs_obj_advancesolution cdifs_obj%cdifs_obj_AdvanceSolution interface~cdifs_obj_advancesolution->proc~cdifs_obj_advancesolution

Source Code

    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