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~~CallsGraph proc~set_neighbs set_neighbs proc~find_neighb find_neighb proc~set_neighbs->proc~find_neighb proc~mg_ix_to_ichild mg_ix_to_ichild proc~find_neighb->proc~mg_ix_to_ichild

Called by

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

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