Intel® Fortran Compiler - effect of file extensions on source form

Submit New Article

Last Modified On :   October 1, 2008 3:51 PM PDT
Rate
 


The Intel® Fortran Compiler assumes that files with an extension of .f90 are free-form source files and
that files with a .f, .for, or .ftn are fixed-form source.

There is a discussion of file extensions in the compiler documentation under:
Building Applications > Input and Output Files > Understanding Input File Extensions

.f90 specifies Fortran free-form source and .f, .ftn, or .for specify Fortran fixed-form source.

The details of the source forms is in the compiler documentation under:
Language Reference > Program Structure, Characters, and Source Forms > Source Forms

You can use the /fixed (Windows) -fixed (Linux, Mac) compiler option to have all files treated as fixed-form source
or /free (Windows) -free (Linux, Mac) for free-form source.

You can also write your programs to be compatible with both source forms by following the recommendations
in the compiler documentation under:
Language Reference > Program Structure, Characters, and Source Forms > Source Forms > Source Code Useable for All Source Forms

 





This article applies to: Intel® Fortran Compiler for Linux* Knowledge Base,   Intel® Fortran Compiler for Mac OS X* Knowledge Base,   Intel® Visual Fortran Compiler for Windows* Knowledge Base