Help with these Fortran Compiler Errors please

  • Fortran
  • Thread starter Chaitanya_90
  • Start date
  • #1
Chaitanya_90
3
0
TL;DR Summary
Please tell me the reason for error in following image of Fortran code
What is the reason for error while compilation
 

Attachments

  • IMG_20200826_221135.jpg
    IMG_20200826_221135.jpg
    78.4 KB · Views: 114

Answers and Replies

  • #2
berkeman
Mentor
64,433
15,784
Welcome to PhysicsForums. :smile:
Summary:: Please tell me the reason for error in following image of Fortran code

What is the reason for error while compilation
Looks like you at least have a mismatching parenthesis error. Try counting the number of left and right parenthesis to be sure that they match.
 
  • #3
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,914
15,585
You're nicer than I would have been to someone who didn't even bother to type - paste, really - in his code.

Unfortunately, there also appears to be an error above that one.
 
  • Like
Likes berkeman
  • #4
41,270
18,896
What is the reason for error while compilation

As @Vanadium 50 has remarked, you are not supposed to post code, or problem statements in general, as images. You are supposed to put your code directly into your post, inside a "CODE" block--see the "BBCode Guide" link at the bottom left of the post window for more details.
 
  • #5
14,279
8,300
It seems you have a statement not shown in your snapshot that is missing a right parenthesis.Go back and look at your function calls and expressions.

Often when you get a stream of errors, it pays to look at the first one only and fix it and then recompile to see what remaining ones you still have.
 
  • Like
Likes Vanadium 50 and berkeman
  • #6
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,914
15,585
Often when you get a stream of errors, it pays to look at the first one only and fix it and then recompile to see what remaining ones you still have.

This. The fact we are seeing unbalanced parentheses might be due to something upstream.
Or not.
We can't tell.
 
  • Like
Likes jedishrfu
  • #8
14,279
8,300
This. The fact we are seeing unbalanced parentheses might be due to something upstream.
Or not.
We can't tell.

thats why I said: ...not shown in your snapshot...
 
  • #10
hmmm27
Gold Member
1,079
563
"parenthesis" - is v an array ?
"exponent" - what's the upper limit on exponents in reals ?
"unclassifiable" - does Fortran use interpuncts ?
 
  • #11
14,279
8,300
Fix the first error before you look at the others as they may go away.
 
  • Like
Likes Wrichik Basu and FactChecker
  • #12
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
29,914
15,585
Fix the first error before you look at the others as they may go away.

Or change. Or sometimes you get new ones.
 
  • #13
Chaitanya_90
3
0
Fortran:
*deck wenos
c-----------------------------------------------------------
csssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
c
       subroutine wenos(idirex)
       implicit none
c
c------------------------------------------------------------
       include 'com_main.h'
       include 'params.h'
c------------------------------------------------------------
c 
       integer idirex
       integer j     , i  
       integer ip    , I am    , jp    , jm
c
       real*8 ucon , vcon , ftx  , fty  , eno   ,
     &        tc   , tr   , tl   , tf   , ta    ,
     &        dtr  , dtl  , d2tcx, d2tlx, d2trx ,
     &        dtrr , dtll , dtff , dtaa ,
     &        dtf  , dta  , d2tcy, d2tfy, d2tay , 
     &        ur   , ul   , vf   , va   , rmnmd,
     &        trr  , tll  , tff  , taa
       real*8 S1,S2,S3,v1,v2,v3,v4,v5,phix1,phix2,phix3
       real*8 a11,a22,a33,a1,a2,a3,epss,tlll,taaa,trrr
       real*8 tfff,dtrrr,dtlll ,phixr,phixl,phixt,phixb
       real*8 dtfff,dtaaa,tempp,tempq,tempr,temps,tempt,tempu
c
c-----all parameters used here are defined----------------------------------------------------------------
c
       eno = one
c
       do 1000 j = 2, jbp1
c      
         jp = j + 1
         jm = j - 1
c
       do 1000 i = 2, ibp1
c     
         ip = i + 1   
         I am = i - 1

         ur = u(i ,j )
         ul = u(im,j )
         vf = v(i ,j )
         va = v(i ,jm)
c
         tc  = lsfn(i   ,j   )
         tr  = lsfn(ip  ,j   )
         tl  = lsfn(im  ,j   )
         tf  = lsfn(i   ,jp  )
         ta  = lsfn(i   ,jm  )
         trr = lsfn(ip+1,j   )
         tll = lsfn(im-1,j   )
         tff = lsfn(i   ,jp+1)
         taa = lsfn(i   ,jm-1)
         tlll = lsfn(im-2,j)
         taaa = lsfn(i,jm-2)
         trrr = lsfn(ip+2,j)
         tfff = lsfn(i,jp+2)
