To: J3 J3/15-181r2 From: Damian Rouson & Bill Long Subject: Additional co_reduce example Date: 2015 August 04 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 =========== Replace the Example in 8.4.13 for CO_REDUCE with an example that demonstrates how to extend an existing language intrinsic to create its natural collective counterpart. 3. Edits ======== [26:30-32] In 8.4.13 CO_REDUCE, replace the Example text "If the number of images ... on both images" by "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 both END SUBROUTINE co_all "