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

Changing "Fixed Source Line Length" with mixed "Source File Formats"

sea_bwe
Beginner
751 Views
I have project containing both fixed source linefiles and free format files.
If i change "Fortran > Language > Fixed Form Line Length" from " 72 Columns" to "80 Columns (/extend_source:80)" the free formatfiles is no longer recogniced as free format but as fixed format by the compiler.
The "Fortran > Language > Source File Format" is set to" Use File Extension"
0 Kudos
4 Replies
Steven_L_Intel1
Employee
751 Views
  1. Don't do that. Rewrite the fixed-form files so that they conform to the 72-colum limit or, if possible, convert to free-form source for additional error-detection benefits
  2. Don't set the size on the whole project, but rather on the individual source files that need it
  3. Use !DEC$ FIXEDFORMLINESIZE:80 at the start of sources that need it.
0 Kudos
rase
New Contributor I
751 Views
Just to be sure: It is not possible to have free and fixed format subroutines in one file. Correct?

Converting from one format into the other (both directions) can be done automatically with pretty printing software. I use plusfort by polyhedron software for that purpose.
0 Kudos
Steven_L_Intel1
Employee
751 Views
We support directives to switch back and forth among source forms in a single file, but this is generally used only for dealing with include files. I cannot recommend its general use in source code. One can also write source that is valid for both source forms - details are in the Intel language reference.

I can't imagine why one would want to convert free-form source to fixed-form...
0 Kudos
rase
New Contributor I
751 Views
There are still hardcore Fortran lunatics somewhere in the woods who insist on using fixed format they got accustomed to in the sixties...like me;-)
0 Kudos
Reply