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

Problems with lines longer than 72 characters

Martien_J
Beginner
2,249 Views
I have recently installed IVF8.1 and MS visual C++.net.
I have recreated two older projects which I maintained up to now by using
Fortran Power Station (I confess, a very late migration, which I should have
done much earlier). Both projects are of the console type. I need to use the
fixed format for these projects. Noting that IVF supports longer lines than
72 characters, I wanted to usethis option. Now I have some strange things:
1) project one still does not accept that I put something after column 72 (I
put the form line lenght at 132 at all source properties)
2) project two allows me to use column 72 up to 132, I use the same property setting as for project 1.
3) in both projects, the colouring scheme in the editor remains if it were
72 columns (i.e. column72 to 80 is gray, after 80 it is yellow).
I guess I have to apply some more settings, but I could not figure out how ?

A second question, the help files of IVF do not seem to have been integrated
with my IDE. If I press F1 for help on Fortran code or Fortran error
message, at its best I get some help on C++ subjects. What option do I have
to change at the IDE level to understand that I want help on Fortran ?

Thanks in advance,

Martien

0 Kudos
9 Replies
Steven_L_Intel1
Employee
2,249 Views
You should not use the source properties, but use the project properties instead. If the files have the .f or .for file type, they will be considered fixed-form by default.

The Intel help is not integrated into the IDE in this version. We will be adding integration in future versions. For now, use the documentation index shortcut under Start..Programs..Intel Software Development Tools..Intel Fortran Compiler 8.1.
0 Kudos
Martien_J
Beginner
2,249 Views
Thanks Steve for your quick respons.
I had actually set the linelength to 132 characters in the project properties and checked if all source properties inherited this linelength. Furthermore, all my sources used the .for filtype.So actuallythis was not the cause of the problem. Further looking, I did find the problem. One of my projects still had a $NOFREEFORM statement inside which I overlooked. It apparently also overrides the linelength property and brings it back to 72. After clearing this statement, I can work in all projects up to 132 characters on a single line.
Only one problem remains, columns 72 to 80 remain having a gray background and after 80 the background isyellow, which is a little bit confusing. Is there a method to switch this off.
Thanks,
Martien
0 Kudos
Steven_L_Intel1
Employee
2,249 Views
Put:

!DEC$ FIXEDFORMLINESIZE:132

at the beginning of your source files that have long lines. This will also eliminate the need to use a project option. The code colorizer understands this.
0 Kudos
benh
Beginner
2,249 Views


sblionel wrote:
Put:

!DEC$ FIXEDFORMLINESIZE:132

at the beginning of your source files that have long lines.




Now I'm curious to know whether there's a similar thing to do with "strict F90" code that has "fixed132". As I understand, conditional compilation and compiler options initiated with "!DEC$" are not acceptable in this case...

-+-Ben-+-
0 Kudos
Steven_L_Intel1
Employee
2,249 Views
Sorry, the two concepts are incompatible. If you are strict F90, your fixed form source lines do not exceed 72 characters.
0 Kudos
Martien_J
Beginner
2,249 Views
Thanks Steve
Setting the !DEC$ FIXEDFORMLINESIZE:132 indeed solved all my problems.
Martien
0 Kudos
benh
Beginner
2,249 Views


sblionel wrote:
If you are strict F90, your fixed form source lines do not exceed 72 characters.



In that cause, shouldn't IVF warn about this incompatibility?

Using (among others) the options
/warn:errors /extend_source:132 /stand:f90 /warn:truncated_source

it seems I get no such indication whatsoever.

-+-Ben-+-
0 Kudos
Steven_L_Intel1
Employee
2,249 Views
That's an interesting thought. We have traditionally taken the view that standards checking is there to alert you for when you unintentionally wrote code that was non-standard (in the cases where the compiler could detect it.) If you explicitly use switches to change the line length, then we figure you don't want warnings about that. In VAX Fortran, one could ask for standards checking with the exception of "source form" issues, such as tabs, $ in identifiers or long lines. We've considered bringing that back in the future.

The directive, however, is a source construct itself which is non-standard.
0 Kudos
benh
Beginner
2,249 Views
Having them all as command line parameters would be very nice! That way one could choose better which level of "strictness" to settle for. I for one would like to restrict newly written code as much as possible, but I still want to avoid having to do too much of trivial editing of legacy code (already working) just for the sake of compiling it.

Another good compiler switch related to this, that would be really nice to have, would be to _allow_ compiler directives like !DEC$, but still check the rest for F90 compliance. It can sometimes be hard/inconvenient to find ways around conditional compilation, for instance when compiling the same source with multiple compilers.

In the case of line length options, I naively assumed that 132 columns WAS allowed by the F90 standard, probably because the compiler accepted it as such. An informational message at the beginning of compilation would probably be the most appropiate response from the compiler in this case, IMHO.

-+-Ben-+-
0 Kudos
Reply