- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
thanks
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would have to guess that your symbolic math engine is producing the expression by unrolling any loops into inline statements
sum=0.0
do i=1,n
sum=sum+array(i)
end do
is expressed as
(array(1)+array(2)+...array(n))
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
He used to work in the fatigue lab. Now he is in avionics. His name is Patrick
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you post a snipit of the expression? Say 30 lines worth
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 -(-sinis-
& 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 b-cosis*rb)*((-cosis+
...
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are you asking for? What problem are you seeing? There's something I'm missing...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Michael,
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 = (...)
T=...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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've implemented that very idea already. Thanks for the advice!
Michael

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page