Get ghost cells for a fine neighbor
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_box_t), | intent(in) | :: | box | |||
| integer, | intent(in) | :: | nb |
Direction of fine neighbor |
||
| integer, | intent(in) | :: | di(1) |
Index offset of fine neighbor |
||
| integer, | intent(in) | :: | nc | |||
| integer, | intent(in) | :: | iv | |||
| real(kind=dp), | intent(out) | :: | gc(1) |
subroutine box_gc_for_fine_neighbor(box, nb, di, nc, iv, gc) type(mg_box_t), intent(in) :: box integer, intent(in) :: nb !< Direction of fine neighbor integer, intent(in) :: di(1) !< Index offset of fine neighbor integer, intent(in) :: nc, iv real(dp), intent(out) :: gc(1) real(dp) :: tmp integer :: hnc hnc = nc/2 ! First fill a temporary array with data next to the fine grid select case (nb) case (mg_neighb_lowx) tmp = box%cc(1, iv) case (mg_neighb_highx) tmp = box%cc(nc, iv) case default error stop end select ! Now interpolate the coarse grid data to obtain values 'straight' next to ! the fine grid points gc = tmp end subroutine box_gc_for_fine_neighbor