buffer_for_fine_nb Subroutine

private subroutine buffer_for_fine_nb(mg, box, nc, iv, fine_id, fine_rank, nb, dry_run)

Arguments

Type IntentOptional Attributes Name
type(mg_t), intent(inout) :: mg
type(mg_box_t), intent(inout) :: box
integer, intent(in) :: nc
integer, intent(in) :: iv
integer, intent(in) :: fine_id
integer, intent(in) :: fine_rank
integer, intent(in) :: nb
logical, intent(in) :: dry_run

Calls

proc~~buffer_for_fine_nb~~CallsGraph proc~buffer_for_fine_nb buffer_for_fine_nb proc~box_gc_for_fine_neighbor box_gc_for_fine_neighbor proc~buffer_for_fine_nb->proc~box_gc_for_fine_neighbor proc~mg_get_child_offset mg_get_child_offset proc~buffer_for_fine_nb->proc~mg_get_child_offset

Called by

proc~~buffer_for_fine_nb~~CalledByGraph proc~buffer_for_fine_nb buffer_for_fine_nb proc~buffer_refinement_boundaries buffer_refinement_boundaries proc~buffer_refinement_boundaries->proc~buffer_for_fine_nb proc~mg_fill_ghost_cells_lvl mg_fill_ghost_cells_lvl proc~mg_fill_ghost_cells_lvl->proc~buffer_refinement_boundaries proc~mg_ghost_cell_buffer_size mg_ghost_cell_buffer_size proc~mg_ghost_cell_buffer_size->proc~buffer_refinement_boundaries proc~mg_allocate_storage mg_allocate_storage proc~mg_allocate_storage->proc~mg_ghost_cell_buffer_size proc~mg_fas_fmg mg_fas_fmg proc~mg_fas_fmg->proc~mg_fill_ghost_cells_lvl proc~mg_fas_vcycle mg_fas_vcycle proc~mg_fas_fmg->proc~mg_fas_vcycle proc~update_coarse update_coarse proc~mg_fas_fmg->proc~update_coarse proc~mg_fas_vcycle->proc~mg_fill_ghost_cells_lvl proc~smooth_boxes smooth_boxes proc~mg_fas_vcycle->proc~smooth_boxes proc~mg_fas_vcycle->proc~update_coarse proc~mg_fill_ghost_cells mg_fill_ghost_cells proc~mg_fill_ghost_cells->proc~mg_fill_ghost_cells_lvl proc~smooth_boxes->proc~mg_fill_ghost_cells_lvl proc~update_coarse->proc~mg_fill_ghost_cells_lvl proc~diffusion_solve diffusion_solve proc~diffusion_solve->proc~mg_fas_fmg proc~diffusion_solve->proc~mg_fas_vcycle proc~diffusion_solve_acoeff diffusion_solve_acoeff proc~diffusion_solve_acoeff->proc~mg_fas_fmg proc~diffusion_solve_acoeff->proc~mg_fas_vcycle proc~diffusion_solve_vcoeff diffusion_solve_vcoeff proc~diffusion_solve_vcoeff->proc~mg_fas_fmg proc~diffusion_solve_vcoeff->proc~mg_fas_vcycle

Source Code

  subroutine buffer_for_fine_nb(mg, box, nc, iv, fine_id, fine_rank, nb,&
      dry_run)
    type(mg_t), intent(inout)  :: mg
    type(mg_box_t), intent(inout) :: box
    integer, intent(in)        :: nc
    integer, intent(in)        :: iv
    integer, intent(in)        :: fine_id
    integer, intent(in)        :: fine_rank
    integer, intent(in)        :: nb
    logical, intent(in)        :: dry_run
    integer                    :: i, dsize, ix_offset(2)
    real(dp)                   :: gc(nc)

    i     = mg%buf(fine_rank)%i_send
    dsize = nc**(2-1)

    if (.not. dry_run) then
       ix_offset = mg_get_child_offset(mg, fine_id)
       call box_gc_for_fine_neighbor(box, nb, ix_offset, nc, iv, gc)
       mg%buf(fine_rank)%send(i+1:i+dsize) = pack(gc, .true.)
    end if

    ! Later the buffer is sorted, using the fact that loops go from low to high
    ! box id, and we fill ghost cells according to the neighbor order
    i = mg%buf(fine_rank)%i_ix
    if (.not. dry_run) then
       mg%buf(fine_rank)%ix(i+1) = mg_num_neighbors * fine_id + &
          mg_neighb_rev(nb)
    end if

    mg%buf(fine_rank)%i_send = mg%buf(fine_rank)%i_send + dsize
    mg%buf(fine_rank)%i_ix   = mg%buf(fine_rank)%i_ix + 1
  end subroutine buffer_for_fine_nb