- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page