Error in implicit declaration in Fortran

喜你入骨 提交于 2021-02-05 09:30:51

问题


I have checked all the formats of the implicit type declaration but have not been able to find out the error in the following line . I have been running the code using f77 to compile this.

implicit real*4 (a-h,o-z)

while running the program it gives the following error for the above statement.

implicit real*4 (a-h,o-z)

               1

Error: Unexpected character in variable list at (1)


回答1:


A few basic rules if you are using F77 or earlier versions.

  1. Put the implicit line first
  2. Columns 1-5 are for labels
  3. Column 6 is for continuation
  4. Start the code in column 7
  5. The code should not go past column 72. Some compilers have an option to extend the line length to 80 or 120 or 132 (widths of line printers when F77 first came out)

If you wish to use free format, use one of the later versions of fortran



来源:https://stackoverflow.com/questions/32109427/error-in-implicit-declaration-in-fortran

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