- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been using it for years. At first it was by accident but I found it worked fine and the code often looks easier to understand. But it seams to be broken in XE2013.
Try this code. It fails if you turn on F2003 semantics. However Premier support say not() is not supported for boolean arguments. I think it is a trap many could fall into.
If you assign not(.true.) to a boolean it actually shows correctly as false in the debugger. But the internal value is -2 which trips up the if block.
program test
implicit none
if(not(.true.))then
print*,'what am I doing in this block'
pause
end if
end program
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Intel) wrote:Interesting... I have one question about that. Which one is correct or does the IVF compiler use .eqv. automaticly? [fortran] if(logicalValue) then ! ... end if if(logicalValue.eqv..true.) then !... end if [/fortran] MarkusYou want the .NOT. operator here. See Doctor Fortran in "To .EQV. or to .NEQV., that is the question", or "It's only LOGICAL" for more on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Intel) wrote:MegaLOL. Did you have the dual sets of intrinsics in place to handle both styles of LOGICAL arguments? Correct progams can't use TRANSFER? C programmers can't correctly predict or interpret the behavior of _Bool variables, so why should Fortran programmers be expected to? If a Fortran program has LOGICAL(C_BOOL) in its specification-part it's just wrong in virtually every case. The right solution is for the compiler to set C_BOOL = -1, but I have never seen a vendor resist the urge to consume the Kool-Aid in this instance.Not a practical option, really. Especially as we already had the necessary support to meet the standard. Only incorrect programs would see a difference. Adding a new type or kind to the compiler is a lot of work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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