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)) STOP 1
24 if (.not
. all(spread (pes
==j
,dim
=1,ncopies
=n_obstype
))) STOP 2
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
))) &
28 if (any(sum (nbx
,dim
=2,mask
=spread (pes
==j
,dim
=1,ncopies
=n_obstype
)) &
29 /= (/ 1, 1 /))) STOP 4