Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

comparing logical values

tropfen
New Contributor I
627 Views
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

0 Kudos
2 Replies
Steven_L_Intel1
Employee
627 Views
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.
0 Kudos
Steven_L_Intel1
Employee
627 Views
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..
0 Kudos
Reply