      SUBROUTINE STRLP1(ACINFL, ACMAX, ACMIN, AVENC2, DQINT, DSOLRH,
     +DTCR, DTCRW, DTIM1, DTOB, DWHM, DWINT, DWSPED, FLOWIN,
     +IDAYM, IDUM, NZONG, POWA, QCONRF, QINFC, QINFS, QINT,
     +QLOSRF,QRAD,QSKY, RHA, RLOADL, RLOADS, SOLRH, TDUM, TODDBR, TRO,
     +TS, VBMAX,VBMIN, VENCRV, WINFC, WINFSS, WINT, WODFAC, WODHMR,
     +IDBG) 
C 
C-----START OF OUTER TIME LOOP
C 
C 
C-----CONSTANTS 
CMDK FTR
CMDK NZN
CMDK NIWL
CMDK NKONST
CMDK NWN
CMDK NWL
CMDK NZW
CMDK CPAIR
CMDK RHOAIR
CMDK SIGMA
C 
C-----COMMON BLOCKS 
CMDK ACHBQ
CMDK ACHLQ
CMDK BAR
CMDK BLKFMT
CMDK BLKQS
CMDK CNSTRK
CMDK DUCTS2
CMDK ENCBK1
CMDK ENCBK2
CMDK ENCBLK
CMDK IWETHR
CMDK IRDFQ
CMDK IZWQ
CMDK IZZQ
CMDK MRTBLK
CMDK MZON1
CMDK OWETHR
CMDK QUAYLE
CMDK SOLARB
CMDK STRUCA
CMDK SURFAR
CMDK TEMPB
CMDK TIMEB
CMDK BLKTM2
CMDK TSTATC
CMDK TSTB2
      REAL ACINFL(NZN), ACMAX(NZN), ACMIN(NZN), DQINT(24), DSOLRH(24),
     +     DTOB(24), DWHM(24), DWINT(24), DWSPED(24), FLOWIN(NZN),
     +         QINFS(NZN), QINFC(NZN), WINFC(NZN), WINFSS(NZN) 
C 
C-----INITIALIZATIONS 
      DATA IWATC  /1/ ,IZDAT/1/
      DTIME=DTIM1
      IF(IZDAT.EQ.1)THEN
        WRITE(60,545)
        DO 550 IJ=1,NROOMS
          NRM=NRMA(IJ)
          N2=NWALLA(NRM)
          DO 550 K2=1,N2
            IZW=NENC(NRM,K2)
            NZONC=NZNC(IZW)
            ID=IDEXP(IZW)
            KON=KONSTA(IZW)
            NLM=NLMP(KON)
            WRITE(60,546)NRM,IZW,ID,NZONC,KON,NLM
  550   CONTINUE
        WRITE(60,547)
        IZDAT=0
      ENDIF
C  ZERO ENERGY LOSS SUMS ON OUTSIDE SURFACES      
      DO 12 JT=1,NZN
      QLOSWL(JT)=0. 
      QLOSFL(JT)=0.
   12 CONTINUE
C     WETHR BLOCK 5: INCREMENT WEATHER TO CURRENT TIME STEP 
      IF (NSEQW.EQ.0 .OR. NSEQW.EQ.1 .OR. NSEQW.EQ.3) THEN
         TODDB=TODDB+DTOB (IT)
         WODHUM=WODHUM+DWHM (IT)
         WSPED=WSPED+DWSPED (IT)
         SOLRH=SOLRH+DSOLRH (IT)
         IF(IGARAGT.EQ.0)TGARAG=TODDB 
C 
      ELSE IF (NSEQW.EQ.2) THEN 
C NOTE: TGARAG GETS SET IN WETHR WITH NSEQW=2!      
         CALL WETHR (5, NSEQW)
         TODDB=TODDB+TOFFSET
      END IF
      DO 10 I=1,NIJ 
   10 SOLARL(I)=SOLARL(I)+DSOLAR(IT,I)
      IF (IGARAGT.GT.0) CALL GARAGA (IGARAGT,NZONG,SOLRH) 
C 
      HO=1.0
