The following code compiles and runs in FTN95 Ver 8.70. An alternative compiler rejects this code (correctly?) since i is not defined as an integer.
program main
implicit none
integer, parameter :: dp=kind(1.d0), n = 5
real(kind=dp) :: x(1:n) = (/(i,i=1,n)/), y(1:n) = (/(i,i=1,n)/) !FTN compiler does not identify that i has no declared type
integer j
do j = 1, n, 1
print*, j, x(j), y(j)
end do
end program main
This variation to the code runs with both compilers:
program main
implicit none
integer, parameter :: dp=kind(1.d0), n = 5
integer a
real(kind=dp) :: x(1:n) = (/(a,a=1,n)/), y(1:n) = (/(a,a=1,n)/)
integer j
do j = 1, n, 1
print*, j, x(j), y(j)
end do
end program main
Removing the declaration of a as an integer, as in:
program main
implicit none
integer, parameter :: dp=kind(1.d0), n = 5
real(kind=dp) :: x(1:n) = (/(a,a=1,n)/), y(1:n) = (/(a,a=1,n)/)
integer j
do j = 1, n, 1
print*, j, x(j), y(j)
end do
end program main
produces with FTN95
C:\Users\kenneth smith\Desktop\pl_pic_2\FreeFormat2.F95(4) : error 637 - Internal compiler error - floating point exception
Something strange is happening here.