To: J3 07-150r1 From: Bill Long and John Reid Subject: Co-array allocation and collective calls Date: 2007 February 14 Reference: J3/07-007, 07-103 Discussion 1. There is a problem re allocating and deallocating an allocatable co-array that is a dummy argument. We require the same statement to be involved, but the dummy argument might be associated with different co-arrays on different images. We need to require that on each image the dummy co-array be associated (perhaps through many levels of the call chain) with the same non-dummy co-array. We introduce a new term, "ultimate argument", to identify the non-dummy argument at the top of the call chain. 2. A similar problem occurs for a call of a collective procedure. 3. Was it intended to restrict the collectives to having a whole co-array for their first actual argument? For example, should this call be allowed: call co_sum(co_array(1:5), result(1:5)) Note that the restriction is not effective, as may be seen from the example call jacket(co_array(1:5), result(1:5)) : subroutine jacket(co_array, result) real :: co_array(5)[*], result(5) call co_sum(co_array, result) : To remove the restriction, we define a new term "co-array compatible" and use it in the definitions of the collectives. Edits to J3/07-007 [128:6]. In 6.3.1 ALLOCATE statement, at the end of the paragraph that starts "If an specifies a co-array", add "If the co-array is a dummy argument, its ultimate argument shall be the same co-array on every image." [132:1]. In 6.3.3.1 Deallocation of allocatable variables, at the end of the penultimate paragraph, add "If the co-array is a dummy argument, its ultimate argument shall be the same co-array on every image." [314:18] At the end of 12.5.2.3 Argument association, add to the final paragraph: "The <> is the effective argument if the effective argument is not a dummy argument or a subobject of a dummy argument. If the effective argument is a dummy argument, the ultimate argument is the ultimate argument of that dummy argument. If a given dummy argument has an effective argument that is part of a second dummy argument, the ultimate argument of the given dummy argument is the corresponding part of the ultimate argument of the second dummy argument." [319:27] In 12.5.2.9 Co-array arguments, at the end of the second paragraph, add: "Such an actual argument is called <>". [342:20-23]. Reword the text of 13.2.4 Arguments to collective subroutines to: "Each actual argument to a collective subroutine shall have the same shape on all images of the team. Each actual argument associated with an INTENT(IN) argument of type IMAGE_TEAM shall have a value that was constructed by an invocation of FORM_TEAM for the team on that image. The ultimate argument of each co-array dummy argument shall be the same on every image of the team." [363:13+],[363:23+],[364:8+]. For the MASK argument of 13.7.32 CO_ALL, 13.7.33 CO_ANY, and 13.7.34 CO_COUNT, replace "a co-array" by "co-array compatible and". [365:8+],[365:18+],[366:8+],[366:18+],[367:9+],[367:19+]. For the CO_ARRAY argument of 13.7.36 CO_MAXLOC, 13.7.37 CO_MAXVAL, 13.7.38 CO_MINLOC, 13.7.39 CO_MINVAL, 13.7.40 CO_PRODUCT, and 13.7.41 CO_SUM, replace "a co-array" by "co-array compatible and". Note to editor: If paper 07-103 (adds the CO_FINDLOC intrinsic) is adopted then the description of the CO_ARRAY argument to CO_FINDLOC should be modified in the same was as for CO_MINLOC above.