- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page