Shifted indexes
If i is a distributed index, then:
is a shifted index. Here expression is an integer, usually a small constant.
Assuming array a has suitable ghost regions, can write, say:
overall (i = x for 1 : N-2)
overall (j = y for 1 : N-2)
a[i, j] = 0.25 * (a[i-1, j] + a[i+1, j] +
a[i, j-1] + a[i, j+1]);