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

A LOGICAL variable is neither .TRUE. nor .FALSE. !!

Espen_M_
Beginner
420 Views

I have a very strange behavior in my code where the following statement succeeds

[fortran]

IF (comp_E ) THEN

[/fortran]

even though the LOGICAL variable comp_E has the value .FALSE. (which is correct and I can verify in the VS debugger). If  I try to change the statement into

[fortran]

IF ( .NOT. comp_E) THEN

[/fortran]

just as a test to see if the value is actually opposite, i.e. .TRUE., it *always* fails.

To sum up: an IF statement with the variable comp_E either always fails or always succeds. Strange!

Does anyone have a clue what is going on here?

I'm on Intel(R) Visual Fortran Compiler XE 13.1.3.198 [IA-32] and the compiler command line switches are

/nologo /debug:full /Od  [....]  /free /standard-semantics /Qdiag-error-limit:50 /debug-parameters:all /warn:declarations /warn:unused /warn:interfaces /fpe:0 /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc110.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /c

0 Kudos
0 Replies
Reply