IF(SENSOR .GT. UPPER) THEN CALL COOL ELSE IF(SENSOR .LT. LOWER) THEN CALL HEAT END IF
The relational operators have forms such as .GT. and .LT. because the Fortran character set does not include the usual characters . and <. Relational expressions are most commonly used in IF statements, but any logical variable or array element may be used to store a logical value for use later on.
CHARACTER*10 OPTION LOGICAL EXIT EXIT = OPTION .EQ. 'FINISH' *... IF(EXIT) STOP 'Finish requested'
Logical expressions are covered in more detail in the next section.