To: J3 J3/15-181 From: Damian Rouson Subject: Additional co_reduce example Date: 2015 July 06 Reference: TS 18508 1. Introduction =============== Due in part to desirable space limitations, the MyAdd example demonstrating co_reduce in 8.4.13 of TS 18508 (19 May 2015) appears to be redundant with co_sum. It would be helpful to demonstrate the use of co_reduce in a way that extends the language rather than recreating an existing capability. 2. Proposal =========== Add an example of co_reduce in A.4.1 of TS 18508 that demonstrates how to extend to extend an existing language intrinsic to create its natural collective counterpart. 3. Edits ======== [53:29] Insert the following pararaph and code example: The subroutine below demonstrates how to use co_reduce to create a collective counterpart to the "all" intrinsic function: subroutine co_all(boolean) logical, intent(inout) :: boolean call co_reduce(boolean,both) contains pure function both(lhs,rhs) result(lhs_and_rhs) logical, intent(in) :: lhs,rhs logical :: lhs_and_rhs lhs_and_rhs = lhs .and. rhs end function end subroutine