Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
告知
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

ERROR 5082

amir_a_2
ビギナー
1,397件の閲覧回数

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 件の賞賛
5 返答(返信)
Lorri_M_Intel
従業員
1,397件の閲覧回数

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

Can you show more of the program?

             --Lorri

amir_a_2
ビギナー
1,397件の閲覧回数

    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

TimP
名誉コントリビューター III
1,397件の閲覧回数

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.

amir_a_2
ビギナー
1,397件の閲覧回数

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    

 

 

mecej4
名誉コントリビューター III
1,397件の閲覧回数

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.

返信