4 interface operator(.add
.)
5 module procedure do_add
12 type (dt
), intent (in
) :: x
, y
16 subroutine dp_add(x
, y
)
17 double precision :: x
, y
27 use m
, only
: operator(.add
.), dt
, dp_add
, dp_init
30 integer (kind
= 4) :: i4
31 integer (kind
= 8) :: i8
33 double precision :: dp
34 !$omp declare reduction(.add.:dt:omp_out=omp_out.add.omp_in)
35 !$omp declare reduction(foo:integer(4),integer(kind=8),real (kind = 4) &
36 !$omp & :omp_out = omp_out + omp_in) initializer (omp_priv = 0)
37 !$omp declare reduction(foo:double precision:dp_add (omp_out, omp_in)) &
38 !$omp & initializer (dp_init (omp_priv))
46 !$omp parallel reduction(.add.: xdt) reduction(+: r) &
47 !$omp & reduction(foo: i4, i8, r4, dp)
53 call dp_add (dp
, 1.0d0)
55 if (xdt
%r
.ne
. r
) STOP 1
56 if (i4
.ne
.r
.or
.i8
.ne
.r
.or
.r4
.ne
.r
.or
.dp
.ne
.r
) STOP 2