      SUBROUTINE GARAG(IGARAGT,NZON,SOLARH) 
C 
C  COMPUTE AIR TEMP IN AN ATTACHED GARAGE 
C   APPROACH: INNER SURF OF OUTSIDE WALLS AND CEILING DRIVEN TOWARD 
C             AVG OF SOLAIR AND GARAGE AIR TEMPS WITH A TIME CONST EQN
C   IGARAGT:  SEE STRRUN
C   NZON - ZONE CONNECTING TO ATTACH GARAGE (1 - 5)
C - - CONSTANTS 
CMDK NZN
CMDK OWETHR
CMDK TEMP1
CMDK TIMEB
      DIMENSION B(3),DTG(3),BB(3) 
C      
C INPUTS IN NAMELIST GAR:    
C  ALFSOL  AREA WEIGHTED MEAN SOLAR ABSORPTIVITY OF OUTSIDE SURF OF ROOF
C          AND OUTSIDE WALLS OF GARAGE(USED IN SOLAIR TEMP CALC)
C  AWALI   AREA OF WALL BETWEEN GARAGE AND LIVING SPACE, FT SQ
C  AWALO   AREA OF OUTSIDE GARAGE WALLS, FT SQ
C  HCEIL   HEAT TRANSFER COEF AT INSIDE SURF OF CEILING(CONV AND RAD),BTU/HR-FTF
C  HWALO   HEAT TRANSFER COEF AT INSIDE SURF OF OUTSIDE WALLS(CONV AND RAD),
C          BTU/HR-FT SQ-F 
C  TCWALO  TIME CONSTANT FOR CHANGE IN TEMP OF INSIDE SURF OF OUTSIDE WALL,HR 
C  TCCEIL  TIME CONSTANT FOR CHANGE IN TEMP OF INSIDE SURF OF CEILING,HR
C  UWALI   OVERALL HEAT TRANSFER COEF FOR HEAT FLOW THRU WALL BETWEEN GARAGE
C          AND LIVING SPACE, BTU/HR-FT SQ-F 
C  VOLGAR  VOLUME OF GARAGE, FT SQ
      NAMELIST/GAR/ALFSOL,AWALI,AWALO,HCEIL,HWALO,
     +             TCWALO,TCCEIL,UWALI,VOLGAR
C  VALUES IN DATA STMTS SET FOR HOUSE A
C     (SINGLE STORY HOUSE WITH SINGLE-CAR ATTACHED GARAGE ON SOUTH SIDE)
      DATA FTR/459.7/ 
      DATA HWALO,AWALO/.22,400./
      DATA HCEIL,ACEIL/.37,308./
      DATA UWALI,AWALI/.31,176./
      DATA VOLGAR/2464./
      DATA TCWALO,TCCEIL/2.,3./ 
      DATA ALFSOL/.65/
C  ACHG1  REF. AIR CHANGE DUE TO REF. TEMP DIFFERENCE TGAR1-TOD1
C  ACHG2  REF. AIR CHANGE DUE TO REF. WIND SPEED OF WS2 MPH 
      DATA ACHG1,TOD1,TGAR1/0.5,20.,50./
      DATA ACHG2,WS2/0.75,20./
C  FITTED COEF BELOW
      DATA B/.06976,.6911,28.04/
      DATA NTIM/0/
C 
      IF(IGARAGT.EQ.2)THEN
       OPEN(17,FILE='TAPE17',STATUS='OLD',IOSTAT=IO17)
       IF(IO17.NE.0)THEN
         WRITE(60,*) ' GARAG: CANT OPEN TAPE17 WITH NAMELIST GAR'
         STOP ' GARAG: CANT OPEN TAPE17 WITH NAMELIST GAR'
         END IF
       READ(17,GAR,END=99)
       CLOSE(17)
       WRITE(60,GAR)
       ENDIF
      CAPGAR=0.075*0.24*VOLGAR
      BB(1)=DTIME*HCEIL*ACEIL/CAPGAR
      BB(2)=DTIME*HWALO*AWALO/CAPGAR
      BB(3)=DTIME*UWALI*AWALI/CAPGAR
      B4=ACHG1*ACHG1/(1./(TOD1+FTR)-1./(TGAR1+FTR)) 
      B5=(ACHG2*ACHG2-ACHG1*ACHG1)*(TOD1+FTR)/(WS2*WS2) 
      WRITE(60,500) (BB(I),I=1,3),B4,B5 
      TCTWLO=DTIME*B(1)/TCWALO
      TCTCLG=DTIME*B(1)/TCCEIL
      TGARAG=.66*TI(NZON)+.34*TODDB
      RETURN
C 
      ENTRY GARAGA(IGARAGT,NZON,SOLARH)
      IF(NTIM.EQ.0)THEN 
          TCEIL=TGARAG
          TWALO=TCEIL 
          NTIM=1
          ENDIF 
      IF(WSPED.GT.0.4)U=SQRT(WSPED)/.6584 
      IF(WSPED.LE.0.4)U=1.
      TSLAIR=(TODDB+ALFSOL*SOLARH/U+TGARAG)*0.5 
      TCEIL=TCTCLG*(TSLAIR-TCEIL)+TCEIL 
      TWALO=TCTWLO*(TSLAIR-TWALO)+TWALO 
      DTG(1)=BB(1)*(TCEIL-TGARAG)+BB(2)*(TWALO-TGARAG)
      DTG(2)=B(2)*BB(3)*(TI(NZON)-TGARAG)
      TOD11=1./(TODDB+FTR)
      SQTRM=B4*(TOD11-1./(TGARAG+FTR))+B5*B(3)*WSPED*WSPED*TOD11
      IF(SQTRM.LT.0.)ACHG=0.
      IF(SQTRM.LT.0.)GO TO 48 
      ACHG=SQRT(SQTRM)
   48 CONTINUE
      DTG(3)=DTIME*ACHG*(TODDB-TGARAG)
C 
      SUM=0.
      DO 50 K=1,3 
   50 SUM=SUM+DTG(K)
C      TGARSV=TGARAG 
      TGARAG=TGARAG+SUM 
C      NQQ=NQQ+1 
C      IF(NQQ.GT.360.AND.NQQ.LT.381)WRITE(60,501) WSPED,SOLARH,TODDB,
C     +TGARSV,(DTG(IK),IK=1,3),TGARAG,ACHG 
      RETURN
   99 STOP ' GARAG: EOF ON TAPE17'      
  500 FORMAT(1X,'GARAG: BB S= ',3G13.5,4HB4= ,G13.5,4HB5= ,G13.5) 
  501 FORMAT(1X,'WSPED,SOLARH,TODDB= ',3G13.5/
     +1X,'TGARAG LAST= ',G13.5,8HDTG(I)= ,3G13.5/ 
     +1X,'TGARAG=      ',G13.5,6HACHG= ,G13.5)
      END 