C         WSPED UNITS:  MILES/HR  (CORRELATION FOR HO IS FROM CARRIER)
C                        SEE P. VII-13 OF PH IV REPT FOR COMPARISONS.      
      IF (WSPED.GT..4) HO=WSPED**.5/.6584 
      TODBR4=(TODDB+FTR)**4 
C 
C 
C  GET TEMPERATURES OF EACH --ROOF--LAYER 
      CALL ROOFC(HO,TODBR4, ISKY, FAROOF, NSUBR, EATTC1,EATTC2, 
     +           DTIM1,TRO, QLOSRF, QSKY, QCONRF,IDBG) 
C  IZWC  CEILING
C     F  FLOOR OVER BSMT W/O DUCTS BELOW
C     G  FLOOR OVER BSMT W/ DUCTS BELOW 
C     H  FLOOR OVER CRWSPC W/O DUCTS BELOW
C     I  FLOOR OVER CRWSPC W/ DUCTS BELOW 
C     J  GARAGE WALL
C  SET INDICES FOR ENCLOSURES TO THAT FOR ZERO AREA 
      IZWC=IZT+1
      IZWF=IZT+1
      IZWG=IZT+1
      IZWH=IZT+1
      IZWI=IZT+1
      IZWJ=IZT+1
C 
C  NOTE: - - HRADC, HRADF, HRADFD, HRADW ARE SET IN STRDAY
C 
C 
      DO 502 J=1,NROOMS 
      TWIA=0. 
      AWIA=0. 
      NRM=NRMA(J) 
      N2=NWALLA(NRM)
      DO 500 K2=1,N2
      IZW=NENC(NRM,K2)
      KON=KONSTA(IZW) 
      ID=IDEXP(IZW) 
      NZONC=NZNC(IZW) 
      IF(ID.LE.4)THEN 
C  GET TEMPERATURES OF EACH --OUTSIDE WALL--LAYER 
          WALLF=WALLFO(IZW) 
          IF(ID.EQ.1)IZWS(1)=IZW
          IF(ID.EQ.2)IZWS(2)=IZW
          IF(ID.EQ.3)IZWS(3)=IZW
          IF(ID.EQ.4)IZWS(4)=IZW
          CALL OWALLS(NRM, IZW, ID, KON, WALLF, FAWLOD,
     +                HO, TODBR4,  IDBG)
          ENDIF 
      IF(ID.EQ.5)THEN 
C 
C  GET TEMPERATURES OF EACH --CEILING--LAYER
C    IZWC FOR CEILING ELEMENT BELOW ATTIC NO.1 IN ZONE 1
          IF(NZONC.EQ.4.AND.NRM.EQ.1)IZWC=IZW 
          CALL CEIL(NRM, IZW, KON, NZONC, IDBG)
          ENDIF 
      IF(ID.EQ.6)THEN 
          IF(NZONC.EQ.2.OR.NZONC.EQ.7)THEN
C 
C---CALCULATE TEMPS OF EACH LUMP OF --FLOOR ABOVE BASEMENT----
C     WITH OR WITHOUT DUCTS BELOW 
              IF(NZONC.EQ.2)THEN
                  IF(NRM.EQ.1)IZWF=IZW
                  ENDIF 
              IF(NZONC.EQ.7)THEN
                  IF(NRM.EQ.1)IZWG=IZW
                  ENDIF 
              CALL FLOOR(NRM, IZW, ID, KON, NZONC, TBASA, 
     +                   DCTFLR, IDBG)
              ENDIF 
          IF(NZONC.EQ.3.OR.NZONC.EQ.8)THEN
C 
C-----CALCULATE TEMPS OF EACH LUMP OF --FLOOR ABOVE CRAWL SPACE---
C      WITH OR WITHOUT DUCTS BELOW
              IF(NZONC.EQ.3)THEN
                  IF(NRM.EQ.1)IZWH=IZW
                  ENDIF 
C  ??? CHECK WHY THERE WAS NRM.EQ.1 BELOW   SOMETIME  !!!!! 
              IF(NZONC.EQ.8)IZWI=IZW
