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

ERROR 5082

amir_a_2
Beginner
758 Views

Hi

i  was using a simple DO cmd ::

  DO ( i.lt.10 .and. error.lt.(1e-4)) 

and this happened ::

Error    1     error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: <IDENTIFIER>    

VS 2013  

so i dont know whats wrong here... need help

 

 

0 Kudos
5 Replies
Lorri_M_Intel
Employee
758 Views

There is not enough information to do anything more than make a wild guess here.

Can you show more of the program?

             --Lorri

0 Kudos
amir_a_2
Beginner
758 Views

    program Console8

    implicit none
Real::X1,Xm,F(x),Fd(X),error
integer::i
F(x)=tan(x)-x
Fd(x)=tan(x)**2
error=1.0
i=1.0
1 print*,'please enter a number close to  root'
Read*,Xm
  DO ( i.lt.10 .and. error.lt.(1e-4)) 
      X1=Xm-(F(Xm)/Fd(Xm))
      X1=Xm
i=i+1
error=abs(X-Xm)
  end do
  print*,'root is',X1 , 'error is' , error
go to 1
pause

    end program Console8

0 Kudos
TimP
Honored Contributor III
758 Views

That one line is not complete Fortran syntax.  Perhaps it was intended to be

do while(...)

and some references have said it would be preferable to use

do

   if(.not.( i.lt.10 .and. error.lt.(1e-4))) exit

.....

end do

The error message seems a little off target, as I don't see how appending an identifier could make it meaningful.

0 Kudos
amir_a_2
Beginner
758 Views

now i changd code to this 

    program Console5
!Amir Abbas Falsafi
    implicit none
    Real,parameter::error=1e-4 , pi=3.141592
    integer::i=1
    Real::Xm,T
    Real::F,FF,X,Xm2
5    Read*,Xm
   Xm2=Xm*180/pi
   Do while(I.lt.10.and.F(X).gt.error)
   X=Xm-((tan(Xm2)-Xm)/(tan(Xm2)**2))
    
 
        print*,'Xo is',X ,'times repeated=',i
   
     Xm=X
        
        i=i+1
       
   end do
   go to 5
   end program Console5

 

and now what i get is more interesting

Error    1     error LNK2019: unresolved external symbol _F referenced in function _MAIN__           Console8.obj    
Error    2     fatal error LNK1120: 1 unresolved externals                Debug\Console8.exe    

 

 

0 Kudos
mecej4
Honored Contributor III
758 Views

The declaration of F as real and the subsequent appearance in an expression of F(X) signify to the compiler that F is an external function of type real with one real argument. You have to supply the source code of that function.

If the code is intended to solve an algebraic equation by regula-falsi or something similar, note that the convergence check that you use may fail to do what was intended.

0 Kudos
Reply