Execute the contiguous sub-range eFirst..eLast of a transfer plan: uNew(:,:,:,k,:) receives the data of new element eFirst+k-1. uOld is the full (global) old field; the output is only the requested slice. This is the gather-then-slice (AMR Stage-5 v1) decomposed-mesh entry point: each rank passes its own contiguous range of the new element ordering and a gathered global old solution, and fills exactly its rank-local storage. ApplyTransferPlanWindow is the point-to-point (v2) entry point, which needs only the sub-range of the old field the requested new range actually references; this routine is that one over the whole old field, so the two are bit-identical by construction rather than by inspection.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(TransferPlan3D), | intent(in) | :: | plan | |||
| type(Lagrange), | intent(in) | :: | interp | |||
| integer, | intent(in) | :: | nVar | |||
| real(kind=prec), | intent(in) | :: | uOld(1:interp%N+1,1:interp%N+1,1:interp%N+1,1:plan%nOld,1:nVar) | |||
| integer, | intent(in) | :: | eFirst | |||
| integer, | intent(in) | :: | eLast | |||
| real(kind=prec), | intent(out) | :: | uNew(1:interp%N+1,1:interp%N+1,1:interp%N+1,1:eLast-eFirst+1,1:nVar) |
subroutine ApplyTransferPlanRange(plan,interp,nVar,uOld,eFirst,eLast,uNew)
!! Execute the contiguous sub-range eFirst..eLast of a transfer plan: uNew(:,:,:,k,:)
!! receives the data of new element eFirst+k-1. uOld is the full (global) old field; the
!! output is only the requested slice. This is the gather-then-slice (AMR Stage-5 v1)
!! decomposed-mesh entry point: each rank passes its own contiguous range of the new
!! element ordering and a gathered global old solution, and fills exactly its rank-local
!! storage. ApplyTransferPlanWindow is the point-to-point (v2) entry point, which needs
!! only the sub-range of the old field the requested new range actually references; this
!! routine is that one over the whole old field, so the two are bit-identical by
!! construction rather than by inspection.
implicit none
type(TransferPlan3D),intent(in) :: plan
type(Lagrange),intent(in) :: interp
integer,intent(in) :: nVar
real(prec),intent(in) :: uOld(1:interp%N+1,1:interp%N+1,1:interp%N+1,1:plan%nOld,1:nVar)
integer,intent(in) :: eFirst
integer,intent(in) :: eLast
real(prec),intent(out) :: uNew(1:interp%N+1,1:interp%N+1,1:interp%N+1,1:eLast-eFirst+1,1:nVar)
call ApplyTransferPlanWindow(plan,interp,nVar,uOld,1,plan%nOld,eFirst,eLast,uNew)
endsubroutine ApplyTransferPlanRange