c
c------------------------------------------------------------
c >>> x-sweep
c------------------------------------------------------------
c
         if( idirex .eq. 1 ) then
c
           ucon = half*( ul + ur )
c
           dtr = rdxy * (tr - tc)
           dtl = rdxy * (tc - tl)
c
           if( i .lt. ibr ) then
             dtrr = (trr - tr) * rdxy
           else
             dtrr = dtr
           endif
c
           if( i .gt. 2 ) then
             dtll = (tl - tll) * rdxy
           else
             dtll = dtl
           endif
c
           if( i .gt. 3 ) then
             dtlll = (tll - tlll) * rdxy
           else
             dtlll = dtll
           endif
c
           if( i .lt. ibr-1 ) then
             dtrrr = (trrr - trr) * rdxy
           else
             dtrrr = dtrr
           endif
c
           v1 = dtlll
           v2 = dtll
           v3 = dtl
           v4 = dtr
           v5 = dtrr
           tempp = v1 − 2.0d0*v2 + v3
           tempq = v1 − 4.0d0*v2 + 3.0d0*v3
           tempr = v2 − 2.0d0*v3 + v4
           temps = v2 − v4
           tempt = v3 − 2.0d0*v4 + v5
           tempu = 3.0d0*v3 − 4.0d0*v4 + v5
           S1=(13./12.)*(tempp**2.)+(1./4.)*(tempq**2.)
           S2=(13./12.)*(tempr**2.)+(1./4.)*(temps**2.)
           S3=(13./12.)*(tempt**2.)+(1./4.)*(tempu**2.)
           phix1=(v1/6.)-(7.*v2/6.)+(11.*v3/6.)
           phix2=(-v2/6.)-(5.*v3/6.)+(v4/3.)
           phix3=(-v3/3.)-(5.*v4/6.)+(v5/6.)
           tempu=max(v1**2,v2**2,v3**2,v4**2,v5**2)
           epss=(10.0d-6)*tempu + (10.0d-99)
           a11=0·1/((S1+epss)**2)
           a22=0·6/((S2+epss)**2)
           a33=0·3/((S3+epss)**2)
           a1=a11/(a11+a22+a33)
           a2=a22/(a11+a22+a33)
           a3=a33/(a11+a22+a33)
           phixl=a1*phix1+a2*phix2+a3*phix3
c        
           v1=dtll
           v2=dtl
           v3=dtr
           v4=dtrr
           v5=dtrrr
           tempp=v1 − 2.0d0*v2 + v3
           tempq=v1 − 4.0d0*v2 + 3.0d0*v3
           tempr=v2 − 2.0d0*v3 + v4
           temps=v2 − v4
           tempt=v3 − 2.0d0*v4 + v5
           tempu=3.0d0*v3 − 4.0d0*v4 + v5
           S1=(13./12.)*(tempp**2.)+(1./4.)*(tempq**2.)
           S2=(13./12.)*(tempr**2.)+(1./4.)*(temps**2.)
           S3=(13./12.)*(tempt**2.)+(1./4.)*(tempu**2.)
           phix1=(v1/6.)-(7.*v2/6.)+(11.*v3/6.)
           phix2=(-v2/6.)-(5.*v3/6.)+(v4/3.)
           phix3=(-v3/3.)-(5.*v4/6.)+(v5/6.)
           tempu=max(v1**2,v2**2,v3**2,v4**2,v5**2)
           epss=(10.0d-6)*tempu + (10.0d-99)
           a11=0·1/((S1+epss)**2)
           a22=0·6/((S2+epss)**2)
           a33=0·3/((S3+epss)**2)
           a1=a11/(a11+a22+a33)
           a2=a22/(a11+a22+a33)
           a3=a33/(a11+a22+a33)
           phixr=a1*phix1+a2*phix2+a3*phix3
c
           if( ucon .gt. zero ) then
             ftx = ucon * phixl
           else
             ftx = ucon * phixr
           endif
c
           lsf(i,j) = lsfn(i,j) - dt * ftx
c
         endif
c------------------------------------------------------------
c >>> y-sweep
c------------------------------------------------------------
c
         if ( idirex .eq. 2 ) then
c
           vcon = half*( va + vf )
c
           dtf = rdxy * (tf - tc)
           dta = rdxy * (tc - ta)
c
           if( j .lt. jbp1 ) then
             dtff = (tff - tf) * rdxy
           else
             dtff = dtf
           endif
c
           if( j .gt. 2 ) then
             dtaa = (ta - taa) * rdxy
           else
             dtaa = dta
           endif
c
           if( j .gt. 3 ) then
             dtaaa = (taa - taaa) * rdxy
           else
             dtaaa = dtaa
           endif
c
           if( j .lt. jbr-1 ) then
             dtfff = (tfff - tff) * rdxy
           else
             dtfff = dtff
           endif
