FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iglo | |||
integer, | intent(out) | :: | iglo_right | |||
integer, | intent(out) | :: | iproc_right |
subroutine get_right_connection (iglo, iglo_right, iproc_right)
use gs2_layouts, only: g_lo, proc_id, idx, ik_idx, it_idx, il_idx, ie_idx, is_idx
use kt_grids, only: itright
implicit none
integer, intent (in) :: iglo
integer, intent (out) :: iglo_right, iproc_right
integer :: ik, it, il, ie, is
ik = ik_idx(g_lo,iglo)
it = it_idx(g_lo,iglo)
if (itright(it, ik) < 0) then
iglo_right = -1
iproc_right = -1
return
end if
il = il_idx(g_lo,iglo)
ie = ie_idx(g_lo,iglo)
is = is_idx(g_lo,iglo)
iglo_right = idx(g_lo,ik,itright(it, ik),il,ie,is)
iproc_right = proc_id(g_lo,iglo_right)
end subroutine get_right_connection