我是Fortran的新手。我有一个用非标准版本的Fortran编写的文件,该文件是为Lahey-Fujitsu编译器编写的,并使用专有的数值库IMSLF90(请参阅我的上一篇文章here)。我们将该文件称为test.f
。 IMSLF90中有一个可以转换矩阵的函数。如果我注释掉那些矩阵求逆,则可以使用ifort
或gfortran
编译源代码。我无权访问IMSLF90,并且正在寻找一种从某些库引入矩阵求反函数的方法。我尝试使用ce-fortran.com中提供的工具箱(我是Fortran的新手,对此一无所知)。
我的问题是,当我在文件顶部include "toolbox.f90"
并用use IMSLF90
替换use toolbox
文件中的test.f
时(并修改了{ {1}}到.i. x
),然后尝试编译,编译器抱怨:
lu_invert(x)
我认为正在发生的事情是,顶部的ifort test.f -o test.out
toolbox.f90(21): error #5149: Illegal character in statement label field [m]
module toolbox
^
toolbox.f90(21): error #5149: Illegal character in statement label field [o]
module toolbox
-^
toolbox.f90(21): error #5149: Illegal character in statement label field [d]
module toolbox
--^
toolbox.f90(21): error #5149: Illegal character in statement label field [u]
module toolbox
---^
toolbox.f90(21): error #5149: Illegal character in statement label field [l]
module toolbox
----^
toolbox.f90(21): error #5118: First statement in file must not be continued
module toolbox
-----^
toolbox.f90(30): error #5149: Illegal character in statement label field [i]
implicit none
^
toolbox.f90(30): error #5149: Illegal character in statement label field [m]
implicit none
-^
toolbox.f90(30): error #5149: Illegal character in statement label field [p]
implicit none
--^
toolbox.f90(30): error #5149: Illegal character in statement label field [l]
implicit none
---^
toolbox.f90(30): error #5149: Illegal character in statement label field [i]
implicit none
----^
toolbox.f90(33): error #5149: Illegal character in statement label field [p]
private
^
toolbox.f90(33): error #5149: Illegal character in statement label field [r]
private
-^
toolbox.f90(33): error #5149: Illegal character in statement label field [i]
private
--^
toolbox.f90(33): error #5149: Illegal character in statement label field [v]
private
---^
toolbox.f90(33): error #5149: Illegal character in statement label field [a]
private
----^
toolbox.f90(36): error #5149: Illegal character in statement label field [r]
real*8, private :: starttime_cpu
^
toolbox.f90(36): error #5149: Illegal character in statement label field [e]
real*8, private :: starttime_cpu
-^
toolbox.f90(36): error #5149: Illegal character in statement label field [a]
real*8, private :: starttime_cpu
--^
toolbox.f90(36): error #5149: Illegal character in statement label field [l]
real*8, private :: starttime_cpu
---^
toolbox.f90(36): error #5149: Illegal character in statement label field [*]
real*8, private :: starttime_cpu
----^
toolbox.f90(39): error #5149: Illegal character in statement label field [l]
logical, private :: tbox_seed = .true.
^
toolbox.f90(39): error #5149: Illegal character in statement label field [o]
logical, private :: tbox_seed = .true.
-^
toolbox.f90(39): error #5149: Illegal character in statement label field [g]
logical, private :: tbox_seed = .true.
--^
toolbox.f90(39): error #5149: Illegal character in statement label field [i]
logical, private :: tbox_seed = .true.
---^
toolbox.f90(39): error #5149: Illegal character in statement label field [c]
logical, private :: tbox_seed = .true.
----^
test.f(41): catastrophic error: Too many errors, exiting
compilation aborted for test.f (code 1)
语句实际上将include
中的代码“写入”到toolbox.f90
的主要源代码中,并且由于它们没有遵循相同的Fortran标准,编译器会感到困惑。
我该如何解决?