Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * )

Status
Not open for further replies.

Teo5082

Technical User
Jul 7, 2016
2
GB
Hello,
I have done the following Fortran code(.f)


C Copy the material feed variables into the table. Data for
C each material stream will be placed in separate columns.
C NMATI equals the number of material feeds.
K1 = NUM_ROWS-2
K2 = NUM_ROWS-1
NUM_COLS = NMATI
DO J=1, NUM_COLS
OFFSET = (J-1)*(NCOMP_NCC+12)
DO I=1, NUM_ROWS
IF (I .EQ. K1) then
CALL SHS_CPACK(MSIN(1,J), NCP, IDX, Y, FLOW)
KDIAG=4
K= NCOMP_NCC
CALL PPMON_VISCV(MSIN(K+2,J), MSIN(K+3,J), Y, NCP,
+ IDX, NBOPST, KDIAG,
+ INSTREAM(OFFSET+I), RETCODE)
ELSE
IF (I .EQ. K2) then
CALL SHS_CPACK(MSIN(1,J), NCP, IDX, Y, FLOW)
KDIAG=4
K= NCOMP_NCC
CALL PPMON_TCONV(MSIN(K+2,J), MSIN(K+3,J), Y, NCP,
+ IDX, NBOPST, KDIAG,
+ INSTREAM(OFFSET+I), RETCODE)
ELSE
IF (I .EQ. NUM_ROWS) then
CALL SHS_CPACK(MSIN(1,J), NCP, IDX, Y, FLOW)
K= NCOMP_NCC
KDIAG=4
KH=2
KV=3
CALL PPMON_VMTHRM(MSIN(K+2,J), MSIN(K+3,J), Y,
+ NCP,IDX, NBOPST, KDIAG, KBASE, KPHI, KH, KS,
+ KG, KV, PHI, HMX, SMX, GMX, VMX, DPHI, CPMX,
+ DSMX, DGMX, DVMX, KER)
ELSE
INSTREAM(OFFSET+I) = MSIN(I,J)
END IF
END DO
END DO

But when I try to compile there is this error message:

mem2.f(145): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> ...
CALL PPMON_VISCV(MSIN(K+2,J), MSIN(K+3,J), Y, NCP,
------------------------------------------------------------^
mem2.f(146): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> ...
+ IDX, NBOPST, KDIAG,
-----------------------------------^
mem2.f(147): error #5276: Unbalanced parentheses
+ INSTREAM(OFFSET+I), RETCODE)
------------------------------------------^
mem2.f(153): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> ...
CALL PPMON_TCONV(MSIN(K+2,J), MSIN(K+3,J), Y, NCP,
-------------------------------------------------------------^
mem2.f(154): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> ...
+ IDX, NBOPST, KDIAG,
-----------------------------------^
mem2.f(155): error #5276: Unbalanced parentheses
+ INSTREAM(OFFSET+I), RETCODE)
------------------------------------------^
mem2.f(162): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> ...
CALL PPMON_VMTHRM(MSIN(K+2,J), MSIN(K+3,J), Y, NCP,
-------------------------------------------------------------^
mem2.f(163): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> ...
+ IDX, NBOPST, KDIAG, KBASE, KPHI, KH, KS, KG, KV, PHI,
---------------------------------------------------------------------^
mem2.f(164): error #5276: Unbalanced parentheses
+ HMX,SMX, GMX, VMX, DPHI, CPMX, DSMX, DGMX, DVMX, KER)
-------------------------------------------------------------------^
mem2.f(168): error #6099: An ENDDO statement occurred without a corresponding DO or DO WHILE statement.
END DO
^
mem2.f(169): error #6099: An ENDDO statement occurred without a corresponding DO or DO WHILE statement.
END DO
^
mem2.f(205): error #8093: A do-variable within a DO body shall not appear in a variable definition context. [J]
DO J=1, NMATO
---------^
mem2.f(205): error #6511: This DO variable has already been used as an outer DO variable in the same nesting structure. [J]
DO J=1, NMATO
---------^
mem2.f(207): error #8093: A do-variable within a DO body shall not appear in a variable definition context.
DO I=1, NUM_ROWS
-----------^
mem2.f(207): error #6511: This DO variable has already been used as an outer DO variable in the same nesting structure.
DO I=1, NUM_ROWS
-----------^
mem2.f(247): error #8093: A do-variable within a DO body shall not appear in a variable definition context. [J]
DO J=1, NCD
-------------^
mem2.f(247): error #6511: This DO variable has already been used as an outer DO variable in the same nesting structure. [J]
DO J=1, NCD
-------------^
mem2.f(254): error #8093: A do-variable within a DO body shall not appear in a variable definition context. [J]
DO J=1, 9
-------------^
mem2.f(254): error #6511: This DO variable has already been used as an outer DO variable in the same nesting structure. [J]
DO J=1, 9
-------------^
mem2.f(255): error #8093: A do-variable within a DO body shall not appear in a variable definition context.
I=NCD+J
------------^

I have checked if I didn't overcome the column 72 in my code. If you have any suggestions or tips feel free.
Thanks in advance.

 
You've got a F77 program - the code needs to start in column 7, and continuation lines in column 6
eg
Code:
      DO I=1, NUM_ROWS
         IF (I .EQ. K1) then 
             CALL SHS_CPACK(MSIN(1,J), NCP, IDX, Y, FLOW)
             KDIAG=4
             K= NCOMP_NCC
             CALL PPMON_VISCV(MSIN(K+2,J), MSIN(K+3,J), Y, NCP,
     +          IDX, NBOPST, KDIAG, 
     +          INSTREAM(OFFSET+I), RETCODE)
         ELSE
It would also help readability if you indent your code
 
Thank you for your help, I have corrected my continuation lines and now it works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top