tem_stencil_map_toTreelmDef Subroutine

public subroutine tem_stencil_map_toTreelmDef(me)

Map the stencil offsets to the internally defined treelm offsets.

Arguments

Type IntentOptional Attributes Name
type(tem_stencilHeader_type) :: me

stencil to map


Called by

proc~~tem_stencil_map_totreelmdef~~CalledByGraph proc~tem_stencil_map_totreelmdef tem_stencil_map_toTreelmDef proc~tem_init_elemlevels tem_init_elemLevels proc~tem_init_elemlevels->proc~tem_stencil_map_totreelmdef proc~tem_create_leveldesc tem_create_levelDesc proc~tem_create_leveldesc->proc~tem_init_elemlevels proc~tem_dimbydim_construction tem_dimByDim_construction proc~tem_dimbydim_construction->proc~tem_create_leveldesc proc~tem_build_face_info tem_build_face_info proc~tem_build_face_info->proc~tem_dimbydim_construction

Source Code

  subroutine tem_stencil_map_toTreelmDef( me )
    ! -------------------------------------------------------------------- !
    !> stencil to map
    type(tem_stencilHeader_type) :: me
    ! -------------------------------------------------------------------- !
    ! counters
    integer :: iQQQ, iDir
    ! -------------------------------------------------------------------- !

    if ( allocated(me%map) ) deallocate(me%map)

    allocate( me%map(me%QQ) )
    me%map = 0

    do iDir = 1,me%QQ

      if ( maxval( abs( me%cxDir(:,iDir) ) ) <= 1 ) then

        ! Now match the stencil offset with the treelm definition offsets
        qqqLoop: do iQQQ=1,qQQQ
          if ( me%cxDir(1, iDir) == qOffset(iQQQ, 1)      &
            & .and. me%cxDir(2, iDir) == qOffset(iQQQ, 2) &
            & .and. me%cxDir(3, iDir) == qOffset(iQQQ, 3) ) then
            me%map( iDir ) = iQQQ
            exit qqqLoop
          end if
        end do qqqLoop

      end if

    end do ! iDir = 1, QQ

  end subroutine tem_stencil_map_toTreelmDef