如何让 gfortran 进行 INTEGER - LOGICAL 转换
根据 this,gfortran 可以进行整数逻辑转换,但我收到此错误:
if (.not.bDropped.and.(zz_unif01() .lt. (1 - (Test_Dru
1
Error: Operand of .not. operator at (1) is INTEGER(4)
我知道最好将代码更改为.not.bDropped
到 (bDropped.eq.0)
,但这并不简单,因为它是生成的代码。
我尝试了各种 -std=xxx
标志,但它们没有任何区别。
According to this, gfortran can do integer-logical conversion, but I'm getting this error:
if (.not.bDropped.and.(zz_unif01() .lt. (1 - (Test_Dru
1
Error: Operand of .not. operator at (1) is INTEGER(4)
I know it would be better to change the code from .not.bDropped
to (bDropped.eq.0)
, but that would not be simple because it's generated code.
I tried various -std=xxx
flags but they made no difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您链接到的页面上的最后一行内容
是我猜想这与它有关。
编辑:这似乎不是全部事实。简单地做
l1 = .not。 0
(当l1
是逻辑变量时)给出与您收到的相同错误。所以在这种情况下也没有隐式转换。The last line on the page you linked to reads
I'd guess that has something to do with it.
Edit: This seems not to be the entire truth. Simply doing
l1 = .not. 0
(whenl1
is a logical variable) gives the same error you received. So there is no implicit conversion in this case either.