ifort continuation line limit

ifort continuation line limit

Does anyone know how to remove or change the max continuation line limit?

I have some code written for the 95 standard that requires an enormous number of continuation lines and I can't use ifort to compile it without receiving a "Too many continuation lines" error.

Any help would be greatly appreciated.

19 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Michael,

The Intel compiler allows up to 511 continuation lines. As you know, the standard calls for 39 continuation lines at 132 characters/line or 5280 characters.

Our 511 continuation line limit is an extension.

Must be a monster statement you have.


Yes, it IS a monster statement. I can split it up, but it would be quite tedious.

I seem to remember that fortran 77 could handle an infinite number of continuation lines.

Are you saying that there is indeed no fix for this 511 line limit?

511 continuation lines is our limit.

in Fortran 90 the Standard fixed the number of continuation lines at 39. So for compatibility, it is best to stick to this even though Intel allows 511.

Is there a compelling reason for more than that? We're always open to take feature requests for the future if there is a compelling reason.

I'm curious to see your usage. Is it a very large DATA statement or some such initialization statement?



Fortran 77 had a 19-continuation limit. Fortran 2003 allows 255 continuation lines in both source forms. As you can see from Ron's reply, we comfortably exceed that.

Retired 12/31/2016

It is not a data statement. Rather, it is an algebraic expression that was created using a symbolic math engine. The goal of the project is to create a model of helicopter rotor dynamics in closed form.

I'll just have my symbolic math engine expand the expression and then split it into 39 line chunks. Unfortunately, this will increase the already lengthy algebraic expression by at least a factor of 8.

g77 has no trouble with the multi-line expression but (of course) does not like some of the 95 standard content.

I would have to guess that your symbolic math engine is producing the expression by unrolling any loops into inline statements

do i=1,n
end do

is expressed as


and the results of which (formerly sum) is used where needed and as the result of expression. i.e. the output of the (expression).

This may also mean that, as an example, if the above sum were required in multiple places in the expression that you would have multiple occurances of the epression producing the sum.

Not wanting to have you throw out your symbolic math engine, you might find it desireable to write a pre-processor that takes the file from the symbolic math engine and parses it into something more digestible by Fortran, and in the process eliminate common sub-expressions (if present in current expression).

By the way, I have a son that is an engineer at Sikorski.

Jim Dempsey


Unfortunately, the simplified version of the expression is still too large... even with the types of substitutions you have mentioned.

Trust me that 39 continuation lines will be too few no matter what I do to the expression. We're dealing with well over 30 different variables that have been put through several rotation matrices and several integrations.

I just finished an internship at Sikorsky. Which department does your son work for?

He used to work in the fatigue lab. Now he is in avionics. His name is Patrick



Could you post a snipit of the expression? Say 30 lines worth



an excerpt:

