refine one block to its children blocks
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | dimension(2,2,2) | :: | child_igrid | ||
| integer, | intent(in), | dimension(2,2,2) | :: | child_ipe | ||
| integer, | intent(in) | :: | igrid | |||
| integer, | intent(in) | :: | ipe | |||
| logical, | intent(in) | :: | active |
subroutine refine_grids(child_igrid,child_ipe,igrid,ipe,active) use mod_global_parameters use mod_initialize_amr, only: initial_condition use mod_amr_solution_node, only: alloc_node, dealloc_node integer, dimension(2,2,2), intent(in) :: child_igrid, child_ipe integer, intent(in) :: igrid, ipe logical, intent(in) :: active integer :: ic1,ic2,ic3 ! allocate solution space for new children do ic3=1,2 do ic2=1,2 do ic1=1,2 call alloc_node(child_igrid(ic1,ic2,ic3)) end do end do end do if ((time_advance .and. active).or.convert.or.reset_grid) then ! prolong igrid to new children call prolong_grid(child_igrid,child_ipe,igrid,ipe) else ! Fill new created children with initial condition, which fetches each ! child's positions back from the device itself. do ic3=1,2 do ic2=1,2 do ic1=1,2 call initial_condition(child_igrid(ic1,ic2,ic3)) end do end do end do end if ! remove solution space of igrid to save memory when converting data if(convert) call dealloc_node(igrid) end subroutine refine_grids