Allocate level descriptor and initilize its variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_levelDesc_type), | intent(out), | allocatable | :: | me(:) | ||
integer, | intent(in) | :: | minLevel | |||
integer, | intent(in) | :: | maxLevel | |||
integer, | intent(in) | :: | initlen | |||
integer, | intent(in) | :: | nStencils |
subroutine tem_alloc_levelDesc( me, minLevel, maxLevel, initlen, nStencils )
! ---------------------------------------------------------------------------
type(tem_levelDesc_type), allocatable, intent(out) :: me(:)
integer, intent(in) :: minLevel, maxLevel, initlen, nStencils
! ---------------------------------------------------------------------------
integer :: iLevel
! ---------------------------------------------------------------------------
write(logUnit(5),*) 'Allocating level Descriptor ...'
allocate( me(minLevel:maxLevel) )
me(minLevel:maxLevel)%nElems = 0
! Initial length for the element array
! We don't know how many elements there will be per level, just using
! the average here as a starting point. This should at least for single
! level meshes reduce the number of expands, we need to do.
! Giving a small space for additional elements (ghosts and halos, might
! avoid immidiate doubling, for elements beyond the fluids).
! initialize dynamic require array for requireNeighNeigh
! and element type
write(logUnit(7),*) 'Initializing elemList, require and neigh array'
do iLevel = minLevel, maxLevel
call init( me = me( iLevel )%require )
call init( me = me( iLevel )%elem, length = initlen )
! For each of the neighbor lists create the horizontal (neighbor)
! relations of the size of the total number of stencils used in this
! scheme
allocate( me( iLevel )%neigh( nStencils ) )
end do
end subroutine tem_alloc_levelDesc