FORTRAN编译器警告:过时的算术IF语句 [英] FORTRAN compiler warning: obsolete arithmetic IF statement

查看:155
本文介绍了FORTRAN编译器警告:过时的算术IF语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gfortran错误:

I have a gfortran error:

Warning: Obsolete: arithmetic IF statement at (1) 

这是什么意思?在来源(旧来源)中:

What does this mean? In the source (old source):

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的特殊功能

Arithmetic if is a peculiar feature of 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标准中,此功能已过时

In newer FORTRAN standards this feature is obsolete

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

In your code you can replace it with

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

这篇关于FORTRAN编译器警告:过时的算术IF语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