5 integer, allocatable
:: h(:)
7 !$omp declare reduction (baz : dt : bar (omp_out, omp_in)) &
8 !$omp & initializer (foo (omp_priv, omp_orig))
10 type (dt
), allocatable
:: a(:)
13 a(7)%h
= (/ 0, 0, 0 /)
15 !$omp parallel reduction(+:r) reduction (baz:a)
16 if (.not
.allocated (a
)) stop 1
17 if (lbound (a
, 1) /= 7 .or
. ubound (a
, 1) /= 8) stop 2
18 if (.not
.allocated (a(7)%h
)) stop 3
19 if (allocated (a(8)%h
)) stop 4
20 if (lbound (a(7)%h
, 1) /= 1 .or
. ubound (a(7)%h
, 1) /= 3) stop 5
25 if (.not
.allocated (a
)) stop 6
26 if (lbound (a
, 1) /= 7 .or
. ubound (a
, 1) /= 8) stop 7
27 if (.not
.allocated (a(7)%h
)) stop 8
28 if (allocated (a(8)%h
)) stop 9
29 if (lbound (a(7)%h
, 1) /= 1 .or
. ubound (a(7)%h
, 1) /= 3) stop 10
30 if (any (a(:)%g
/= 2 * r
) .or
. any (a(7)%h(:) /= 3 * r
)) stop 11
33 type (dt
), allocatable
:: x(:), y(:)
34 if (allocated (x
) .neqv
. allocated (y
)) stop 12
35 if (lbound (x
, 1) /= lbound (y
, 1)) stop 13
36 if (ubound (x
, 1) /= ubound (y
, 1)) stop 14
37 if (allocated (x(7)%h
) .neqv
. allocated (y(7)%h
)) stop 15
38 if (allocated (x(8)%h
) .neqv
. allocated (y(8)%h
)) stop 16
39 if (lbound (x(7)%h
, 1) /= lbound (y(7)%h
, 1)) stop 17
40 if (ubound (x(7)%h
, 1) /= ubound (y(7)%h
, 1)) stop 18
46 type (dt
), allocatable
:: x(:), y(:)
47 x(:)%g
= x(:)%g
+ y(:)%g
48 x(7)%h(:) = x(7)%h(:) + y(7)%h(:)