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