      SUBROUTINE HILIM(THLOFF,THLON,TSHLIM,TCONTROL)
C
C  HIGH LIMIT SWITCH
C INPUTS:   (READ IN NAMELIST INPGSF IN GASF)
C  THLOFF - HIGH LIMIT SENSOR SWITCH WILL OPEN WHEN SENSOR TEMP > THLOFF
C  THLON  - SWITCH WILL REMAIN OPEN UNTIL SENSOR TEMP < THLON
C  TSHLIM - HIGH-LIMIT SENSOR TIME CONSTANT, HR
CMDK TIMEB
CMDK HILIMB
      DATA NTIM/1/
      IF(NTIM.EQ.1)THEN
        NTIM=0
        TCTHLM=DTIME/TSHLIM
        THLIM=TCONTROL
        IBRNHLS=1
      ENDIF
      THLIM=THLIM+TCTHLM*(TCONTROL-THLIM)
      IF(IBRNHLS.EQ.0)THEN
        IF(THLIM.LT.THLON)IBRNHI=1
      ELSE
        IF(THLIM.GT.THLOFF)IBRNHI=0
      ENDIF
      IBRNHLS=IBRNHI
      RETURN
      END
                        