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

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

Nazmul_I_1
Beginner
1,754 Views

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 Replies
DavidWhite
Valued Contributor II
1,754 Views

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!

0 Kudos
Nazmul_I_1
Beginner
1,754 Views

Thanks, David White for your valuable information!

0 Kudos
andrew_4619
Honored Contributor III
1,754 Views

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

0 Kudos
Steven_L_Intel1
Employee
1,754 Views

132 is what the standard says.

0 Kudos
Nazmul_I_1
Beginner
1,754 Views

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?

0 Kudos
Steven_L_Intel1
Employee
1,754 Views

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.

0 Kudos
Reply