T =
& 1./4.*rho*c*a*(1./32.*pi*(2.*(beta1s*cosis*pb-beta1c*
& qb+beta1s*sinis*rb)**2.*thetaT+8.*(beta0*cosis*pb+
& beta0*sinis*rb)**2.*thetaT-4.*beta1s*qb*(beta1c*cosis*
& pb+beta1c*sinis*rb)*thetaT+6.*(beta1c*cosis*pb+beta1c*
& sinis*rb)**2.*thetaT+6.*beta1s**2.*qb**2.*thetaT+16.*
& (Omega+sinis*pb-cosis*rb)**2.*thetaT-16.*beta1s*qb*
& (Omega+sinis*pb-cosis*rb)*thetaT+8.*beta0**2.*qb**
& 2.*thetaT+(16.*beta1c*cosis*pb+16.*beta1c*sinis*rb)*
& (Omega+sinis*pb-cosis*rb)*thetaT)/R*(R-e)**4.+1./24.*
& pi*((12.*beta1c*cosis*pb+12.*beta1c*sinis*rb)*(beta0*
& cosis*pb+beta0*sinis*rb)*theta1c*R+((-16.*beta0*qb*
& (beta1s*sinis*xH+beta1s*cosis*zH)-16.*beta1s*qb*(beta0*
& sinis*xH+beta0*cosis*zH)-16.*beta1s*qb*e+16.*(beta1s*
& sinis*pb+qb+beta1s*Omega-beta1s*cosis*rb)*beta1s*e)*
& (Omega+sinis*pb-cosis*rb)-16.*beta1s*qb*((beta0*Omega-
& beta0*cosis*rb+beta0*sinis*pb)*beta0*e+(sinis*pb-cosis*
& rb)*(beta0*sinis*xH+beta0*cosis*zH)-(beta0*sinis*pb-
& beta0*cosis*rb)*(sinis*xH+cosis*zH)+(Omega+sinis*pb-
& cosis*rb)*e))*thetaT+32.*((beta0*Omega-beta0*cosis*
& rb+beta0*sinis*pb)*beta0*e+(sinis*pb-cosis*rb)*(beta0*
& sinis*xH+beta0*cosis*zH)-(beta0*sinis*pb-beta0*cosis*
& rb)*(sinis*xH+cosis*zH)+(Omega+sinis*pb-cosis*rb)*
& e)*(Omega+sinis*pb-cosis*rb)*thetaT+((16.*(beta0*cosis*
& pb+beta0*sinis*rb)*((-cosis+beta1c*sinis)*xH
& beta1c*cosis)*zH)+16.*(beta1c*cosis*pb+beta1c*sinis*
& rb)*(beta0*sinis*xH+beta0*cosis*zH)-16.*((-cosis+beta1c*
& sinis)*pb+(-sinis-beta1c*cosis)*rb)*(beta0*cosis*xH-
& beta0*sinis*zH)+16.*(beta1c*cosis*pb+beta1c*sinis*
& rb)*e-16.*(-Omega*beta1c-(-sinis-beta1c*cosis)*rb-
& (-cosis+beta1c*sinis)*pb)*beta1c*e-16.*(beta0*sinis*
& pb-beta0*cosis*rb)*(beta1c*cosis*xH-beta1c*sinis*zH))*
& (Omega+sinis*pb-cosis*rb)+(16.*beta1c*cosis*pb+16.*
& beta1c*sinis*rb)*((beta0*Omega-beta0*cosis*rb+beta0*
& sinis*pb)*beta0*e+(sinis*pb-cosis*rb)*(beta0*sinis*
& xH+beta0*cosis*zH)-(beta0*sinis*pb-beta0*cosis*rb)*
& (sinis*xH+cosis*zH)+(Omega+sinis*pb-cosis*rb)*e))*
& thetaT+12.*((beta0*cosis*pb+beta0*sinis*rb)*((-cosis+
& beta1c*sinis)*xH-(-sinis-beta1c*cosis)*zH)+(beta1c*
& cosis*pb+beta1c*sinis*rb)*(beta0*sinis*xH+beta0*cosis*
& zH)-((-cosis+beta1c*sinis)*pb+(-sinis-beta1c*cosis)*
& rb)*(beta0*cosis*xH-beta0*sinis*zH)+(beta1c*cosis*
& pb+beta1c*sinis*rb)*e-(-Omega*beta1c-(-sinis-beta1c*
& cosis)*rb-(-cosis+beta1c*sinis)*pb)*beta1c*e-(beta0*
& sinis*pb-beta0*cosis*rb)*(beta1c*cosis*xH-beta1c*sinis*
& zH))*(beta1c*cosis*pb+beta1c*sinis*rb)*thetaT-4.*beta1s*
& qb*(beta0*cosis*pb+beta0*sinis*rb)*theta1c*R+8.*(beta0*
& cosis*pb+beta0*sinis*rb)**2.*theta0*R+6.*beta1s**2.*
& qb**2.*theta0*R+16.*(vb+(sinis*p


Yes, there are quantities that are repeated ( such as Omega+sinis*pb-cosis*rb ) but that is not of peak concern to me. Rather, it is the structure of the expression: multiple imbedded sets of parentheses that make the expanded version of the expression insanely large. The only way I can split this into 39 line chunks is to expand it so that I can break at a + or - every 39 lines.

Intel Fortran supports 511 continuation lines. I am not sure why you keep referring to 39. How many continuations do you have?

Retired 12/31/2016

The Fortran 90 standard has a hard limit of 39 continuation lines. See earlier posts in the thread.

I've read the earlier posts. Yes, the Fortran 90 and 95 standards have a 39-line limit for free-form source, which means only that if you exceed that, the program is non-standard. It does not mean that compilers can't accept more lines. As noted, the Intel compilers accept 511 continuation lines. If you turn on standards checking we'll warn you when you exceed the standard limit, but it's still allowed.

What are you asking for? What problem are you seeing? There's something I'm missing...

Retired 12/31/2016

I need more than 511 continuation lines. How is this confusing?

Only that you kept saying you didn't want to break up the statement into 39-line blocks and repeatedly referenced a "39-line hard limit". This is the first you've said that you have more than 511 continuation lines.

There is no way to exceed the 511 line limit, however, you can have much longer lines so perhaps that will work for you. The compiler accepts lines well over 1000 characters.

I will also comment that the compiler will probably require a lot of resources to compile such a massive statement. You should consider breaking it up into subexpressions.

Retired 12/31/2016

My apologies. I assumed that my first post made it clear that I was receiving a 'Too many continuation lines" error... obviously (or apparently not very obviously) implying that I had more than the 511 that ifort can handle.


Thanks for posting the sample of your code.

This is unusual to say the least. What I would suggest you do is to write a preprocessor that reduces the single expression into a series of statements or function calls.

It would be relatively easy to parse your file for statements that exceed a threshold of continuation lines and locate the largest span of text enclosed by (, ) and rework the code to

T_1 = (...)

Then loop back to beginning of line T_1= to reparse for lines too long. i.e. MUNG the source fiile. The line reductionpreprocessor could easily be modified to consolidate common sub expressions as well as perform the line reductions. This would be a relatively simple programming task.

Note, your "program" is what goes into the meta language. Adding the preprocessor (inter phase processor)is to be thought of as a compiler enhancement. (necessary evil).

Although it would be nice for you if some vendor'sFortran had no limit on the number of continuation lines. However, if you picked a compiler vendor simply based on the number of continuation lines you may have painted yourself into a corner.

Jim Dempsey



I've implemented that very idea already. Thanks for the advice!


Leave a Comment

Please sign in to add a comment. Not a member? Join today