update_buffer_elemPos Subroutine

private subroutine update_buffer_elemPos(buffer, levelDesc, iError)

Update the position of the elements inside the buffers from the original tID list to the later totalList

Arguments

Type IntentOptional Attributes Name
type(tem_communication_type), intent(inout) :: buffer

communication buffer

type(tem_levelDesc_type), intent(in) :: levelDesc

levelDesc to be used

integer, intent(out) :: iError

return encountered error


Calls

proc~~update_buffer_elempos~~CallsGraph proc~update_buffer_elempos update_buffer_elemPos proc~tem_treeidintotal tem_treeIDinTotal proc~update_buffer_elempos->proc~tem_treeidintotal proc~tem_etypeofid tem_eTypeOfId proc~tem_treeidintotal->proc~tem_etypeofid tem_positioninsorted tem_positioninsorted proc~tem_treeidintotal->tem_positioninsorted interface~positionofval~5 positionofval proc~tem_etypeofid->interface~positionofval~5 proc~posofval_label posofval_label interface~positionofval~5->proc~posofval_label

Called by

proc~~update_buffer_elempos~~CalledByGraph proc~update_buffer_elempos update_buffer_elemPos proc~update_elempostototalpos update_elemPosToTotalPos proc~update_elempostototalpos->proc~update_buffer_elempos proc~tem_find_allelements tem_find_allElements proc~tem_find_allelements->proc~update_elempostototalpos proc~tem_create_leveldesc tem_create_levelDesc proc~tem_create_leveldesc->proc~tem_find_allelements proc~tem_dimbydim_construction tem_dimByDim_construction proc~tem_dimbydim_construction->proc~tem_create_leveldesc

Source Code

  subroutine update_buffer_elemPos( buffer, levelDesc, iError )
    ! ---------------------------------------------------------------------------
    !> communication buffer
    type(tem_communication_type), intent(inout) :: buffer
    !> levelDesc to be used
    type(tem_levelDesc_type), intent(in) :: levelDesc
    !> return encountered error
    integer, intent(out) :: iError
    ! ---------------------------------------------------------------------------
    integer :: iElem, iProc, elemPos, iVal
    ! ---------------------------------------------------------------------------
    iError = 0
    do iProc = 1, buffer%nProcs
      do iElem = 1, buffer%elemPos( iProc )%nVals
        elemPos = buffer%elemPos( iProc )%val( iElem )
        ! replace buffer elemPos from levelDesc%elem%tID list to
        ! levelDesc%total list
        buffer%elemPos( iProc )%val( iElem ) =                                 &
          &   tem_treeIDinTotal( tID       = levelDesc%elem%tID%val( elemPos ),&
          &                      eType     = levelDesc%elem%eType%val(elemPos),&
          &                      levelDesc = levelDesc )

        if( buffer%elemPos( iProc )%val( iElem ) < 1 ) then
          write(dbgUnit(2),*) ' tID ', levelDesc%elem%tID%val(elemPos),        &
            &                ' in buffer not found'
          iError = iProc*10000000+iElem
          do iVal = 1, levelDesc%elem%tID%nVals
            if( levelDesc%elem%tID%val( iVal ) == levelDesc%elem%tID%          &
              &                                            val( elemPos )) then
              write(dbgUnit(2),*)'found at', iVal
            end if
          end do
          do iVal = 1, size(levelDesc%total)
            if( levelDesc%total( iVal ) == levelDesc%elem%tID%val( elemPos )) &
              & write(dbgUnit(2),*) 'found in total at', iVal
          end do
        end if ! if elemPos < 1

      end do !iElem
    end do !iProc

  end subroutine update_buffer_elemPos