program failing
implicit none
integer i, n
parameter (n = 3)
real a(0:n)
do i = 0, n
!= stencil readOnce, atMost, (pointed(dim=1)) :: a
!= stencil readOnce, atMost, (forward(depth=4, dim=1)) :: a
a(i) = a(i) + a(i+4)
end do
end program
Running camfort stencils-check failing.f90 we get:
Checking stencil specs for 'failing.f90'
failing.f90
(9:2)-(9:51) Not well specified.
Specification is:
stencil readOnce, atMost, (pointed(dim=1)) :: a
but at (11:2)-(11:21) the code behaves as
stencil readOnce, atLeast, (pointed(dim=1)) :: a
stencil readOnce, atMost, (forward(depth=4, dim=1)) :: a
(10:2)-(10:60) Correct.
Which ignores the fact the stencils are grouped, and if the user were to insert the suggested stencils they would end up with redundant stencils.
For example, with the file
failing.f90
:Running
camfort stencils-check failing.f90
we get:Which ignores the fact the stencils are grouped, and if the user were to insert the suggested stencils they would end up with redundant stencils.