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

Block Comments

kulachi
Beginner
991 Views
I was wondering if we can put block comments in Fortran files. For instance we can do it in C using /* ... */ and in MATLAB by using %{ ... %}.

-Kulachi
0 Kudos
5 Replies
onkelhotte
New Contributor II
991 Views

AFAIK this is not possible in IVF.

But you can "block comment" with the Visual Studio IDE. The Hotkey is Ctrl+E, Cand puts comment to all marked lines. Ctrl+E, U removes the comment.

Markus

0 Kudos
kulachi
Beginner
991 Views
Thanks! I never get to understand MSVS IDE. It would have been nice if Intel had a separate IDE for Fortran. Hope the next version of IVF would include this block comment facility.

Kulachi

0 Kudos
jimdempseyatthecove
Honored Contributor III
991 Views

Kulachi,

As a hack you can enable Preprocessing (FPP). FPP will recognize C style comments.

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
991 Views
The Fortran language does not contain a block comment syntax. You can do something like this (specific to the Intel compiler):

!DEC$ IF (.false.)
commented-out-stuff
!DEC$ END IF

Rather ugly, but it works and does not require enabling FPP.
0 Kudos
jimdempseyatthecove
Honored Contributor III
991 Views

>> !DEC$ IF (.false.)

Good point. Also doesn't clutter disk with .i90 files.

Jim

0 Kudos
Reply