Correct suffix for Fortran 2003 source file - Intel Fortran compiler

前端 未结 2 1901
情深已故
情深已故 2020-11-27 07:50

I\'ve written a small snippet of code, trying to adhere to the Fortran 2003 standard. The code is available on github.

This is my makefile:

FC = gfor         


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 08:28

    You can specify the source form used in a source file using the -free and -fixed ifort command line options, for free and fixed form respectively.

    As a separate issue, you can set the standard to issue diagnostics against using the -stand[:xxx] option. This doesn't change the code generated by the compiler, it just changes the diagnostics that the compiler issues. This is the equivalent of gfortran's -std=xxx option.

    As another separate issue, you can specify that the compiler should change its behaviour to match that specified using the Fortran standard using the -standard-semantics compiler option. This covers scenarios where the compiler's behaviour historically was different from what the Fortran standard has ended up requiring or recommending.

    As recommended in the comments and Vladimir's answer - the easiest option is to just use .f90 for any free form source file (which will be treated as free form source by ifort in the absence of the -fixed command line option), regardless of the standard that it has been written to.

提交回复
热议问题