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

Error on expression

Tamiris_Crepalde
Beginner
375 Views

Hi, I'm got a code on internet that make otimization but my compiler is setting the following fragment with a error. Someone know how can I fix it? 

Sorry for my english.

 

      do i=1,nlin
          if (barra_f(i) .gt. barra_i(i)) then
              A(nger+1+cont1,nger+barra_i(i)+1) = lineX(barra_i(i), barra_f(i))
              A(nger+1+cont1,nger+barra_f(i)+1) = -lineX(barra_i(i), barra_f(i))
          else
              A(nger+1+cont1,nger+barra_i(i)+1) = -lineX(barra_i(i), barra_f(i))
              A(nger+1+cont1,nger+barra_f(i)+1) = lineX(barra_i(i), barra_f(i))
          end if
          A(nger+1+cont1,1) = carregamento(i)
          cont1=cont1+1
      end do

 

The compiler sets the expessions with the following error
Erro error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: = .EQV. .NEQV. .XOR. .OR. .AND. .LT. < .LE. <= .EQ. == .NE. /= .GT. > ... C:\Users\Tamiris\Documents\Visual Studio 2017\Projects\FPO\Console4\Simplex.for 123
0 Kudos
3 Replies
Arjen_Markus
Honored Contributor I
375 Views

Which line is the offending line? The error message indicates line 123, but there is no such line of course in the above fragment.

And without declarations it is a trifle difficult to diagnose errors that might come from a wrong use/declaration.

 

0 Kudos
JVanB
Valued Contributor II
375 Views

The compiler thinks the source code is fixed format, so it's ignoring characters after the first 72. One of your lines is 74 characters long.

Either change the name of the file to Simplex.f90 or compile it with the /FREE compiler switch in effect. Either choice will let the compiler know it's free format.

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
375 Views

or change the indentation such that your source lines do not extend past column 72 (and do not use tab characters).

If you are using MS Visual Studio, columns 73 and later are highlighted with the comment color (usually green).

Jim Dempsey

0 Kudos
Reply