Error: Non-numeric character in statement at label (1)

前端 未结 1 2013
时光取名叫无心
时光取名叫无心 2020-12-05 07:06

This is the program I compile on ubuntu 14.04 using

f95 First.f -o First

and the program is

!My first program
program fir         


        
相关标签:
1条回答
  • 2020-12-05 07:46

    Rename your file from First.f to First.f90.

    You have encountered an issue which is easily avoided. Compilers generally assume that .f files are written in what is known as fixed source form, which has been obsolescent since Fortran 90. With the .f90 suffix your compiler should expect to encounter free source form and not complain as it has done. In fixed source form, cols 1-6 in each line are reserved for a (numeric) statement label.

    Now, use your favorite Fortran resources to understand, if you care, the differences between the two source forms.

    0 讨论(0)
提交回复
热议问题