在 fortran 90 中,if stop 语句是否需要结束 endif?
example:
if(foo.eq.1) stop
!do some stuff
do some stuff 是循环的一部分还是 stop 意味着程序结束时 endif ?
主要有两个地方(除了算术 if 之外)if
可以满足关键字。
首先是逻辑if语句
if (condition) statement_if_true
如果条件为真,则statement_if_true
被执行。后面的任何内容都不是 if 语句的一部分。没有then
and no end if
here.
其次是 if 条件结构
if (condition) then
body with statements
end if
正文可以包含任意数量的语句或结构,并且后面必须是end if
. The then
关键字对于构造是必需的,并且正文在then
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)