title: Need help with Binary Search algorithm error
body: <p>Using the <a href="http://www.g95.org/" rel="nofollow">g95</a> compiler, I have an error:</p>
  
  <pre><code>Error: Operands of comparison operator '.EQ.' at (1) are LOGICAL(4)/LOGICAL(4)
  </code></pre>
  
  <p>I have no idea what this means. I'm including the subroutine. Do you have any ideas how to fix this?</p>
  
  <p>Thanks so much for your time.</p>
  
  <pre><code>  SUBROUTINE search(iarray, ItemSought, Found, Location)
  CHARACTER(20), DIMENSION(50),INTENT(IN)::itemarray
  CHARACTER(20)::ItemSought
  LOGICAL, INTENT(OUT)::Found
  INTEGER, INTENT(OUT)::Location
  INTEGER:: First, Last, Middle
  
  WRITE(*,'(1x,A)',ADVANCE="NO"),"What are you searching for? "
  READ*, ItemSought
  
  First=1
  Last=SIZE(Iarray)
  FOUND = .FALSE.
  
  DO
      IF ((First &gt; Last) .OR. Found) RETURN
          Middle = (First+Last)/2
      IF (ItemSought &lt; Iarray(Middle)) THEN
          Last=Middle-1
      ELSE IF (ItemSought &gt; Iarray(Middle)) THEN
          First=Middle+1
      ELSE
          Found = .TRUE.
          Location = Middle
      END IF
  END DO
  
  
  IF (Found == .TRUE.) THEN
  PRINT*, Itemsought
  
  END SUBROUTINE
  </code></pre>