转换包含 MODULE 的 fortran 文件时出现问题
我正在使用 f2c 转换 Fortran 文件。该文件包含模块的定义,我无法转换它。错误是 machine.f 第 1 行错误:无法分类的语句(以“modulemach”开头)
该文件粘贴在下面:
MODULE MACHINE
IMPLICIT NONE
SAVE
! Machine dependant constants
integer, parameter :: kind_io4 = 4, kind_io8 = 8 , kind_ior = 8
&, kind_evod = 8, kind_dbl_prec = 8
&, kind_rad = selected_real_kind(13,60) !the '60' maps to 64-bit real
&, kind_phys = selected_real_kind(13,60) ! the '60' maps to 64-bit real
&, kind_REAL = 8 ! used in cmp_comm
&, kind_INTEGER = 4 ! -,,-
real(kind=kind_evod), parameter :: mprec = 1.e-12 ! machine precision to restrict dep
END MODULE MACHINE
任何帮助将不胜感激!
谢谢
I am converting a Fortran file using f2c. The file contains the definition of a MODULE, and I am unable to convert it. The error is Error on line 1 of machine.f: unclassifiable statement (starts "modulemach")
The file is pasted below:
MODULE MACHINE
IMPLICIT NONE
SAVE
! Machine dependant constants
integer, parameter :: kind_io4 = 4, kind_io8 = 8 , kind_ior = 8
&, kind_evod = 8, kind_dbl_prec = 8
&, kind_rad = selected_real_kind(13,60) !the '60' maps to 64-bit real
&, kind_phys = selected_real_kind(13,60) ! the '60' maps to 64-bit real
&, kind_REAL = 8 ! used in cmp_comm
&, kind_INTEGER = 4 ! -,,-
real(kind=kind_evod), parameter :: mprec = 1.e-12 ! machine precision to restrict dep
END MODULE MACHINE
Any help will be appreciated!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只使用过几次 f2c,并没有太多经验,但它不是一个将 Fortran 77 代码转换为 C 代码的工具吗?
模块是 Fortran 90 中引入的 Fortran 功能,它们不是 Fortran 77 的一部分(以及可移植精度,例如 KIND 和其他一些东西),我不知道 C 是否有这些功能的模拟。肯定有人会向我澄清这一点。
I've used f2c on a few occasions only, and don't have much experience with it, but isn't it a tool for converting Fortran 77 code to C?
Modules are a Fortran feature that were introduced in Fortran 90, and they are not part of Fortran 77 (along with portable precision, e.g. KIND and some other stuff), and I don't know if C has an analog for those features. Somebody will surely clarify me on that.