- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hello,
using IVF 9.0.x the following code was working
logical :: bSt
if (bSt==.true.) then
else
end if
using IVF 10.0 it is not working. Every time the else statement is used.
Is this code incorrect according to fortran standard?
Thanks in advance
Frank
using IVF 9.0.x the following code was working
logical :: bSt
if (bSt==.true.) then
else
end if
using IVF 10.0 it is not working. Every time the else statement is used.
Is this code incorrect according to fortran standard?
Thanks in advance
Frank
링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
The code is not standard and not correct. == is not defined for logical values, though Intel Fortran supports this as an extension. You should be using .EQV. instead. For much more information, see my article It's only LOGICAL.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I suppose I should add that your test could be simplified to:
if (bSt) then
...
Typically one does not need to compare against .TRUE. and .FALSE. explicitly. But if you do, use .EQV. or .NEQV..
if (bSt) then
...
Typically one does not need to compare against .TRUE. and .FALSE. explicitly. But if you do, use .EQV. or .NEQV..