set_neighbs Subroutine

private subroutine set_neighbs(boxes, id)

Arguments

Type IntentOptional Attributes Name
type(mg_box_t), intent(inout) :: boxes(:)
integer, intent(in) :: id

Calls

proc~~set_neighbs~2~~CallsGraph proc~set_neighbs~2 set_neighbs proc~find_neighb~2 find_neighb proc~set_neighbs~2->proc~find_neighb~2 proc~mg_ix_to_ichild~2 mg_ix_to_ichild proc~find_neighb~2->proc~mg_ix_to_ichild~2

Called by

proc~~set_neighbs~2~~CalledByGraph proc~set_neighbs~2 set_neighbs proc~mg_set_neighbors_lvl~2 mg_set_neighbors_lvl proc~mg_set_neighbors_lvl~2->proc~set_neighbs~2 proc~mg_build_rectangle~2 mg_build_rectangle proc~mg_build_rectangle~2->proc~mg_set_neighbors_lvl~2

Source Code

  subroutine set_neighbs(boxes, id)
    type(mg_box_t), intent(inout) :: boxes(:)
    integer, intent(in)         :: id
    integer                     :: nb, nb_id

    do nb = 1, mg_num_neighbors
       if (boxes(id)%neighbors(nb) == mg_no_box) then
          nb_id = find_neighb(boxes, id, nb)
          if (nb_id > mg_no_box) then
             boxes(id)%neighbors(nb) = nb_id
             boxes(nb_id)%neighbors(mg_neighb_rev(nb)) = id
          end if
       end if
    end do
  end subroutine set_neighbs