Fortran: difference between f and F extension

后端 未结 4 1578
再見小時候
再見小時候 2021-02-02 16:27

I\'m a bloody beginner in Fortran.

I wonder: what is the difference between the .f and .F extensions of Fortran files. I know that muc

4条回答
  •  孤城傲影
    2021-02-02 17:17

    As far as I know, .f and .F are both extensions associated with the FORTRAN 77 fixed format. Fixed format is limitted to 72 columns, where the first six columns serve special purposes. E.g. a & at position 6 indicates a line continuation from the previous line.

    Free-form was introduced with Fortran 90 and is typically indicated by .f90 and .F90. For free-form you can use up to 132 columns, and no special columns exist. Line continuation is indicated by an ampersand at the end of the line.

    Capital letters in the file extension usually turn the pre-processor on.

    Note that these are conventions that can be overridden with compile options for most compilers.

提交回复
热议问题