Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do block comment in fortran?

Tags:

I have seen /* block comment */ for block commenting in C++. I know I can do line commenting by using ! or c, but is there any option for block commenting in Fortran?

like image 949
user22180 Avatar asked Feb 26 '14 18:02

user22180


People also ask

How do I comment in Fortran 90?

In Fortran 90 free source form means you are free to type comments and commands wherever you want. An exclamation point, ! (also known as a "bang"), is used to indicate a comment statement. The comment statement follows the bang and continues to the end of the line.

How do you write a block comment?

Everything from the // to the end of the line is a comment. To mark an entire region as a comment, use /* to start the comment and */ to end the comment. * This is a block comment. * This code does nothing.

How would you indicate a comment in Fortran?

A line that begins with the letter "c" or an asterisk in the first column is a comment. Comments may appear anywhere in the program. Well-written comments are crucial to program readability. Commercial Fortran codes often contain about 50% comments.


2 Answers

No, the strange concept of block comments is alien to Fortran. Your editor or development environment might provide a way to comment a block of lines in one go.

like image 79
High Performance Mark Avatar answered Oct 27 '22 23:10

High Performance Mark


You can do a little hack though:

go to 100  ! CHUNK OF CODE YOU WANT TO COMMENT OUT 100 continue 

Yeah, I know it's horrible but it works. :)

like image 34
Kbzon Avatar answered Oct 27 '22 23:10

Kbzon