fortran - gfortran错误: Function 'inint' at (1) has no IMPLICIT type

标签 fortran gfortran

我正在使用 gfortran(来自 gcc-4.8.1)编译 .f90 源文件,并遇到错误:

Error: Function 'inint' at (1) has no IMPLICIT type

我做了一些搜索,发现 GNU website说 [ININT]

This intrinsic is not yet implemented. The name is, however, reserved as an intrinsic.

SGI documentation中,据说

ININT returns the nearest INTEGER*2 to its REAL*4 argument.

我的问题是:

ININT 是 Fortran77/90/95/2003 标准函数吗?

gfortran 中,为 INIT 编写替换函数的正确/符合标准的方法是什么?

最佳答案

我以前从未使用过ININT,而且它可能不符合任何标准。相反,我建议使用 NINT (FORTRAN 77),它采用可选的 KIND 参数 (Fortran 90):

RESULT = NINT(A [, KIND]) 

(取自 the GCC docs )

选择 KIND 来反射(reflect) INTEGER*2,无论它适合您的特定编译器...但是当您使用它时,请尝试 SELECTED_INT_KIND

关于fortran - gfortran错误: Function 'inint' at (1) has no IMPLICIT type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26201334/

相关文章:

c++ - 如何从公共(public) block 重新设计 Fortran 和 C++ 混合语言库 - 全局结构别名?

fortran - gfortran:使用实数作为数组索引

c++ - 将 C++ 与 BLAS 和 LAPACK 链接起来

python - 编译 forpy 以在 Fortran 中调用 Python 对象

fortran - GFortran 和 CodeBlocks 的模块和多个文件问题

fortran - "Unknown"处于打开状态的默认状态

c - Fortran 到 C 的翻译 - 神秘的除以一

使用指针从 Fortran 调用 C 函数

c++ - C/C++ 不透明指针库

fortran - 使用 Fortran 中的文件命名格式打开多个文件进行读取