Is there a way of disabling the line length limit in the gfortran compiler? I am porting from ifort to gfortran and I wonder if there is an easy way to do so without going through the code and introduce line continuation by hand everywhere where it is needed.
1) The Fortran (not FORTRAN) standard specifies that the maximum length of a free-form source line is 132 characters. Intel Fortran accepts up to 2048 characters on a single line. For fixed-form source, characters after column 72 are ignored.
If you want to read or write files compatible with earlier versions of gfortran, use -frecord-marker=8 . Specify the maximum length for a subrecord. The maximum permitted value for length is 2147483639, which is also the default. Only really useful for use by the gfortran testsuite.
Set column after which characters are ignored in typical free-form lines in the source file. The default value is 132. n may be ‘ none ’, meaning that the entire line is meaningful. -ffree-line-length-0 means the same thing as -ffree-line-length-none .
The default value is 132. n may be none, meaning that the entire line is meaningful. -ffree-line-length-0 means the same thing as -ffree-line-length-none . Specify the maximum allowed identifier length. Typical values are 31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
Investigate the options
-ffixed-line-length
-ffree-line-length
GCC manual:
-ffixed-line-length-n
Set column after which characters are ignored in typical fixed-form lines in the source file... Popular values for n include 72 (the standard and the default), 80 (card image), and 132 (corresponding to “extended-source” options in some popular compilers). n may also be ‘none’, meaning that the entire line is meaningful and that continued character constants never have implicit spaces appended to them to fill out the line.
-ffixed-line-length-0
means the same thing as-ffixed-line-length-none
.
-ffree-line-length-n
Set column after which characters are ignored in typical free-form lines in the source file. The default value is 132. n may be ‘none’, meaning that the entire line is meaningful.
-ffree-line-length-0
means the same thing as-ffree-line-length-none
.
I used -ffree-line-length-none
so that my extra long lines in the source code didn't cause errors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With