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

Number of characters in one line in free-format in Fortran90

Nazmul_I_1
Einsteiger
2.468Aufrufe

Does Fortran90 allow to write more than 132 charactes in a line in free-format? If I write more than 132 characters in a line in free-format Fortran90, what will happen then?

0 Kudos
6 Antworten
DavidWhite
Geschätzter Beitragender II
2.468Aufrufe

According to the documentation, compiler limits are:

Fortran source line length fixed form: 72 (or 132 if /extend_source is in effect) characters;

free form: 7200 characters

However, for readability and code maintenance, I would suggest shorter lines are best!

Nazmul_I_1
Einsteiger
2.468Aufrufe

Thanks, David White for your valuable information!

andrew_4619
Geehrter Beitragender III
2.468Aufrufe

Enforcing standards for free form warns for over 132 (or is it 128?).

Steven_L_Intel1
Mitarbeiter
2.468Aufrufe

132 is what the standard says.

Nazmul_I_1
Einsteiger
2.468Aufrufe

Thanks Steve Lionel for giving the information. However, can you tell me that what will happen if I write more than 132 character in one line?

Steven_L_Intel1
Mitarbeiter
2.468Aufrufe

By default, it will work fine. We support, as an extension, a much longer line. If you ask for standards warnings, you'll get a warning.

I'd discourage you from doing this, though, as it's not portable.

Antworten