C 
              CALL FLOOR(NRM, IZW, ID, KON, NZONC, TCRWA, 
     +                   DCTFLR, IDBG)
              ENDIF 
          ENDIF 
      IF(ID.EQ.7.AND.NZONC.EQ.6)THEN
C-----CALCULATE TEMPS OF EACH LUMP OF --GARAGE--WALL
C          CANT HAVE THERMOSTAT ON LVG SPC/GARAGE WALL, 0.,0. BELW 
          CALL IWALLS(NRM, IZW, KON, NZONC, 0.,0.,IDBG)
          ENDIF 
      IF(ID.EQ.7.AND.NZONC.GT.8)THEN
C 
C   ---INTERIOR PARTITION---WALL
              CALL IWALLS(NRM, IZW, KON, NZONC, TWIA, AWIA,IDBG) 
          ENDIF 
      IF(ID.EQ.8)THEN 
C             BASEMENT FLOOR
C         TODAG1 IS NOT USED IN FLOOR FOR BSMT FLOOR! (OK - RDF)
          CALL FLOOR(NRM,IZW,ID,KON,0,TODAG1,1.,IDBG) 
          ENDIF 
      IF(ID.EQ.9.OR.ID.EQ.10)THEN 
          IF(ID.EQ.10)WALLF=WALLFO(IZW) 
          CALL OWALLS(NRM,IZW,ID,KON,WALLF,FAWLOD,HO, 
     +                TODBR4, IDBG) 
          ENDIF 
  500 CONTINUE
      IF(AWIA.EQ.0.)THEN
          WRITE(60,600)
          STOP 'STRLP1:AT 500, NO PARTITION WALL FOR TSTAT TEMP!!!' 
          ENDIF 
C * * * * * * * * 
C         TWSTAT IS AREA-WEIGHTED WALL TEMP AT TSTAT
      TWSTAT(NRM)=TWIA/AWIA 
  502 CONTINUE
C 
C* * * * * *
C-----INTERNAL HEAT AND MOISTURE GAINS
      QINT=QINT+DQINT (IT)
      IF (IWAT.EQ.1) THEN 
         WINT=WINT+DWINT (IT) 
      ELSE
         IF (TINDEX.LT.WT (IWATC)) THEN 
            WINT=WINTL (IWATC)
         ELSE 
            IWATC=IWATC+1 
         END IF 
      END IF
C 
C-----MEAN RADIENT TEMPERATURE CALCULATION
      CALL MRTHRI(QINT,QRAD,IDBG)
C 
C-----CALCULATE BASEMENT AIR CHANGE RATE IF SPECIFIED 
C     OTHERWISE, USE CONSTANT INPUT AS VENBAS 
      IF (NRNAVB.GT.0) THEN 
         IF (MODE.EQ.2) THEN
            VENBAS=ACHB2 (TODDB, TBASA, WSPED, TS)
         ELSE 
            VENBAS=ACHB (TODDB, TBASA, WSPED, TS) 
         END IF
      ELSE IF(NRNAVB.LT.0)THEN 
C   NRNAVB LT 0 TO SIGNAL USE OF COEF FOR DAILY ACH 
         IF(IDAYM.EQ.1)VENBAS=ACMB 
         IF(IDAYM.EQ.2)VENBAS=ACWSB
         IF(IDAYM.EQ.3)VENBAS=ACBB 
         IF(IDAYM.EQ.4)VENBAS=ACSB 
         IF(IDAYM.EQ.5)VENBAS=ACCNB
         IF(IDAYM.GT.5)VENBAS=(ACMB+ACWSB+ACBB+ACSB+ACCNB)/5.
      ENDIF
      IF (VENBAS.GT.VBMAX) VBMAX=VENBAS 
      IF (VENBAS.LT.VBMIN) VBMIN=VENBAS 
C  MISCELLANEOUS FACTORS FOR INFILTRATION 
C   1.329=144.*.4923/53.34
      WODFAC=1.329*29.921*(1.+WODHUM)/(1.+1.608*WODHUM)*BARRAT
      RAIROD=WODFAC/(TODDB+460.)
      TODDBR=TODDB*RAIROD 
      AVENC2=VENCRV*RAIROD
      WODHMR=WODHUM*RAIROD
      DTCRW=DTCR/RAIROD 
