Multiple statements on same line in FORTRAN 90

disruptive picture disruptive · Aug 4, 2011 · Viewed 10.8k times · Source

I have a whole series of assignments which I have put on the same ike using a ";" to seperate the statemnts but I get this error:

1.0; lb(1,9) 1 Error: Unclassifiable statement at (1) In file LJ.F90:223

I do not understand where there is coming from, when I have the code working if each statement is on its own line. The code is really simple...

What am I stupidly doing wrong.. below code is all on one line.

lb(1,1) = 1.0; lb(1,2) = 1.0; lb(1,3) = 1.0; lb(1,4) = 1.0; lb(1,5) = 1.0; lb(1,6) = 1.0; lb(1,7) = 1.0; lb(1,8) = 1.0; lb(1,9) = 1.0

Answer

Deditos picture Deditos · Aug 4, 2011

Your line of code is 134 characters long and, even with Fortran 90-style free format code, most compilers impose a maximum line length. For example, with Sun Studio the default limit is 132 characters.

You can usually increase this character limit using compiler flags, but I suggest splitting that code so that you have one statement per line. It is more legible to human readers and compile- and run-time error messages may be more easily diagnosed.