fill in initial condition
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | igrid |
subroutine initial_condition(igrid) ! Need only to set the mesh values (can leave ghost cells untouched) use mod_usr_methods, only: usr_init_one_grid use mod_global_parameters use mod_geometry, only: sync_positions_host use mod_comm_lib, only: mpistop integer, intent(in) :: igrid ! usr_init_one_grid below reads ps(igrid)%x on the host, while alloc_node ! built this block's geometry on the device and left it there. The fetch ! belongs here rather than at each call site: every caller needs it, and a ! call site can be forgotten - refine_grids once was, so blocks created by ! refinement were initialised at whatever coordinates the previous occupant ! of that igrid slot had left in the host array. call sync_positions_host(igrid) ! in case gradient routine used in initial condition, ensure geometry known block=>ps(igrid) dxlevel(1)=rnode(rpdx1_,igrid);dxlevel(2)=rnode(rpdx2_,igrid) dxlevel(3)=rnode(rpdx3_,igrid); if (.not. associated(usr_init_one_grid)) then call mpistop("usr_init_one_grid not defined") else call usr_init_one_grid(ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,ixMlo1,& ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,ps(igrid)%w,ps(igrid)%x) end if ! only the machinery-carried variables (1:nwgc); any analytic extras past ! nwgc are device-resident from alloc_node and must not be clobbered by ! this host-to-device push end subroutine initial_condition