Size the backing pools for (Np,nVar,nElem) and remap the public arrays onto them at the exact logical shape. Bounds-remapping a rank-1 contiguous target to a rank-4 pointer is what keeps every extent and stride identical to a plain allocate while allowing the pool underneath to be larger and reused. See SELF_DataPool.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Scalar2D_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | Np | |||
| integer, | intent(in) | :: | nVar | |||
| integer, | intent(in) | :: | nElem |
subroutine MapArrays_Scalar2D_t(this,Np,nVar,nElem)
!! Size the backing pools for (Np,nVar,nElem) and remap the public arrays onto them at the
!! exact logical shape. Bounds-remapping a rank-1 contiguous target to a rank-4 pointer is
!! what keeps every extent and stride identical to a plain allocate while allowing the pool
!! underneath to be larger and reused. See SELF_DataPool.
implicit none
class(Scalar2D_t),intent(inout) :: this
integer,intent(in) :: Np
integer,intent(in) :: nVar
integer,intent(in) :: nElem
call EnsurePool(this%pool_interior,Np*Np*nElem*nVar)
call EnsurePool(this%pool_boundary,Np*4*nElem*nVar)
call EnsurePool(this%pool_extBoundary,Np*4*nElem*nVar)
call EnsurePool(this%pool_avgBoundary,Np*4*nElem*nVar)
call EnsurePool(this%pool_boundarynormal,Np*4*nElem*2*nVar)
this%interior(1:Np,1:Np,1:nElem,1:nVar) => this%pool_interior(1:Np*Np*nElem*nVar)
this%boundary(1:Np,1:4,1:nElem,1:nVar) => this%pool_boundary(1:Np*4*nElem*nVar)
this%extBoundary(1:Np,1:4,1:nElem,1:nVar) => this%pool_extBoundary(1:Np*4*nElem*nVar)
this%avgBoundary(1:Np,1:4,1:nElem,1:nVar) => this%pool_avgBoundary(1:Np*4*nElem*nVar)
this%boundarynormal(1:Np,1:4,1:nElem,1:2*nVar) => &
this%pool_boundarynormal(1:Np*4*nElem*2*nVar)
endsubroutine MapArrays_Scalar2D_t