The rules for translating array sections are more complicated than any other part of the basic translation scheme.
We will break it down into three cases: the case where there are no scalar subscripts--integer or distributed index; the case where integer scalar subscripts appear in sequential dimensions only; and the general case where scalar subscripts may appear in distributed dimensions. The scheme for translating the first case is illustrated in Figure A.27.
The macro PROCESS_SUBSCRIPTS will be defined here in a tail-recursive way. The intention is that it should be expanded to a compile-time loop over .
Let be the rank of the subscripted array.
If , then the macro
is the degenerate triplet, :, then
:, and the th dimension of is distributed, then
:, and the th dimension of is sequential, then
:. Otherwise, if is the splitting subscript,