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

I don't get the Output

chimanski__emanuel
964 Views

Hi,

given the following code:

program test
Implicit NONE
INTEGER,parameter:: n=130,nt=n-80
REAL*8           :: x
INTEGER          :: i
x=0.0d0
DO i=1,n
   x=x+0.1
   IF(i .ge. 120)THEN
write(*,*)i,x
    pause
    ELSE
   ENDIF
 
   IF(i.ge.nt)write(*,*)i,x
ENDDO
 
END Program test
 
I would not expect to have the following output:
          ...
         118   11.8000001758337     
         119   11.9000001773238     
          50   12.0000001788139     
FORTRAN PAUSE
 
 
Apparently the value of index i is changing somehow. This is a part of one of my codes I just removed what I could to find the problem, but now I'm left with this and I don't get it. Any other compiler (gcc, or older version of intel) works properly, but the version ifort version 18.0.1  does not.
Any ideia?
 
Thanks
 
0 Kudos
2 Replies
Steve_Lionel
Honored Contributor III
964 Views

Yes - I can see this behavior when optimizing. Looks like a compiler bug. Please report it to the Intel Online Service Center.

0 Kudos
chimanski__emanuel
964 Views

Ok thank you.

I believe this post can be deleted.

All the Best.

0 Kudos
Reply