C-----CALCULATE INFILTRATION (AIR CHANGES) RATE IN LIVING SPACE 
C        IF STORY < 0 THEN INFILTRATION RATES IN AIR-CHANGES PER
C           HOUR ARE READ FROM TAPE22 IN SUB.ACHL ENTRY.ACHLTIM 
C        IF STORY = 0 THEN THE FIVE INFILTRATION CONSTANTS ARE
C           DAILY INFILTRATION RATE AVERAGES (4/6/84 FEJ QUICK FIX) 
      DO 532 JT=1,NROOMS
      NRM=NRMA(JT)
      IF(NRM.EQ.NZNBAS)THEN 
          ACINFL(NRM)=VENBAS
          GO TO 530 
          ENDIF 
      IF (STORY.GT.0.0) THEN
         IF (MODE.EQ.2) THEN
            CALL ACHL2(NRM,TODDB,TA,WSPED,TS,ACINFL)
         ELSE 
            CALL ACHL(NRM,TODDB,TA,WSPED,TS,ACINFL) 
         END IF 
      ELSE IF (STORY.LT.0.0) THEN 
         CALL ACHLTIM(NRM,TODDB,TA,WSPED,TS,ACINFL)
C  STORY = 0. HERE!         
      ELSE IF (IDAYM.EQ.1) THEN 
         ACINFL(NRM)=ACML(NRM)
      ELSE IF (IDAYM.EQ.2) THEN 
         ACINFL(NRM)=ACWSL(NRM) 
      ELSE IF (IDAYM.EQ.3) THEN 
         ACINFL(NRM)=ACBL(NRM)
      ELSE IF (IDAYM.EQ.4) THEN 
         ACINFL(NRM)=ACSL(NRM)
      ELSE IF (IDAYM.EQ.5) THEN 
         ACINFL(NRM)=ACCNL(NRM) 
      ELSE
         ACINFL(NRM)=(ACML(NRM)+ACWSL(NRM)+ACBL(NRM)+ 
     +               ACSL(NRM)+ACCNL(NRM))/5. 
      END IF
  530 IF (ACINFL(NRM).GT.ACMAX(NRM)) ACMAX(NRM)=ACINFL(NRM) 
      IF (ACINFL(NRM).LT.ACMIN(NRM)) ACMIN(NRM)=ACINFL(NRM) 
  531 FLOWIN(NRM)=ACINFL(NRM)*ROMVOL(NRM) 
      WINFC(NRM)=FLOWIN(NRM)*WODHUM*RAIROD
      WINFSS(NRM)=RHOAIR*FLOWIN(NRM)*BARRAT 
      QINFC(NRM)=FLOWIN(NRM)*CPAIR*TODDBR 
      QINFS(NRM)=FLOWIN(NRM)*BARRAT*CPAIR*RHOAIR
  532 CONTINUE
      DO 540 I=1,NZN
      QDCTBA(I)=0.
  540 TA(I)=0.
      TATTA(1)=0.0
      TATTA(2)=0.0
      TBASA=0.0 
      TCRWA=0.0 
      TS=0.0
      RHA=0.0 
      DO 542 I=1,NZW
      QCSURF(I)=0.
  542 CONTINUE
      DO 544 I=1,2
      QCEIL(I)=0. 
      QROOF(I)=0. 
  544 CONTINUE
      IF (IMODE.EQ.1) CALL ACND1 (IDUM, TDUM, TDUM) 
C     INITIALIZE COOLING SYSTEM OUTPUT QUANTITES
      RLOADS=0. 
      RLOADL=0. 
      POWA=0. 
      RETURN
  545 FORMAT(/////'   ****   LIST OF FINAL ENCLOSURE ELEMENTS   ****',
     +  /'    ZONE   IZW    ID  NZONC  KON   NLM')        
  546 FORMAT(1X,6(I6))
  547 FORMAT(/////1X)        
  600 FORMAT(/1X,'STRLP1:NO PARTITIONS FOR TSTAT TEMP.  MUST HAVE', 
     +' PARTITIONS, SO CHECK INPUT.') 
      END 