c
           v1=dtaaa
           v2=dtaa
           v3=dta
           v4=dtf
           v5=dtff
           tempp=v1 − 2.0d0*v2 + v3
           tempq=v1 − 4.0d0*v2 + 3.0d0*v3
           tempr=v2 − 2.0d0*v3 + v4
           temps=v2 − v4
           tempt=v3 − 2.0d0*v4 + v5
           tempu=3.0d0*v3 − 4.0d0*v4 + v5
           S1=(13./12.)*(tempp**2.)+(1./4.)*(tempq**2.)
           S2=(13./12.)*(tempr**2.)+(1./4.)*(temps**2.)
           S3=(13./12.)*(tempt**2.)+(1./4.)*(tempu**2.)
           phix1=(v1/6.)-(7.*v2/6.)+(11.*v3/6.)
           phix2=(-v2/6.)-(5.*v3/6.)+(v4/3.)
           phix3=(-v3/3.)-(5.*v4/6.)+(v5/6.)
           tempu=max(v1**2,v2**2,v3**2,v4**2,v5**2)
           epss=(10.0d-6)*tempu + (10.0d-99)
           a11=0·1/((S1+epss)**2)
           a22=0·6/((S2+epss)**2)
           a33=0·3/((S3+epss)**2)
           a1=a11/(a11+a22+a33)
           a2=a22/(a11+a22+a33)
           a3=a33/(a11+a22+a33)
           phixb=a1*phix1+a2*phix2+a3*phix3
c        
           v1=dtaa
           v2=dta
           v3=dtf
           v4=dtff
           v5=dtfff
           tempp=v1 − 2.0d0*v2 + v3
           tempq=v1 − 4.0d0*v2 + 3.0d0*v3
           tempr=v2 − 2.0d0*v3 + v4
           temps=v2 − v4
           tempt=v3 − 2.0d0*v4 + v5
           tempu=3.0d0*v3 − 4.0d0*v4 + v5
           S1=(13./12.)*(tempp**2.)+(1./4.)*(tempq**2.)
           S2=(13./12.)*(tempr**2.)+(1./4.)*(temps**2.)
           S3=(13./12.)*(tempt**2.)+(1./4.)*(tempu**2.)
           phix1=(v1/6.)-(7.*v2/6.)+(11.*v3/6.)
           phix2=(-v2/6.)-(5.*v3/6.)+(v4/3.)
           phix3=(-v3/3.)-(5.*v4/6.)+(v5/6.)
           tempu=max(v1**2,v2**2,v3**2,v4**2,v5**2)
           epss=(10.0d-6)*tempu + (10.0d-99)
           a11=0·1/((S1+epss)**2)
           a22=0·6/((S2+epss)**2)
           a33=0·3/((S3+epss)**2)
           a1=a11/(a11+a22+a33)
           a2=a22/(a11+a22+a33)
           a3=a33/(a11+a22+a33)
           phixt=a1*phix1+a2*phix2+a3*phix3
c
c           d2tcy = rdxy  * (dtf  - dta)
c           d2tfy = rdxy  * (dtff - dtf)
c           d2tay = rdxy  * (dta  - dtaa)
c
           if( vcon .gt. zero ) then
             fty = vcon * phixb
           else
             fty = vcon * phixt
           endif
c
           lsf(i,j) = lsfn(i,j) - dt * fty
c
         endif
c____________________________________________________________
c
1000  continue
c
      return
 
Last edited by a moderator:
  • #14
14,279
8,300
Your code listing doesn't match the error report line numbers. The error on line 112 is shown in your code listing at line 102. Have you dropped some lines from your code listing.

Also screenshots are very poor ways of conveying this info. You could instead capture your error report to a file.

Lastly, we aren't here to debug your program for you. Earlier we asked you to focus on the first error and if you checked your parenthesis balancing prior to line 112 in your error report. Have you done these things yet?
 
  • #15
Chaitanya_90
3
0
paranthesis i checked again its fine but i don't know the reason for error, maybe spaces or indentation might be causing the error
 
  • #16
DrClaude
Mentor
8,109
4,908
What is the first error message?
 
  • Like
Likes Vanadium 50 and Wrichik Basu
  • #17
berkeman
Mentor
64,433
15,784
The OP has let the Mentors know via PM that s/he found their mistake. Thanks to all who tried to help; the thread is now closed.
 
  • Like
Likes jedishrfu

Suggested for: Help with these Fortran Compiler Errors please

  • Last Post
Replies
22
Views
808
  • Last Post
Replies
1
Views
91
  • Last Post
2
Replies
37
Views
2K
Replies
12
Views
256
Replies
3
Views
736
Replies
2
Views
423
Replies
3
Views
757
  • Last Post
Replies
17
Views
3K
Replies
7
Views
614
Top