title: How do I handle logical statements being applied to integer values with gfortran?
body: <p>I'm rewriting some code to make a program compile with the gfortran compiler as opposed to ifort compiler I usually use.    The code follows:</p>
  
  <pre><code>_Subroutine SlideBits (WORD, BITS, ADDR) 
  
  Implicit None  
  Integer(4) WORD  
  Integer(4) BITS  
  Integer(4) ADDR  
  Integer(4) ADDR1 
  
  ADDR1 = 32 - ADDR  
  WORD = (WORD .And. (.Not.ISHFT(1,ADDR1))) .Or. ISHFT(BITS,ADDR1)  
  
  End_ 
  </code></pre>
  
  <p>When I compile the above code using the gfortran compiler, I recieve this error: </p>
  
  <pre><code>WORD = (WORD .And. (.Not.ISHFT(1,ADDR1))) .Or. ISHFT(BITS,ADDR1) 
  
  Error: Operand of .NOT. operator at (1) is INTEGER(4)  
  </code></pre>
  
  <p>All three of the variables coming into the subroutine are integers.   I've looked around a bit and the gfortran wiki states that the gfortran compiler should be able to handle logical statments being applied to integer values.  Several other sites I've visited either quote from the gnu wiki or agree with it.     This is the first time I've seen this error as the Intel Fortran compiler (ifort) I normally use compiles cleanly.</p>