Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
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: Syntax error

milenko1976
Beginner
4,806 Views
I have this:
ifort -c main.f -o main.o
main.f(15): error #5082: Syntax error, found IDENTIFIER 'OPEN' when expecting one of: ;
open(2, file='fexp.dat',status='unknown'). open(3, file='fmodel.dat',status='unknown')
--------------------------------------------------------^
main.f(15): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ) :: , + . - % : . ** / // .LT. < .LE. <= .EQ. == .NE. ...
open(2, file='fexp.dat',status='unknown'). open(3, file='fmodel.dat',status='unknown')
---------------------------------------------------------------------------------------------------^
open(2, file='fexp.dat',status='unknown')
open(3, file='fmodel.dat',status='unknown')
Why?
0 Kudos
1 Reply
Hirchert__Kurt_W
New Contributor II
4,806 Views
The name of the file you are trying to compile has the extensions .f . By default, ifort treats files with this extension as having the Fortran fixed source form (statement number in columns 1-5, continuation marks in 6, statement text in 7-72). It is difficult to be certain from what you posted, but I suspect the file contains statements written in the free source form. In particular, I suspect the statements begin before column 7. Interpreted in the fixed source form, these statements appear to be continuations of the statement before them, resulting in odd syntax errors.

If this is the source of the problem, you can fix the problem either by renaming the file to have an extension that is assumed to be free form by default (e.g., .f90) or by adding an option to the command line to explicitly tell it that the file is free form.

-Kurt
0 Kudos
Reply