The following code runs correctly when compiled under Win32. A runtime error occurs when complied under x64.
program test
use iso_fortran_env
implicit none
complex y(2,2)
integer :: m = 2, i, j
print*, compiler_version()
print*, compiler_options()
y = transpose(reshape([(1),(2),(3),(4)],shape(y))) ! This line causes runtime error when compiled with X64
do i = 1, m
print*, (y(i,j),j=1,m)
end do
end
If line 8 is changed to:
y = transpose(reshape([(1,0),(2,0),(3,0),(4,0)],shape(y)))
or
y = transpose(reshape([cmplx(1,0),cmplx(2,0),cmplx(3,0),cmplx(4,0)],shape(y)))
The run time error does not occur. (I using the most recent update i.e. FTN v 8.96