J3/10-187r2 To: J3 Subject: Interpretation request concerning pointless restrictions From: Van Snyder/Malcolm Cohen Date: 2010 June 16 ---------------------------------------------------------------------- NUMBER: F08/0038 TITLE: Are pointless restrictions on DIM arguments intended? KEYWORDS: DIM argument, optional, intrinsic reduction function DEFECT TYPE: Erratum STATUS: Under consideration DISCUSSION: Some of the reduction functions have two forms, one with a DIM argument and one without; the DIM argument is not optional. IALL is an example. Other reduction functions have a DIM argument that is optional. COUNT is an example. The actual argument corresponding to the DIM actual argument is prohibited from being an optional dummy argument in both cases. The reason in the case of an optional DIM argument is so that the processor can determine the rank of the result. In the case of those with two forms, there is no problem for the processor to determine the rank, so the prohibition against the corresponding actual argument being an optional dummy argument is pointless. There is already a prohibition against it being an absent optional dummy argument in 12.5.2.12p3(4). Consider, for example subroutine S ( ARRAY, DIM ) integer, intent(in) :: ARRAY(:,:) integer, intent(in), optional :: DIM if ( present(dim) ) then print *, iall(array,dim) else print *, iall(array) end if end subroutine S This subroutine clearly does not conform, but a processor would have no difficulty determining the rank of the result of IALL(ARRAY,DIM). QUESTION: (1) Was the pointless restriction intentional, or was it an oversight that it did not get removed in the two-form case when MAXLOC etc. were added? (2) Is it necessary to continue the pointless restriction? ANSWER: (1) This was an oversight. (2) No. Edits are provided to remove it. EDITS to 10-007: [13.2.4p1 316:26] Insert "absent" before "optional". [13.7.61p3 347:34] Delete "The corresponding ... optional dummy argument." [13.7.71p3 352:27] Delete "The corresponding ... optional dummy argument." [13.7.73p3 353:22] Delete "The corresponding ... optional dummy argument." [13.7.83p3 357:30] Delete "The corresponding ... optional dummy argument." [13.7.108p3 366:29] Delete "The corresponding ... optional dummy argument." [13.7.109p3 367:35] Delete "The corresponding ... optional dummy argument." [13.7.114p3 369:36] Delete "The corresponding ... optional dummy argument." [13.7.115p3 371:2] Delete "The corresponding ... optional dummy argument." [13.7.133p3 379:7] Delete "The corresponding ... optional dummy argument." [13.7.161p3 390:22] Delete "The corresponding ... optional dummy argument." Additional edits if interp F08/0003 passes ------------------------------------------ [13.7.10p3 328:8] Delete "The corresponding ... optional dummy argument." [13.7.13p3 329:12] Delete "The corresponding ... optional dummy argument." [13.7.123p3 374:29-30] Delete "The corresponding ... optional dummy argument." [13.7.128p3 377:26] Delete "The corresponding ... optional dummy argument." [13.7.165p3 392:12-13] Delete "The corresponding ... optional dummy argument." SUBMITTED BY: Van Snyder HISTORY: 10-187r1 m192 F08/0038 submitted 10-187r2 m192 Revised edit. ----------------------------------------------------------------------