Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Severe: Statement too long

ars_met
Beginner
1,600 Views
Hello. My problem is it topic. When compiling I have an error "Severe: Statement too long"
What is the restriction and does a way to solve the problem exist?

It appears in a long equation, and to cut part of equation is impossible...
Thank you
0 Kudos
9 Replies
Steven_L_Intel1
Employee
1,600 Views

How long is the equation? The compiler accepts 511 continuation lines, but there is an internal limit on the number of "tokens" in a single statement and I think you overflowed it. Which compiler version are you using? Can you attach the source file with this long statement? (See below for attachment instructions.)

You may be able to split the equation with assignments to temporary variables.
0 Kudos
ars_met
Beginner
1,600 Views

How long is the equation? The compiler accepts 511 continuation lines, but there is an internal limit on the number of "tokens" in a single statement and I think you overflowed it. Which compiler version are you using? Can you attach the source file with this long statement? (See below for attachment instructions.)

You may be able to split the equation with assignments to temporary variables.
I attach the source file. Equation is about 560 lines, among 28 equations 2 of them are of that length. It's differential equations which have to meet really high precission, so I can't cut the digits. But even if I keep only 2 digits in all coefficients - it's still too long...
I use Fortran 6.0
0 Kudos
Steven_L_Intel1
Employee
1,600 Views
Oh my - vintage 1998! Anyway, I think this source would compile with Intel Visual Fortran 11 once the number of continuation lines was brought under control. This would require conversion to free-form source (a .f90 file) and changing the continuation indicators. I'll try this tomorrow. My recollection is that we dramatically increased the internal limit on tokens some years ago.
0 Kudos
ars_met
Beginner
1,600 Views
Oh my - vintage 1998! Anyway, I think this source would compile with Intel Visual Fortran 11 once the number of continuation lines was brought under control. This would require conversion to free-form source (a .f90 file) and changing the continuation indicators. I'll try this tomorrow. My recollection is that we dramatically increased the internal limit on tokens some years ago.
Ok, thanks a lot, looking to hear from you tomorrow.
0 Kudos
Steven_L_Intel1
Employee
1,600 Views
Aren't program-generated sources wonderful? (Not...)

Anyway, here's your source converted to free-form. It compiles with Intel Fortran 11, but probably won't with DVF 6.0.
0 Kudos
ars_met
Beginner
1,600 Views
Aren't program-generated sources wonderful? (Not...)

Anyway, here's your source converted to free-form. It compiles with Intel Fortran 11, but probably won't with DVF 6.0.
Thanks.
Yes, it doesn't compile with DVF6.0, but if it compiles with Intel Fortran 11 - than it's time to speak with boss about possibility to buy it or to check if we have it already, maybe at another department...
Thanks a lot again
0 Kudos
anthonyrichards
New Contributor III
1,600 Views
Quoting - ars_met
Thanks.
Yes, it doesn't compile with DVF6.0, but if it compiles with Intel Fortran 11 - than it's time to speak with boss about possibility to buy it or to check if we have it already, maybe at another department...
Thanks a lot again
Why not take Steve's free-format version and cut it into several smaller components of 30 or so lines each. e.g.

eq1pA= [30 lines, selecting the last line as one ending "+ &", and deleting the'" + &" and adding a carriage return]

eq1pB= [next 30 lines, and so on].

Finally add the line

eq1p = eq1pA + eq1pB + etc. etc.

I have done this and the result compiles using CVF.
0 Kudos
Steven_L_Intel1
Employee
1,600 Views
The issue isn't the length of the statement - at least not with the free-form version I supplied that doubled-up the lines to get under the 511 limit. It's an internal limit in the compiler parser that was raised significantly sometime after DVF 6.0.

However, Tony's suggestion of using intermediate variables would get around this. On the other hand, it's a lot of manual effort (which is easy to make mistakes in) and might give slightly different results. Using a compiler from this century would be better, in my (biased) opinion.
0 Kudos
gib
New Contributor II
1,600 Views
The issue isn't the length of the statement - at least not with the free-form version I supplied that doubled-up the lines to get under the 511 limit. It's an internal limit in the compiler parser that was raised significantly sometime after DVF 6.0.

However, Tony's suggestion of using intermediate variables would get around this. On the other hand, it's a lot of manual effort (which is easy to make mistakes in) and might give slightly different results. Using a compiler from this century would be better, in my (biased) opinion.
Those last century compilers are so old hat!
0 Kudos
Reply