Fortran 程序编译时错误 Error: Non-numeric character in statement label at (1)

mpif90 -c -Wall -Wno-unused-variable -g -I/opt/petsc-3.1-p7/include -I/opt/petsc-3.1-p7/include -I/usr/local/include -I/opt/petsc-3.1-p7/include -I/usr/local/include -o Demo1.o Demo1.F In file Demo1.F:13 subroutine Demo1() 1 Error: Non-numeric character in statement label at (1)  

 

*.f90文件,在PETSc库中编译的

出现上述错误的原因:子例程"subroutine Demo1()"声明没有缩进!居然……我凌乱了……

 

 

还有一种方法,加上编译选项 gfortran  -ffree-form,没试过,但觉得比较靠谱。

 

你可能感兴趣的:(Fortran 程序编译时错误 Error: Non-numeric character in statement label at (1))