Maximum number of gfortran sequels
I need a little help: According to this site , there is a limit on the maximum number of continuation lines.
So I decided to check it out. I wrote a jumbo FUNCTION
where it calculates a colossal algebraic formula expressed in an expression divided into 17,146 continuation lines.
!test.f90 1.6 MB file
DOUBLE COMPLEX FUNCTION myfunction(a, b)
DOUBLE COMPLEX, INTENT(IN) :: a
DOUBLE COMPLEX, INTENT(IN) :: b
myfunction = gd0/16.d0)*a*b*((a+b)**2)*((32.d0*DCONJG(f(4)))+(12&
&8.d0*DCONJG(f(11)))+(160.d0*DCONJG(f(24)))+(64.d0*DCONJG(f(46)))+(32.d0*DCONJG(f(3)))+(256.d0*DCON&
&JG(f(10)))+(480.d0*DCONJG(f(23)))+(256.d0*DCONJG(f(45)))+(32.d0*DCONJG(g(9)))+(128.d0*DCONJG(f(&
&9)))+(480.d0*DCONJG(f(22)))+(384.d0*DCONJG(f(44)))+(96.d0*DCONJG(g(21)))+(160.d0*DCONJG(f(21)))+(2&
&56.d0*DCONJG(f(43)))+(64.d0*DCONJG(g(42)))+(64.d0*DCONJG(f(42)))+(64.d0*DCONJG(f(8)))+(192.d0*DCON&
& (64.d0*DCONJG(g(42)) ! and so on and so forth...
END FUNCTION
I put together this abomination with help gfortran -c test.f90
and after 5 minutes it returned the 11.4MB file test.o
without any errors or warnings. I ran it and it returned the correct results.
Why not gfortran
following the maximum continuation length rule?
source to share
Why doesn't gfortran follow the maximum continuation rule?
This rule is not a restriction, the compiler is allowed by the standard to provide more restriction as an extension, the standard sets a minimum for the maximum number of continuation lines. The compiler may report exceeding the standard minimum, but it is not required and may require a flag.
source to share