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

strange syntax errors

j-simpson
Beginner
753 Views
I'm getting strange errors about the syntax of my code. The errors are copied below. As you can see, I tried using both ' and " and neither worked. Please help! I didn't get these errors with intel fortran for linux in other codes in which I had the exactsame lines written.
/lib/cpp -fpp -P -Dmpi=0 -Dsgi=0 -Dlinux=1 -Dibm=0 -Dmac_osx=0 ../source/kinds.F > kinds.F
/opt/intel/bin/ifort -CB -c -FR kinds.F
/lib/cpp -fpp -P -Dmpi=0 -Dsgi=0 -Dlinux=1 -Dibm=0 -Dmac_osx=0 ../source/grid_utilities.F > grid_utilities.F
/opt/intel/bin/ifort -CB -c -FR grid_utilities.F
/lib/cpp -fpp -P -Dmpi=0 -Dsgi=0 -Dlinux=1 -Dibm=0 -Dmac_osx=0 ../source/make_table.F > make_table.F
/opt/intel/bin/ifort -CB -c -FR make_table.F
fortcom: Error: make_table.F, line 35: Syntax error, found END-OF-STATEMENT when expecting one of: , )
FILE="../grid_centers/grid_centers_"
----------------------------------------------------^
fortcom: Error: make_table.F, line 36: Unbalanced parentheses
FORM="FORMATTED",STATUS="OLD")
-----------------------------------------------------------------------^
fortcom: Error: make_table.F, line 36: Syntax error, found ',' when expecting one of: ;
FORM="FORMATTED",STATUS="OLD")
----------------------------------------------------------^
fortcom: Error: make_table.F, line 36: Syntax error, found ')' when expecting one of: ;
FORM="FORMATTED",STATUS="OLD")
-----------------------------------------------------------------------^
fortcom: Error: make_table.F, line 45: Syntax error, found END-OF-STATEMENT when expecting one of: , )
FILE='../grid_connections/connections_'
----------------------------------------------------^
fortcom: Error: make_table.F, line 46: Unbalanced parentheses
FORM='FORMATTED',STATUS='OLD')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F, line 46: Syntax error, found ',' when expecting one of: ;
FORM='FORMATTED',STATUS='OLD')
----------------------------------------------------------^
fortcom: Error: make_table.F, line 46: Syntax error, found ')' when expecting one of: ;
FORM='FORMATTED',STATUS='OLD')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F, line 57: Syntax error, found END-OF-STATEMENT when expecting one of: , )
FILE='../grid_tables/tables_'
----------------------------------------------------^
fortcom: Error: make_table.F, line 58: Unbalanced parentheses
FORM='FORMATTED',STATUS='UNKNOWN')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F, line 58: Syntax error, found ',' when expecting one of: ;
FORM='FORMATTED',STATUS='UNKNOWN')
------------------------------------------------------^
fortcom: Error: make_table.F, line 58: Syntax error, found ')' when expecting one of: ;
FORM='FORMATTED',STATUS='UNKNOWN')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F, line 36: This name does not have a type, and must have an explicit type. [FORM]
FORM="FORMATTED",STATUS="OLD")
------------------------------------------^
fortcom: Error: make_table.F, line 36: This name does not have a type, and must have an explicit type. [STATUS]
FORM="FORMATTED",STATUS="OLD")
-----------------------------------------------------------^
compilation aborted for make_table.F (code 1)
make: *** [make_table.o] Error 1
0 Kudos
6 Replies
Steven_L_Intel1
Employee
753 Views
Check line length. My guess is you've gone past column 72.
0 Kudos
j-simpson
Beginner
753 Views
The line length is fine, especially since it is free form fortran.
0 Kudos
Steven_L_Intel1
Employee
753 Views
Your files have the .F file type, which are interpreted as fixed-form after being run through fpp.
0 Kudos
j-simpson
Beginner
753 Views
I get the same errors after I changed the .F to .F90 as shown below. It doesn't seem as though it could be an actual syntax issue, because the errors are occuring very early in the lines. (?)
/lib/cpp -fpp -P -Dmpi=0 -Dsgi=0 -Dlinux=1 -Dibm=0 -Dmac_osx=0 ../source/kinds.F90 > kinds.F90
/opt/intel/bin/ifort -CB -c -FR kinds.F90
/lib/cpp -fpp -P -Dmpi=0 -Dsgi=0 -Dlinux=1 -Dibm=0 -Dmac_osx=0 ../source/grid_utilities.F90 > grid_utilities.F90
/opt/intel/bin/ifort -CB -c -FR grid_utilities.F90
/lib/cpp -fpp -P -Dmpi=0 -Dsgi=0 -Dlinux=1 -Dibm=0 -Dmac_osx=0 ../source/make_table.F90 > make_table.F90
/opt/intel/bin/ifort -CB -c -FR make_table.F90
fortcom: Error: make_table.F90, line 34: Syntax error, found END-OF-STATEMENT when expecting one of: , )
OPEN (UNIT=17, FILE="../grid_centers/grid_centers_"
------------------------------------------------------^
fortcom: Error: make_table.F90, line 35: Unbalanced parentheses
FORM="FORMATTED",STATUS="OLD")
-----------------------------------------------------------------------^
fortcom: Error: make_table.F90, line 35: Syntax error, found ',' when expecting one of: ;
FORM="FORMATTED",STATUS="OLD")
----------------------------------------------------------^
fortcom: Error: make_table.F90, line 35: Syntax error, found ')' when expecting one of: ;
FORM="FORMATTED",STATUS="OLD")
-----------------------------------------------------------------------^
fortcom: Error: make_table.F90, line 44: Syntax error, found END-OF-STATEMENT when expecting one of: , )
FILE='../grid_connections/connections_'
----------------------------------------------------^
fortcom: Error: make_table.F90, line 45: Unbalanced parentheses
FORM='FORMATTED',STATUS='OLD')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F90, line 45: Syntax error, found ',' when expecting one of: ;
FORM='FORMATTED',STATUS='OLD')
----------------------------------------------------------^
fortcom: Error: make_table.F90, line 45: Syntax error, found ')' when expecting one of: ;
FORM='FORMATTED',STATUS='OLD')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F90, line 56: Syntax error, found END-OF-STATEMENT when expecting one of: , )
FILE='../grid_tables/tables_'
----------------------------------------------------^
fortcom: Error: make_table.F90, line 57: Unbalanced parentheses
FORM='FORMATTED',STATUS='UNKNOWN')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F90, line 57: Syntax error, found ',' when expecting one of: ;
FORM='FORMATTED',STATUS='UNKNOWN')
------------------------------------------------------^
fortcom: Error: make_table.F90, line 57: Syntax error, found ')' when expecting one of: ;
FOR M='FORMATTED',STATUS='UNKNOWN')
-----------------------------------------------------------------------^
fortcom: Error: make_table.F90, line 35: This name does not have a type, and must have an explicit type. [FORM]
FORM="FORMATTED",STATUS="OLD")
------------------------------------------^
fortcom: Error: make_table.F90, line 35: This name does not have a type, and must have an explicit type. [STATUS]
FORM="FORMATTED",STATUS="OLD")
-----------------------------------------------------------^
compilation aborted for make_table.F90 (code 1)
make: *** [make_table.o] Error 1
0 Kudos
Steven_L_Intel1
Employee
753 Views
The compiler itself doesn't recognize .F90, as far as I know. Make it .f90 and see what happens. fpp will process .F90 into a .f90 by default (I think - Linux is not my strong point), but it looks as if you are overriding that.

All the evidence I see points to a line length issue. If you can't solve the problem, file a support request with Intel Premier Support and attach a test case.
0 Kudos
j-simpson
Beginner
753 Views
OK, thanks for your help!
0 Kudos
Reply