1 (edited by oz1 2013-11-24 02:52:01)

Topic: Complete beginner - detecting errors

After many happy years with Lahey Fortran ED4W, I find it won't work on WIN7 x64 so I'm trying out SF2

Here is a simple program where a write statement exceeds array bounds

program test
dimension i(3)   
i=1
do j=1,4
    write(*,*) i(j)
end do
end

The result is
1
1
1
128
What I need is to generate a run time error message to show that i(4)  is out of range.

How do I set compiler options to do this?  Also, how do I set runtime environment variables such as GFORTRAN_ERROR_BACKTRACE

I presume this is through compiler switches or flags but I'd appreciate an example of where & how to do this in SF

Re: Complete beginner - detecting errors

OK.  Solved my own problem.  Just needed to add a -fcheck all flag to the compiler options