J3/06-330 Date: October 27, 2006 To: J3 From: Aleksandar Donev Subject: Integration of autotargetting and contiguous rank remapping Reference: J3/06-007r1 Dependencies: None ----------------- Specification ----------------- The new autotargetting feature (magically pointing dummy pointers to non-pointer actual targets) is not integrated with pointer array rank-remapping of contiguous targets, and also with bounds-remapping. Specifically, the autotargetting feature requires that the ranks of the dummy and actual agree (see [316:1]), and always uses the same lower bounds as those of the target. This paper proposes to allow contiguous actuals of any rank when the dummy is a rank-1 pointer. The bounds of the dummy are set to 1 and SIZE(actual). Example: interface subroutine process(x) real, pointer, contiguous :: x(:) end subroutine end interface real :: y(10,10) call process(y) ! The bounds of x are [1,100] The reason for this lack of integration is that there is no place to put lower or upper bounds as required to perform pointer rank-remapping or bounds-remapping [see or in R735]. However, for one particular and very common case, when the dummy is rank-1, the bounds are obvious, [1,SIZE(actual)]. That is, the autotargetting feature would use the rank-remapping: ptr_dummy[1:size(contig_actual)]=>contig_actual ----------------- Note: As a further alternative, we may wish to consider allowing one to specify lower bounds for pointer dummies, though this paper does not propose that. Example: interface subroutine process(x) real, pointer, contiguous :: x(1:) ! Lower bound is always 1 regardless of actual end subroutine end interface ----------------- Edits: ----------------- [315:30] In the sentence "Otherwise..." add "X" after "actual argument" and "P" after "dummy pointer". [315:31] After "an assignment statement." add a new sentence: "If the ranks of the dummy and actual arguments differ, the dummy shall be a rank-1 array and the actual shall be contiguous (5.3.6)." [315:32] Add to the end of the paragraph: "as if the statement P=>X were executed for the case when the ranks of the dummy and actual arguments agree, or otherwise, the statement P(1:SIZE(X))=>X were executed. [316:1] Delete "and ranks"