Robin Huda
Robin Huda

Reputation: 41

Meaning of a line after comment line starting with *

In the code below, the lines after the comment line start with *:

C REF: LANDOLT-B\RNSTEIN 2A-CP.209
*       DMUACD=+0.0020*XCOS(DEL)-0.0044*XSIN(ALP)
*       DMUACD=+0.0020*XCOS(DEL)-0.0044*XSIN(ALP)*xcos(del)
*       DMUD=-0.0044*XCOS(ALP)

What does these lines mean?

Upvotes: 2

Views: 413

Answers (1)

Steve Lionel
Steve Lionel

Reputation: 7267

In fixed-form Fortran (where the statement begins in column 7 and C in column 1 indicates a comment), an asterisk in column 1 also indicates a comment. In the snippet you have posted, all four lines are commented out, though different comment indicators are used, which certainly can be confusing. The asterisks could have been replaced with C for the same meaning.

As of Fortran 90, an exclamation point in column 1 also indicates a comment line (in both fixed and free form.)

Now, if the asterisk had been in column 6, it would have meant a continued line (any non-blank character other than the digit zero there would mean the same thing.) Vladimir (and "High Performance Mark") initially thought you were asking about that.

For more on source form, see my post Doctor Fortran in "Source Form Just Wants to be Free"

Upvotes: 3

Related Questions