ApplyTransferPlan_DGModel2D_t Subroutine

public subroutine ApplyTransferPlan_DGModel2D_t(this, plan, interp, eFirst, eLast, uGlobal)

Transfer the staged pre-regrid solution onto the regridded mesh through plan, filling the rank-local element range [eFirst,eLast] of the new solution.

uGlobal is optional and supplies the GLOBAL old field when the caller has already assembled one (the multi-rank allgather path); when absent the locally staged copy from StageSolutionForTransfer is used, which is the whole field on a single rank.

This base implementation runs the portable host transfer and uploads the result; the GPU backend overrides it to run the transfer on the device with no host traffic.

Arguments

TypeIntentOptionalAttributesName
class(DGModel2D_t), intent(inout) :: this
type(TransferPlan2D), intent(in), target:: plan
type(Lagrange), intent(in) :: interp
integer, intent(in) :: eFirst
integer, intent(in) :: eLast
real(kind=prec), intent(in), optional :: uGlobal(:,:,:,:)

Calls

proc~~applytransferplan_dgmodel2d_t~~CallsGraph proc~applytransferplan_dgmodel2d_t ApplyTransferPlan_DGModel2D_t proc~applytransferplanrange ApplyTransferPlanRange proc~applytransferplan_dgmodel2d_t->proc~applytransferplanrange proc~restrictfromchildren RestrictFromChildren proc~applytransferplanrange->proc~restrictfromchildren proc~prolongtochildren ProlongToChildren proc~applytransferplanrange->proc~prolongtochildren tmp tmp proc~restrictfromchildren->tmp up up proc~restrictfromchildren->up proc~prolongtochildren->tmp

Called by

proc~~applytransferplan_dgmodel2d_t~~CalledByGraph proc~applytransferplan_dgmodel2d_t ApplyTransferPlan_DGModel2D_t proc~applytransferplan_dgmodel2d ApplyTransferPlan_DGModel2D proc~applytransferplan_dgmodel2d->proc~applytransferplan_dgmodel2d_t

Contents


Source Code

  subroutine ApplyTransferPlan_DGModel2D_t(this,plan,interp,eFirst,eLast,uGlobal)
    !! Transfer the staged pre-regrid solution onto the regridded mesh through plan, filling the
    !! rank-local element range [eFirst,eLast] of the new solution.
    !!
    !! uGlobal is optional and supplies the GLOBAL old field when the caller has already
    !! assembled one (the multi-rank allgather path); when absent the locally staged copy from
    !! StageSolutionForTransfer is used, which is the whole field on a single rank.
    !!
    !! This base implementation runs the portable host transfer and uploads the result; the GPU
    !! backend overrides it to run the transfer on the device with no host traffic.
    implicit none
    class(DGModel2D_t),intent(inout) :: this
    ! target: the GPU override takes c_loc of the plan's arrays to upload them, which requires
    ! the POINTER or TARGET attribute. Declared here too so the override's characteristics match.
    type(TransferPlan2D),intent(in),target :: plan
    type(Lagrange),intent(in) :: interp
    integer,intent(in) :: eFirst
    integer,intent(in) :: eLast
    real(prec),intent(in),optional :: uGlobal(:,:,:,:)

    if(present(uGlobal)) then
      call ApplyTransferPlanRange(plan,interp,this%nvar,uGlobal,eFirst,eLast, &
                                  this%solution%interior)
    else
      if(.not. allocated(this%transferStage)) then
        print*,__FILE__,':',__LINE__, &
          ' : Error : ApplyTransferPlan called without a staged solution.'
        stop 1
      endif
      call ApplyTransferPlanRange(plan,interp,this%nvar,this%transferStage,eFirst,eLast, &
                                  this%solution%interior)
    endif

    call this%solution%UpdateDevice()

    if(allocated(this%transferStage)) deallocate(this%transferStage)

  endsubroutine ApplyTransferPlan_DGModel2D_t