floating point exception
Steve Kargl
sgk@troutmask.apl.washington.edu
Sat Apr 4 02:58:00 GMT 2015
On Sat, Apr 04, 2015 at 01:51:41AM +0000, Frankenstein, Susan ERDC-RDE-CRREL-NH wrote:
>
> On 4/3/15, 2:44 PM, "Steve Kargl" <sgk@troutmask.apl.washington.edu> wrote:
>
> >On Fri, Apr 03, 2015 at 03:03:22PM +0000, Frankenstein, Susan
> >ERDC-RDE-CRREL-NH wrote:
> >
> >(snip)
> >
> >> If I use the following compiler options:
> >>
> >> FFLAGS1 = -std=f2003 -ffree-form -fdefault-real-8 -fdefault-double-8
> >> -Ofast -fall-intrinsics -fcheck=all -m64 -fno-trapping-math -c
> >> -ffpe-trap=invalid,zero,overflow,underflow,precision,denormal ?Wall
> >>
> >> The program stops executing after the first write statement. If I use
> >> instead:
> >>
> >> FFLAGS1 = -std=f2003 -ffree-form -fdefault-real-8 -fdefault-double-8
> >> -Ofast -fall-intrinsics -fcheck=all -m64 -fno-trapping-math -c
> >>
> >
> >(snip)
> >
> >> I?m at a loss as to what to do. Suggestions?
> >
> >Is this a rhetorical question? Use the 2nd set of options, of course!
> >
> >I do recommend that one should not use the -fdefault-real-8
> >and -fdefault-double-8 options, ever. These options may not
> >(and probably do not) do what you think they do. If you
> >absolutely think that you need these options, then use
> >-freal-4-real-8 (might be misspelled as I'm too lazy to look
> >at the gfortran document for you). Of course, the best
> >option is to write Fortran code that does not require any
> >of these options.
> >
>
> Using the second option is fine if you don?t want to find divide by zero
> errors that really occur within the program and not have the program bomb
> at a simple read line.
Your list of -ffpe-trap= options do more than look for divide-by-zero.
> All of my variables in the code are declared double precision. I just have
> the real-8, double-8 as a backup in case I missed anything. Thanks for the
> advise.
I suspect you don't know what those options may or may not do.
Please don't top post. It loses content.
Please don't email directly. Reply to the fortran@ list.
--
Steve
More information about the Fortran
mailing list