4 ! Wrong loop shape for SUM when arguments are library-allocated arrays.
6 ! Original testcase provided by Harald Anlauf <anlauf@gmx.de>
10 integer :: n_obstype
= 2
14 integer, allocatable
:: nbx(:,:), pes(:)
16 allocate (pes(nboxes
))
17 allocate (nbx(n_obstype
,nboxes
))
20 pes(j
) = modulo (j
-1, nprocs
)
22 if (any(nbx
/= 1)) call abort
24 if (.not
. all(spread (pes
==j
,dim
=1,ncopies
=n_obstype
))) call abort
25 ! The two following tests used to fail
26 if (any(shape(sum(nbx
,dim
=2,mask
=spread (pes
==j
,dim
=1,ncopies
=n_obstype
))) &
27 /= (/ 2 /))) call abort
28 if (any(sum (nbx
,dim
=2,mask
=spread (pes
==j
,dim
=1,ncopies
=n_obstype
)) &
29 /= (/ 1, 1 /))) call abort