Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fortran 错误:标签处语句中的非数字字符(1)_Fortran - Fatal编程技术网

Fortran 错误:标签处语句中的非数字字符(1)

Fortran 错误:标签处语句中的非数字字符(1),fortran,Fortran,这是我在ubuntu 14.04上使用 f95 First.f -o First 这个节目是 !My first program program first print *,'This is my first program' end program first 我得到以下错误 Error:Non-numeric character at statement label at (1) First.f:2.1: program first 如何解决此错误?将文件从First.f重命名为Fi

这是我在ubuntu 14.04上使用

f95 First.f -o First
这个节目是

!My first program
program first
print *,'This is my first program'
end program first
我得到以下错误

Error:Non-numeric character at statement label at (1)
First.f:2.1:

program first

如何解决此错误?

将文件从
First.f
重命名为
First.f90

您遇到了一个容易避免的问题。编译器通常假定
.f
文件是以固定源代码形式编写的,这种形式自Fortran 90以来就已经过时了。使用
.f90
后缀,编译器应该会遇到免费的源代码形式,而不是像以前那样抱怨。在固定源格式中,每行中的列1-6保留用于(数字)语句标签


现在,如果您愿意的话,请使用您最喜欢的Fortran资源来了解这两种源代码形式之间的差异。

我正在尝试使用gfortran-9和最新的2018标准自学Fortran。每个Fortran标准都有特定的扩展吗?