Asterisk and Fortran statement

寵の児 提交于 2019-12-13 08:27:07

问题


I have a Fortran 77 code that shows a comment in the first column and written double precision in the same line. now my text editor (Notepad++) is showing that as a statement. I am confused if it is a statement or a comment.

*   double precision Ct,Jt,PDt,AeA0t,Zt,Cq,Jq,PDq,AeA0q,Zq,
*   &Kt,Kq,Eta,J,PD,AeA0

回答1:


It's a comment. If there's anything other than a whitespace in the first column of a line in a fixed-form fortran (That is Fortran up to F77), it's a comment.

These variables are not declared, but if the code doesn't have an implicit none, they would be implicitly declared, some as REAL, some as INTEGER.




回答2:


First, the text editor syntax highlighting is not something you can trust 100%. It is just there to help you, but it can be wrong and it can differ from an editor to an editor.

Second, if that code compiles, it must be a comment. Otherwise the ampersand & would cause an error. The ampersand can be used in the sixth column to continue the previous line, but it has to be the first character of the line.



来源:https://stackoverflow.com/questions/39423218/asterisk-and-fortran-statement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!