floating point exception
Frankenstein, Susan ERDC-RDE-CRREL-NH
Susan.Frankenstein@erdc.dren.mil
Fri Apr 3 15:03:00 GMT 2015
Hello All:
I have a fortran program for which I get different behavior depending on
which compiler options I see. The code that is causing the problem is:
read(ctrlUnit,'(a)') snwFile
!snow processes output data
snwFile = snwFile(1:len_trim(snwFile(1:index(snwFile,'!')-1)))
write(*,*)'"',trim(snwFile),'" ',ctrlUnit
read(ctrlUnit,*) slope_fasst,aspect
!degrees from horizontal, degrees from N
write(*,*)slope_fasst,aspect
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
The program runs just fine. The input file lines are:
snow_info.out !output of snow information
10.0 70.0 !surface slope (degrees from horizontal), surface
aspect angle (degrees from N, + = clockwise)
I have compiled and run this code using Intel fortran with the fpe0
option and receive no errors.
I¹m at a loss as to what to do. Suggestions?
Thanks,
Susan
Susan Frankenstein, PhD, PE
ERDC-CRREL
72 Lyme Rd.
Hanover, NH 03755
Susan.Frankenstein@erdc.dren.mil
Susan.Frankenstein@usace.army.mil
Secure: Susan.Frankenstein.civ@mail.smil.mil
603-646-4812 <tel:603-646-4812>
More information about the Fortran
mailing list