Copy from multigrid tree with one layer of ghost cells. Corner ghost cells are not used/set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | iw_from |
Variable to use as right-hand side |
||
| integer, | intent(in) | :: | iw_to |
Copy to this variable |
||
| type(state), | intent(inout), | optional, | target | :: | state_to(max_blocks) |
If present, use this as the output state |
subroutine mg_copy_from_tree_gc(iw_from, iw_to, state_to) use mod_global_parameters use mod_forest integer, intent(in) :: iw_from !< Variable to use as right-hand side integer, intent(in) :: iw_to !< Copy to this variable !> If present, use this as the output state type(state), intent(inout), optional, target :: state_to(max_blocks) integer :: iigrid, igrid, id integer :: nc, lvl, ilo1,ilo2,ilo3, ihi1,ihi2,ihi3 type(tree_node), pointer :: pnode if (.not. mg%is_allocated) error stop "mg_copy_from_tree_gc: tree not allocated yet" ilo1=ixMlo1-1;ilo2=ixMlo2-1;ilo3=ixMlo3-1; ihi1=ixMhi1+1;ihi2=ixMhi2+1;ihi3=ixMhi3+1; do iigrid = 1, igridstail igrid = igrids(iigrid); pnode => igrid_to_node(igrid, mype)%node id = pnode%id lvl = mg%boxes(id)%lvl nc = mg%box_size_lvl(lvl) if (present(state_to)) then state_to(igrid)%w(ilo1:ihi1,ilo2:ihi2,ilo3:ihi3,& iw_to) = mg%boxes(id)%cc(0:nc+1,0:nc+1,0:nc+1, iw_from) else ps(igrid)%w(ilo1:ihi1,ilo2:ihi2,ilo3:ihi3,& iw_to) = mg%boxes(id)%cc(0:nc+1,0:nc+1,0:nc+1, iw_from) end if end do end subroutine mg_copy_from_tree_gc