Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28992 Discussions

forrtl: severe (71): integer divide by zero

milenko1976
Beginner
3,387 Views
I am trying to run program,eik.In the first place I got SIGSEGV segmentation fault.Following Ron's advice,I have changed a makefile.But now I am having this:
forrtl: severe (71): integer divide by zero
Image PC Routine Line Source
eik 000000000040475E pfpz_ 257 eik.f
eik 0000000000403B5A MAIN__ 123 eik.f
eik 000000000040311C Unknown Unknown Unknown
libc.so.6 00002B34EE3515A6 Unknown Unknown Unknown
eik 0000000000403019 Unknown Unknown Unknown
257 do 10 j=j1,j2,key
123 call pfpz(i,j1,j2,dh,key,is,js)
From the screen output I don't get which argument is zero.
Anybody has idea?
0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
3,387 Views
is key 0?

The Fortran DO does something like this

integer :: nIterations = (iEnd - iStart + 1) / iStep
do {
your statements
} while(--nIterations > 0)

.or.

while(--nIterations > 0) {
your statements }


choice of method dependent on compiler opton (do once)

I suspect your iStep value (key) is 0

Jim
0 Kudos
milenko1976
Beginner
3,387 Views
Exectly,but it is in FORTRAN77.
c1=abs(t(i,j-1)-t(i+1,j-1))/(s(i,j-1)*dh)
bUT s(i,j-1)*dh can not be zero,regarding the input files I gave.
0 Kudos
jimdempseyatthecove
Honored Contributor III
3,387 Views

Have you tested?
256 if(key == 0) write(*,*) "(key == 0)"
257 do 10 j=j1,j2,key
123 call pfpz(i,j1,j2,dh,key,is,js)

The only logical explinations are for key to be 0, or compiler bug, or line number pointing at wrong line.
Jim

0 Kudos
milenko1976
Beginner
3,387 Views
You are right,idb gives me:
Program received signal SIGFPE
pfpz (i=3, j1=7084408, j2=, dh=6.45473082e+37, key=0, is=2, js=2) at /home/milenko/eik1/eik.f:258
258 do 10 j=j1,j2,key
(idb)

0 Kudos
Reply