      SUBROUTINE ENDRUN (IPASS)
C      SUBROUTINE ENDRUN (IPASS, XHUM1,COMFTS)
C
C-----PERFORMS CALCULATIONS FOR THE END OF THE RUN
C
C-----CONSTANTS
CMDK NHRO
CMDK NHRP
CMDK NOUTDY
CMDK NZN
CMDK NZN7
C
C-----COMMON BLOCKS
CMDK BLKSV
CMDK HUMIDC
CMDK OUTPUT
CMDK QUAYCH
CMDK QUAYLE
CMDK TSTATC
      INTEGER IPASS (NOUTDY)
C      REAL XHUM1(22),COMFTS(11,21)
C
      DO 1170 I=1, NOUTDY
         IF (IPASS (I).EQ.0) SEASUM (I)=SEASUM (I)/NMONTH
1170     CONTINUE
      SEASUM (15)=RATIO (SEASUM (10), SEASUM (14), 1.0)
      SEASUM (32)=RATIO (SEASUM (27), SEASUM (31), 0.001)
      CALL QACCUML
      WRITE(60, 6000) ICITY, (CMONTH (MONTH (I)), I=1, NMONTH)
      WRITE(60, 4010) REDC, REDH
      WRITE(60, 6060) IDES
      WRITE(60, 6010) (SEASUM (I), I=1, 5)
      IF (MODE.NE.2) THEN
         WRITE(60, 6020) (SEASUM (I), I=6, 15)
      END IF
      IF (MODE.NE.3) THEN
         WRITE(60, 6030) (SEASUM (I), I=25, 32)
      END IF
      IF (CFMBP.GT.0.0) WRITE(60, 6070) (SEASUM (I), I=33, 38)
C      IF (ICOMF.NE.1) THEN
C         WRITE(60, 5100)
C         DO 1200 J=1, 21
C            J1=J+1
C            J22=22-J
C            WRITE(60, 6050) XHUM1 (J), XHUM1 (J1),
C     1         (COMFTS (I, J22), I=1, 11)
C  1200        CONTINUE
C      END IF
C
4010  FORMAT (' BASE UNIT COOLING CAPACITY MULTIPLIED BY ', F10.3, /,
     1       ' BASE UNIT HEATING CAPACITY MULTIPLIED BY ', F10.3)
5100  FORMAT ('1', T28, 'TIME SPENT IN EACH COMFORT ZONE (HRS)', /,
     1   ' SP.HUM.', T35, 'DRYBULB TEMPERATURE', /,
     2   T13, '65/67  67/69  69/71  71/73  73/75  75/77  77/79  79/81',
     3   '  81/83  83/85 85/125', /)
C *** SEASONAL SUMMARY OUTPUT
6000  FORMAT ('1  ***SEASONAL SUMMARY FOR ', A4, '***', /,
     1   '0SEASON IN: ', 12 (A4, 1X))
6010  FORMAT (' MEAN ROOM TEMPERATURE', T48, 'DEGF', F12.1, /,
     1   ' MEAN ROOM RELATIVE HUMIDITY', T51, '%', F12.1, /,
     2   ' MEAN OUTDOOR DRY BULB', T48, 'DEGF', F12.1, /,
     3   '0AVERAGE CYCLIC ROOM TEMPERATURE SWING', T48, 'DEGF', F12.1,
     4   /,
     5   ' AVERAGE CYCLIC ROOM REL HUM SWING', T51, '%', F12.1, /)
6020  FORMAT ('0*** HEATING ***', /,
     1   '0TOTAL BURNER ON TIME (CYCLES)', T50, 'HR', (F10.2, '(',
     2   F6.0, ')'), /,
     3   '0NET HEATING OUTPUT', T49, 'BTU', (F12.0, 6X), /,
     4   ' MIS HEATING OUTPUT', T49, 'BTU', (F12.0, 6X), /,
     5   ' TOTAL HEATING OUTPUT', T49, 'BTU', (F12.0, 6X), /,
     6   ' TOTAL BURNER FAN ENERGY', T47, 'KW-HR', (F10.2, 8X), /,
     7   ' TOTAL BLOWER ENERGY', T47, 'KW-HR', (F10.2, 8X), /,
     8   ' TOTAL FUEL INPUT ENERGY', T49, 'BTU', (F12.0, 6X), /,
     9   ' TOTAL ENERGY (HEATING)', T49, 'BTU', (F12.0, 6X), /,
     A   '0HEATING PERFORMANCE FACTOR', 23X, (F12.3, 6X), ///)
6030  FORMAT (' *** COOLING ***', /,
     1   '0TOTAL COMPRESSOR ON TIME(CYCLES)', T50, 'HR', F12.2, '(',
     2   F6.0, ')', /,
     3   '0TOTAL COOLING BY AIR CONDITIONING', T49, 'BTU', F12.0, /,
     4   '0TOTAL COMPRESSOR ENERGY', T47, 'KW-HR', F12.2, /,
     5   ' TOTAL INDOOR FAN ENERGY', T47, 'KW-HR', F12.2, /,
     6   ' TOTAL OUTDOOR FAN ENERGY', T47, 'KW-HR', F12.2, /,
     7   ' TOTAL ENERGY (COOLING)', T47, 'KW-HR', F12.2, /,
     8   '0COOLING SEASONAL PERFORMANCE FACTOR    BTU/WATT-HR', F12.2,
     9   /)
6050  FORMAT (1X, F4.3, '/', F4.3, 11F7.0, /)
6060  FORMAT (1X, 15A4, //)
6070  FORMAT (' *** HUMIDIFIER ***', /,
     1   '0TOTAL HUMIDIFIER ON TIME', T50, 'HR', F12.2, /,
     2   ' TOTAL HUMIDIFIER CYCLES', T52, F12.0, /,
     3   ' TOTAL ENTHALPY OF SUPPLY WATER', T49, 'BTU', F12.1, /,
     4   ' TOTAL ENTHALPY OF WASTE WATER', T49, 'BTU', F12.1, /,
     5   ' TOTAL HEAT REMOVED FROM THE AIR', T49, 'BTU', F12.1, /,
     6   ' TOTAL WATER ADDED TO AIR', T50, 'LB', F12.2)
C
      END
