Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gfortran line length limit

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.

like image 213
DaPhil Avatar asked Oct 11 '13 06:10

DaPhil


People also ask

What is the maximum length of a single line in Fortran?

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.

What is the maximum length of a GFortran file?

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.

What is-ffree-line-length-0?

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 .

What is the default value of -ffree-line-length-0?

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).


2 Answers

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.

like image 85
High Performance Mark Avatar answered Sep 21 '22 08:09

High Performance Mark


I used -ffree-line-length-none so that my extra long lines in the source code didn't cause errors

like image 35
glwhart Avatar answered Sep 21 '22 08:09

glwhart