Get coordinates at the face of a box
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_box_t), | intent(in) | :: | box | |||
| integer, | intent(in) | :: | nb | |||
| integer, | intent(in) | :: | nc | |||
| real(kind=dp), | intent(out) | :: | x(nc,2) |
subroutine mg_get_face_coords(box, nb, nc, x) type(mg_box_t), intent(in) :: box integer, intent(in) :: nb integer, intent(in) :: nc real(dp), intent(out) :: x(nc, 2) integer :: i, ixs(2-1) integer :: nb_dim real(dp) :: rmin(2) nb_dim = mg_neighb_dim(nb) ! Determine directions perpendicular to neighbor ixs = [(i, i = 1, 2-1)] ixs(nb_dim:) = ixs(nb_dim:) + 1 rmin = box%r_min if (.not. mg_neighb_low(nb)) then rmin(nb_dim) = rmin(nb_dim) + box%dr(nb_dim) * nc end if do i = 1, nc x(i, :) = rmin x(i, ixs(1)) = x(i, ixs(1)) + (i-0.5d0) * box%dr(ixs(1)) end do end subroutine mg_get_face_coords