5 integer, intent(in
) :: y(:)
6 integer, intent(out
) :: x(:)
8 function fn2 (x
, m1
, m2
, n1
, n2
)
9 integer, intent(in
) :: x(:,:), m1
, m2
, n1
, n2
10 integer :: fn2(m1
:m2
,n1
:n2
)
12 subroutine sub3 (x
, y
)
13 integer, allocatable
, intent(in
) :: y(:,:)
14 integer, allocatable
, intent(inout
) :: x(:,:)
17 !$omp declare reduction (foo : integer : sub3 (omp_out, omp_in)) &
18 !$omp initializer (omp_priv = fn3 (omp_orig))
19 !$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in, &
20 !$omp & lbound (omp_out, 1), ubound (omp_out, 1))) &
21 !$omp & initializer (sub1 (omp_priv, omp_orig))
22 !$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) &
23 !$omp initializer (omp_priv = fn2 (omp_orig, lbound (omp_priv, 1), &
24 !$omp ubound (omp_priv, 1), lbound (omp_priv, 2), ubound (omp_priv, 2)))
26 function fn1 (x
, y
, m1
, m2
)
27 integer, intent(in
) :: x(:), y(:), m1
, m2
30 subroutine sub2 (x
, y
)
31 integer, intent(in
) :: y(:,:)
32 integer, intent(inout
) :: x(:,:)
35 integer, allocatable
, intent(in
) :: x(:,:)
36 integer, allocatable
:: fn3(:,:)
39 integer :: a(10), b(3:5,7:9), r
40 integer, allocatable
:: c(:,:)
43 !$omp parallel reduction (bar : a) reduction (+: r)
44 if (lbound (a
, 1) /= 1 .or
. ubound (a
, 1) /= 10) call abort
48 if (any (a
/= 4 * r
) ) call abort
50 allocate (c (4:6,8:10))
53 !$omp parallel reduction (baz : b, c) reduction (+: r)
54 if (lbound (b
, 1) /= 3 .or
. ubound (b
, 1) /= 5) call abort
55 if (lbound (b
, 2) /= 7 .or
. ubound (b
, 2) /= 9) call abort
56 if (.not
. allocated (c
)) call abort
57 if (lbound (c
, 1) /= 4 .or
. ubound (c
, 1) /= 6) call abort
58 if (lbound (c
, 2) /= 8 .or
. ubound (c
, 2) /= 10) call abort
63 if (any (b
/= 3 * r
) .or
. any (c
/= 4 * r
)) call abort
65 allocate (c (0:1,7:11))
68 !$omp parallel reduction (foo : c) reduction (+: r)
69 if (.not
. allocated (c
)) call abort
70 if (lbound (c
, 1) /= 0 .or
. ubound (c
, 1) /= 1) call abort
71 if (lbound (c
, 2) /= 7 .or
. ubound (c
, 2) /= 11) call abort
75 if (any (c
/= 10 * r
)) call abort
77 function fn1 (x
, y
, m1
, m2
)
78 integer, intent(in
) :: x(:), y(:), m1
, m2
82 subroutine sub1 (x
, y
)
83 integer, intent(in
) :: y(:)
84 integer, intent(out
) :: x(:)
87 function fn2 (x
, m1
, m2
, n1
, n2
)
88 integer, intent(in
) :: x(:,:), m1
, m2
, n1
, n2
89 integer :: fn2(m1
:m2
,n1
:n2
)
92 subroutine sub2 (x
, y
)
93 integer, intent(inout
) :: x(:,:)
94 integer, intent(in
) :: y(:,:)
98 integer, allocatable
, intent(in
) :: x(:,:)
99 integer, allocatable
:: fn3(:,:)
102 subroutine sub3 (x
, y
)
103 integer, allocatable
, intent(inout
) :: x(:,:)
104 integer, allocatable
, intent(in
) :: y(:,:)