Fortran中的IEEE_UNDERFLOW_FLAG IEEE_DENORMAL 77 [英] IEEE_UNDERFLOW_FLAG IEEE_DENORMAL in Fortran 77
问题描述
我是Fortran新手,一般编码,所以如果我的术语不正确,我很抱歉。
我正在使用带gfortran编译器的Linux机器。 p>
我今年夏天正在做研究,这涉及到我在1980年左右编写的程序再次运行。它是用Fortran 77编写的。我拥有所有的代码以及一些关于它的文档。
在目前的格式中,我收到了一个IEEE_UNDERFLOW_FLAG IEEE_DENORMAL错误。我的第一个想法是,这个代码是为了在不同的环境/体系结构下开发的。
文档指出:这个程序可以在HARRIS计算机系统上运行。它也可以在VAX系统上运行,如果单个精度变量在主代码和子程序包中都变成双精度变量。
我试着改变单精度变量来双精度变量,但我可能做错了。如果这是正确的做法,任何洞察力都会很棒。
我也尝试用-std = legacy和-m32编译编码。我也收到了同样的错误。
任何建议让我走向正确的方向将不胜感激。
IEEE_UNDERFLOW_FLAG IEEE_DENORMAL is signaling并不罕见。这是不是错误讯息。
含义是有非正常数字在运行代码时生成。
这可能是代码中数值问题的暗示,但它本身不是错误。
Fortran在其最新版本中要求所有发出信号的浮点异常在 STOP
语句被执行。请参阅 gfortran IEEE异常不正确 BTW,这也意味着您的程序未被编译为注意,即使您通过 -std = f95 $ c $请求Fortran 95标准,Fortran 77也可以作为Fortran 2003或更高版本。
$ b $ p
链接的答案还表示,避免这些警告的一种方法是不能通过 STOP
语句结束程序,而是通过运行直到 END PROGRAM
。如果您有类似的东西,那么您可以使用
STOP
END
或
STOP
END PROGRAM
在您的代码中,只要移除 STOP
,就没用了,如果没有,甚至是有害的。
你可能但你不必成功地通过使用双精度来摆脱这一点。如果算法中存在数值问题,即使有双打,他们也会呆在那里。但他们可能会变得不那么明显。或者他们可能不会,这取决于。您不必为此重写代码,只需使用 -fdefault-real-8
或 -freal-4-real-8
或类似。请阅读 gfortran手册。你甚至可以尝试四倍的精度,但通常对于所有合理的算法来说double都是足够的。
I am new to Fortran and coding in general so I apologize if my terminology is not correct.
I am using a Linux machine with the gfortran compiler.
I am doing research this summer which involves me getting a program written in about 1980 working again. It is written in Fortran 77. I have all the code as well as some documentation about it.
In its current form it I am receiving a "IEEE_UNDERFLOW_FLAG IEEE_DENORMAL" error. My first thought is that this code was meant to be developed under a different environment/architecture.
The documentation states "This program was designed to run on the HARRIS computer system. It also can be run on VAX system if the single precision variables are changed into double precision variables both in the main code and the subroutine package."
I have tried changing the single precision variables to double precision variables, but I may have done that wrong. If this is the correct thing to do any insight would be great.
I have also tried compiling the coding with -std=legacy and -m32. I receive the same error from this as well.
Any advice to get me going in the right direction would be greatly appreciated.
"IEEE_UNDERFLOW_FLAG IEEE_DENORMAL is signalling" is not that uncommon. It is NOT an error message.
The meaning is that there are denormal numbers generated when running the code.
It may be a hint about numerical problems in your code, but it is not an error per se. Probably it means that your program finished successfully.
Fortran in its latest edition requires that all floating point exceptions that are signalling be reported when a STOP
statement is executed. See gfortran IEEE exception inexact BTW, that also means that your program is not being compiled as Fortran 77 but as Fortran 2003 or higher.
Note that even if you request the Fortran 95 standard by -std=f95
the note is still displayed, but it can be controlled by the -ffpe-summary=list
flag.
The linked answer also says that a way to avoid these warnings is to not finish the program by a STOP
statement, but by running till the END PROGRAM
. If you have something like
STOP
END
or
STOP
END PROGRAM
in your code, just remove the STOP
, it is useless, if not even harmful.
You may but you don't have to be successful in getting rid of that by using double precision. If there are numerical problems in the algorithms, they will stay there even with doubles. But they may become less apparent. Or they might not, it depends. You don't have to re-write your code for that, just use -fdefault-real-8
or -freal-4-real-8
or similar. Read more about these options in your gfortran manual. You could even try quadruple precision, but double should normally be sufficient for all reasonable algorithms.
这篇关于Fortran中的IEEE_UNDERFLOW_FLAG IEEE_DENORMAL 77的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!