getSize_element Subroutine

private subroutine getSize_element(me, elemSize)

return the number of total allocated memory (bytes) per element

Arguments

Type IntentOptional Attributes Name
type(tem_element_type), intent(inout) :: me

element object

integer(kind=long_k), intent(out) :: elemSize

number of total entries to be returned


Called by

proc~~getsize_element~~CalledByGraph proc~getsize_element getSize_element interface~getsize getSize interface~getsize->proc~getsize_element

Source Code

  subroutine getSize_element( me, elemSize )
    ! ---------------------------------------------------------------------------
    !> element object
    type( tem_element_type ), intent(inout) :: me
    !> number of total entries to be returned
    integer(kind=long_k), intent(out) :: elemSize
    ! ---------------------------------------------------------------------------
    integer :: iVal, nSize
    ! ---------------------------------------------------------------------------
    elemSize = 0
    elemSize = elemSize + int( me%tID%containerSize*12, kind=long_k)
    elemSize = elemSize + int( me%property%containerSize*8, kind=long_k)
    elemSize = elemSize + int( me%eType%containerSize*4, kind=long_k)
    elemSize = elemSize + int( me%pntTID%containerSize*4, kind=long_k)

    do iVal = 1, me%stencil%nVals
      if( me%stencil%val( iVal )%nVals .gt. 0 ) then
        nSize = size( me%stencil%val( iVal )%val(1)%tIDpos )*8
      else
        nSize = 0
      end if
      elemSize = elemSize                                                      &
        &      + int( me%stencil%val( iVal )%containerSize*nSize, kind=long_k)
    end do

    do iVal = 1, me%neighID%nVals
      elemSize = elemSize                                                      &
        &      + int( me%neighID%val( iVal )%containerSize*12, kind=long_k)
    end do

    elemSize = elemSize + int( me%sourceProc%containerSize*4, kind=long_k)
    elemSize = elemSize + int( me%haloNesting%containerSize*4, kind=long_k)
    elemSize = elemSize + int( me%needsUpdate%containerSize*4, kind=long_k)

  end subroutine getSize_element