The following test program compiles and runs correctly with three other compilers.
program drvr
implicit none
integer, parameter :: np=7
integer :: i=1
integer :: m
integer :: n=np
integer, dimension(np) :: f = (/ 1,2,3,4,5,6,7 /)
double precision, dimension(np) :: c = &
(/ 0.62, 0.61, 1., 1., 0.9998, 1., 0.997 /)
double precision, dimension(np) :: e = (/ 0.,0.,0.,0.,0.,0.,0. /)
double precision, dimension(np) :: q = &
(/ 0.89, -0.36, 0.56, -0.008, -0.188, -0.28, -0.369 /)
double precision, dimension(np) :: r = &
(/ 0.62, 0.61, 1., 1., 1., 0.9998, 0.9970 /)
double precision, dimension(np) :: w = &
(/ 5.,10.,0.5,0.5,0.5,0.5,0.5 /)
double precision :: a(2,np) = &
reshape( (/ 5.,10.,5.,10., 0.,1.,0.,1.,0.,1.,0.,1.,0.,1. /), &
(/ 2, 7 /))
call sub(n,m)
write(*,*)'Result = ',m
CONTAINS
subroutine sub(n, s)
implicit none
integer, intent(in) :: n
integer, intent(out) :: s
integer :: j
integer :: a01u(n), a11u(n)
double precision :: a91u(n), ae1u(n)
logical :: l2v(n), l3v(n)
m = 0
a11u = 0
if (i < 0) e(1:n) = 0d0
i = 1
l3v = .FALSE.
a01u = f(:n)
a91u = -q(:n)*r(:n)/c(a01u)
ae1u = w(a01u) - a91u
l2v = ae1u >= a(1,a01u)
where (l2v)
l3v = ae1u > a(2,a01u)
end where
where (l3v) ! <<<=== access error
a11u = (/(j,j=1,n)/)
end where
s=sum(a11u)
return
end subroutine sub
end program
When this program is run using FTN95 7.10, with the command ftn95 whereprog.f90 /lgo,, the program crashes with an access violation on the line indicated (Line 47). The program should run without error and produce the output ** Result = 3**
[P.S., 15 June 2015: This bug is also present in FTN95-7.20]