- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to compile this program?
PROGRAM HELLO
WRITE(*,1)
1 FORMAT('Hello World')
END
ifort doesn't like the FOR in columns 4,5,and 6. I have some source (hundreds of files) that is fixed format but labelled lines like format and continue don't start in column 7.
Illegal character in statement label field is the error the compiler gives.
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By default, the format (fixed or free format) is determined by the Fortran file extension. Files with an extension of .f90, .F90, or .i90 are free-format source files. Files with an extension of .f, .for, .FOR, .ftn, .FTN, .fpp, .FPP, or .i are fixed-format files. You can also compile with the -free option to specify to the compiler that source files are in free format, or the -fixed option to specify that the source files are in fixed format.
I created a little test.f90 file with your code and compiled it with just "ifort" which defaults to free format because of the .f90 file extension. So depending on your file extension(s) you may need to compile some or all of them with the -free switch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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