English 中文(简体)
FORTRAN 汇编者警告:过时的算术 IF 声明
原标题:FORTRAN compiler warning: obsolete arithmetic IF statement
  • 时间:2012-05-25 17:33:31
  •  标签:
  • gfortran

我有一个护身符错误:

Warning: Obsolete: arithmetic IF statement at (1) 

这是什么意思?

66 s12 = max(epsilon, s1 + s2)
c Then execution will go to label 13. Will this stop any further problems?
if (s12 - 1.0) 13, 13, 12
13 z = s1 / s12
最佳回答

如果是FORTRAN的一个特殊特征,则具有神学性质

其作用如下。

 IF (expr) label1, label2, label3

如果表达式的值是

less than 0, jump to label1 
equal to 0, jump to label2
greater than 0, jump to label3

在新的FORTRAN标准中,这一特点已经过时

在您的代码代码中,您可以替换为

      IF (s12 - 1.0 .gt. 0 ) GOTO 12
13    z = s1 / s12
问题回答

检查此处 :

http://www.ibiblio.org/pub/langues/fortran/ch1-5.html

"自学的IF被认为有害。"

你的发言:

if (s12 - 1.0) 13, 13, 12 是一个自定义化的 IF, 被视为无效编程 。

http://en.wikipedia.org/wiki/Arithmedic_IF" rel="nofollow" >wikipedia :

"... 堡垒声明界定了三个不同的分支 取决于一个表达方式的结果是负的,零的,还是正的..."

终于在90号堡被贴上了 白种人的名字"





相关问题
How to debug command line file with symbolic data

I have a compiled .exe file (compiled with gfortran and -g option) that crashes. I can attach the WinDBG program to it using the WinDBG -I command. Funny enough it generates a stack overflow: (38f0....

Pre-processing !DEC$ directives in gfortran

I ve got a large Fortran codebase that originally targeted Intel s compiler. I m now gearing up to compile with gfortran. Unfortunately, the code is littered with Intel-style pre-processing directives ...

how I can find out, which compiler I have used

I have installed NetCDF "binary-netcdf-4.0.1_gfortran_gfortran_c++.tar ". But I am not sure about the gfortran compiler I have used. How can I find the compiler I have used?

gfortran, DLL, underscore

I want to access some subroutines from a third party DLL. The functions use STDCALL as the calling convention. Running dumpbin /export foo.dll gives me something like: ... 7 6 ...

Fortran bus error on mac

The following Fortran code is giving me a bus error on my Mac but no errors when I run it on my Linux machine: PROGRAM TINY WRITE(UNIT=*, FMT=*) Hello, world! END My understanding is that a ...

Xcode with fortran

I m trying to compile some fortran files in Xcode, using a makefile made by me. The problem is that Xcode can t find gfortran compiler. I have it, because if I go to console and try to compile from ...

热门标签