home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
h
/
house_ii.zip
/
FOR
/
LOOP.FOR
< prev
next >
Wrap
Text File
|
1992-05-11
|
21KB
|
622 lines
SUBROUTINE LOOP(ACINFL, ATOUT, AVENC2, DTIM2, DTCRW, FLOC,
+FLOWIN, HDUM, HUMON, ICL1, ICYC1, ICYC6, ICYCCP, IDAYM, ILINES,
+INC, ISUM, MPRINT, NROUT,POWA, QBASVN, QCONRF, QCRAD,
+QHUMT, QINFC, QINFS, QINT, QLOSRF, QRAD, QSKY, QSPT,
+QWAS, RDUM, RELHMI,RHA,RLOADL, RLOADS, TBAS, TDUM, TISUM, TMRSUM,
+TODDBR, TONMAX, TRO, TS, WATER, WINFC, WINFSS, WINT, WODFAC,
+WODHMR, IDBG)
C
C-----PERFORMS GASASHR TIME LOOP
C
C-----CONSTANTS
CMDK BTUKWH
CMDK CPAIR
CMDK FTR
CMDK NHBK
CMDK NHRO
CMDK NHRP
CMDK NZN
CMDK NIWL
CMDK NOUTDY
CMDK NWL
CMDK NWN
CMDK NZN7
CMDK NZW
CMDK RHOAIR
CMDK LPSTRB
CMDK DUCTS5
CMDK FANBLK
CMDK ACND
CMDK BAR
CMDK BLK10
CMDK BLK85
CMDK BLKCM2
CMDK BLKGS2
CMDK BLKQGS
CMDK BLKQS
CMDK COLLEC
CMDK DTRQ
CMDK DUCTS1
CMDK DUCTS2
CMDK DUCTS4
CMDK ENCBK1
CMDK ENCBK2
CMDK ENCBLK
CMDK FUEL1
CMDK HANDBK
CMDK HUMIDC
CMDK IELCB
CMDK INDIC1
CMDK IWETHR
CMDK IZWQ
CMDK IZZQ
CMDK MRTBLK
CMDK MZON1
CMDK OUTPUT
CMDK OWETHR
CMDK QUAYCH
CMDK QUAYLE
CMDK PRT1
CMDK SOLARB
CMDK STRUCA
CMDK SURFAR
CMDK TEMP1
CMDK TEMPB
CMDK TIMEB
CMDK BLKTM2
CMDK TSTATC
CMDK TSTB2
CMDK TSTB3
CMDK TSTB4
CMDK WIBLK
CMDK ITM
REAL UNDEF , RMVOL(NZN), RMVL(NZN)
C "UNDEF" SET TO 9.999999E36, AND IS USED TO TRAP UNDEF REF
C
C-----ARGUMENTS
INTEGER FLOC (NZN7), NROUT(24), IBLPF(4)
REAL ACINFL(NZN), AIRMAS(NZN), ATOUT(12,24),
+ FLOWIN(NZN), QINFC(NZN), QINFS(NZN), QWALL(6),
+ TATTCN(2), TIN(NZN), TISUM(NZN), TMRSUM(NZN), TSUP(NZN),
+ WINFSS(NZN), WINFC(NZN), WIN(NZN)
C
C-----INITIALIZATIONS
DATA UNDEF/9.99999E36/
DATA IBLPF /0, 0, 1, 0/
DATA IFIRST /1/
DATA QP /0.0/
DATA WIZLS/9999./
IF(ITIM.EQ.0)THEN
ITIM=1
C NOTE: ITIM GETS RESET TO 0 IN TSTATD FOR 121486 RUN WHICH CHANGES
C FROM ICTRLZ(1-3) = 1 AT START TO CHANGE CONTROLLED ZONES TO
C ICTRLZ(2) = 1 ONLY AT NOON OF FIRST DAY
C IS FURNACE IN CONDITIONED SPACE???? IF SO, IFLC1 = 1 !!!!
IFLC1=0
IF(IFLOC.EQ.1.OR.IFLOC.GT.8)IFLC1=1
IF(IFLOC.EQ.2.AND.ICTRLZ(NZNBAS).GT.0)IFLC1=1
DO 3 IJ=1,NROOMS
NRM=NRMA(IJ)
C RMVOL VALUES ARE VOLUMES OF CONTROLLED ZONES OTHER THAN W/ FURNACE
RMVOL(NRM)=0.
IF(ICTRLZ(NRM).GT.0.AND.NRM.NE.NZNBAS)RMVOL(NRM)=ROMVOL(NRM)
C RMVL VALUES ARE VOLUMES OF CONTROLLED ZONES
RMVL(NRM) = 0.
IF(ICTRLZ(NRM).GT.0)RMVL(NRM)=ROMVOL(NRM)
3 CONTINUE
ENDIF
C
DTIME=DTIM2
DO 50 L=1, NSUBDV
C
IF (TENCLO (IDAYM).GE.999.0) TENCLO (IDAYM)=TODDB
C MEAN TEMPERATURE AND SPECIFIC HUMIDITY IN ALL ZONES
C AVERAGED BY SUPPLY-AIR FRACTIONS (RWSDCT)
TIM=AVGWV(TI,NROOMS,RWSDCT)
WIM=AVGWV(WI,NROOMS,RWSDCT)
C MEAN INDOOR TEMPERATURE WEIGHTED BY CONDITIONED ZONE VOLUMES
TIMN=AVGWV(TI,NROOMS,RMVL)
C MEAN INDOOR TEMP IN ZONES OTHER THAN THE BASEMENT IN CONDITIONED ZONEZ
TIMNB=AVGWV(TI,NROOMS,RMVOL)
C !!!!!TZONE VALUES ARE SET FOR USE IN DUCT ROUTINES
TZONE (1)=TI(1)
TZONE (2)=TBAS
TZONE (3)=TCRW
TZONE (4)=TATTC(1)
TZONE (5)=TENCLO (IDAYM)
TZONE (6)=TGARAG
TZONE (7)=TODDB
TZONE (8)=TATTC(2)
DO 4 JT=2,NZN
IF(NROOMS.GE.JT)THEN
TZONE(JT+7)=TI(JT)
ELSE
TZONE(JT+7)=UNDEF
ENDIF
4 CONTINUE
C--------CALCULATE ATTIC AIR TEMPERATURE
CALL TAATTC(ATCDT,QAVENT,QCEIL1,QWALL(5),RAIRAT,TATTCN,
+ TODDBR, WODFAC, IDBG)
C
TAIN=TZONE (IFLOC)
TCOMB=TAIN*IDIRCT1+TODDB*IDIRCT
IF(IFLOC.EQ.2)THEN
WIZ=WI(NZNBAS)
ELSE IF(IFLOC.GT.8)THEN
WIZ=WI(IFLOC-7)
ENDIF
IF(WIZ.NE.WIZLS)THEN
IPSY= -4
CALL PSY(IPSY,TAIN,TWBI,TDUM,RHDUM,WIZ,HDUM)
WIZLS=WIZ
ENDIF
C--------IS THE INDOOR FAN ON?
I10=1+IAC+2*IEFAN
C
C--------RETURN DUCTS
C SET LVG SPC ENVIRONMENT FOR DUCTS
IZLVG=1
IF(NROOMS.GT.1)THEN
C FIND MAX VALUE OF RWSDCT
RWSMX=0.
DO 5 I=1,NROOMS
NRM=NRMA(I)
IF(RWSDCT(I).GT.RWSMX)THEN
RWSMX=RWSDCT(I)
IZLVG=NRM
IF(NRM.GT.1)IZLVG=NRM+7
ENDIF
5 CONTINUE
ENDIF
CALL RETDUCT ( I10, TIM, IZLVG, TWRT, TWRTB, TRET,
+ TRETB, QRET, QRETB, FLOW10, FLOW11, FLOW14)
C--------CALCULATE BASEMENT MOISTURE INFILTRATION, BALANCE
VMIX=FLOW10
IF (IBRP.GT.0) THEN
C AIR IS RETURNED TO FURNACE THOUGH BASEMENT WITH NO RETURN DUCTS
TMIX=TBAS
WMIX=WBAS
WROOM=FLOW10*(WIM-WBAS)
AVENVB=ACINFL(NZNBAS)*ROMVOL(NZNBAS)
WINFB=AVENVB*(WODHMR-WBAS*RHOAIR)+FINFB*(1-FLOC (1))*
+ (WODHUM-WBAS)+WAIRB*(WIM-WBAS)*FLOC (1)*(1-FLOC (7))
WSUMB=(WROOM+WINFB)*DTIME
WBASN=(WSUMB/AIRMSB)+WBAS
ELSE
TMIX=TRETB
WMIX=WIM
END IF
C--------CALCULATE MIXTURE AFTER HUMIDIFIER BYPASS MIXING
WMIXS=WMIX
IF (CFMBP.NE.0.0) THEN
IF (IEFAN.NE.0) THEN
VMXX=WA1+VMIX
WMIX=(WA1*WBULK+VMIX*WMIX)/VMXX
TMIX=(TBULK*WA1+TMIX*VMIX)/VMXX
END IF
END IF
C AIR TEMPERATURE TO FURNACE HEAT EXCHANGER(INCLUDES BLOWER DELTA T)
TRETP=TMIX+EFANCC (I10)
DTBLR=EFANCC (I10)
IF(IMODE.EQ.1.OR.(IMODE.EQ.2.AND.CFMBP.GT.0.))THEN
IPSY=-4
CALL PSY (IPSY, TRETP, TRETWB, TDUM, RDUM, WMIX, HDUM)
ELSE
C DEACTIVATE MOISTURE BAL IN HEATING MODE (TO SAVE TIME)
TRETWB=TRETP-5.
ENDIF
IF (TRETWB.GT.TRETP) TRETWB=TRETP-.01
C
IF (IMODE.EQ.1) THEN
CMPUMP=0.
IRGSF=1
IF (IFIRST.EQ.1) CALL PLENUM
IFIRST=0
ELSE
IHON=H2ON (IT)-TIME
C
C-----------CALL THE FURNACE SUBROUTINES
CALL GASF
IF (IELC.EQ.0) THEN
QP=QPILOT*(1-IBURN)
ELSE
QP=QPILOP
END IF
NRDF1=1
C
CMPUMP=((CMFANP+PUMPWP)*IBURN+CMFANP*ICL1*(1-IBURN))*REDH
QEXT=QEXT*REDH
QPLEN=QPLEN*REDH
QVENTB=QVENTB*REDH
QVNTLS=QVNTLS*REDH
QVENTA=QVENTA*REDH
QDRAFT=QDRAFT*REDH
QJACK=QJACK*REDH
WAIRB=WAIRB*REDH
TB=TPL
END IF
C
C--------HUMIDIFIER PERFORMANCE
IF (IMODE.EQ.2) CALL HUMDF3 (TIM)
C
C--------A/C AND PLENUM PERFORMANCE FOR COOLING MODE
IF (IMODE.EQ.1) THEN
TAIN=TBAS
WAIRB=0.
CPWAIR=CPAIR*ECFMC1*IAC*U45*BARRAT
CALL ACND2 (IEFAN, TRETWB, TRETB)
END IF
C
C--------SUPPLY DUCTS
CALL SUPDUCT ( I10, TIM, IZLVG, TPL, TWSP, TWSPB,
+ TSUP, TSUPB, QSUP, QSUPB,IDBG)
C--------CALCULATE BASEMENT AND CRAWL SPACE TEMPERATUTES
C
C--------CALCULATE THE FURNACE/PLENUM HEAT LOSS, AND ADDED INFILTRATION
QPLENB=(QPLEN+QJACK)*NCELLS
IF (IDIRCT.EQ.1) THEN
XQADNC=0.
QIZFRNB=0.0
QIFRNB=0.0
ELSE IF (IFLOC.EQ.2) THEN
C NOTE: INFILTRATION IN LVG SPC ZONE CAUSED BY FURNACE OPERATION IN
C BASEMENT IS SPLIT BY RATIO OF FLOOR AREAS IN TAZONE. XQADNC
C BELOW IS USED IN THAT CALCULATION
XQADNC=CPAIR*WAIRB*PHI*PHIINF*SRCEAB
C QIFRNB - INFLITRATION DIRECTLY INTO BASEMENT DUE TO FURN OPERATION
C QIZFRNB - INTERZONE HEAT FLOW FROM LIVING SPACES TO BASEMENT DUE TO
C FURNACE OPERATION.
C NOTE: TIMNB HERE SHOULD BE FOR ALL OTHER ZONES
QIZFRNB=XQADNC*(TIMNB-TI(NZNBAS))
QIFRNB=CPAIR*WAIRB*PHI*PHIINF*(1.0-SRCEAB)*
+ (TODDB-TI(NZNBAS))
ELSE
C FURNACE IS NOT IN BASEMENT!
XQADNC=CPAIR*WAIRB*PHI*PHIINF
QIZFRNB=0.
QIFRNB=0.
END IF
IF (IDEBUG.EQ.1) WRITE(60, 500) QIFRNB,XQADNC, PHI,
+ PHIINF,WAIRB, CPAIR, SRCEAB, TIMN, TCOMB, TODDB
QFRLFE=(QPLENB+QDRAFT+QVENTB+CMPUMP*BTUKWH)
TATTCN(NATVNT)=TATTCN(NATVNT)+(QFRLFE+XQADNC*
+ (TODDB-TATTC(NATVNT))*FLOC (4)+QDUCTZ (4))*ATCDT/RAIRAT
C
C AIR COND CAPACITIES NOW CALCULATED IN ACOND 11/5/85 KEH
C
WAC=WMIX-WMOIST/FLOW14
WHUM=VMIX*(WAC-WIM)
C - -- - - - - - - - - -- -
C GET ZONE AIR TEMPERATURES
CALL TAZONE(AIRMAS,CMPUMP,QCEIL4,QDCTZN,QFLBAS,QFLCRW,
+ QFRLFE,QFLSPB,QFLSPC,QINC,QINF,QINFB,QINFC,
+ QINFFRN,QINFS,QINT,QNT,QPART,QRADCB,QSLFL,
+ QSUM,QSUM1,QSUM2,QWALL,QWGR,QWINST,QIZONE,
+ TBAS,TCRW,TIN,XQADNC,IDBG)
IF(IBAS.GT.0)THEN
QINFB=QINFB+QIFRNB
QINFFRN=QINFFRN+QIFRNB
CALL TBZONE(AIRMAS,FLOC,FLOW11,QBASFT,QBWAG,QBWBGT,
+ QDCTZF,QFLBAS,QFRLFE,QINCB,QINFB,QINFC,QINFS,QINT,QIZFRNB,
+ QNT,QPARTB,QRADCB,QRETB,QSUMB,QSUMB1,QSUMB2,QIZONB,TBAS,
+ TBASN,TIMNB,TIN,IDBG)
IF(ICTRLZ(NZNBAS).GT.0)THEN
C CEILING Q IN BSMT IS ADDED INTO QSUMB2 IN TBZONE IF
C BSMT IS A CONTROLLED ZONE. IT IS NOT ADDED INTO
C QCEIL4, BECAUSE QCEIL4 IS RESERVED FOR CEILING-TO-
C ATTIC HEAT FLOW
QSUM1=QSUM1+QSUMB1
QINF=QINF+QINFB
QINC=QINC+QINCB
QPART=QPART+QPARTB
QSUM2=QSUM2+QSUMB2
QIZONE=QIZONE+QIZONB
QDCTZN=QDCTZN+QDUCTZ(2)
ENDIF
ENDIF
C--------CRAWL SPACE
IF (ICRW.GT.0) THEN
AFLCR1=AWALLA(IZWH)*H1F
QCRWVN=AVENC2*(TCRW-TODDB)
QGRND=AFLCR1*(TCRW-TODAG1)
TCRWN=(QFLCRW-QCRWVN-QGRND+
+ QFRLFE*FLOC (3)+QDUCTZ (3))*DTCRW+TCRW
END IF
C SAVE INDOOR AIR TEMPS USED TO DETERMINE MEAN DAILY VALUE IN GASASHR
DO 18 JT=1,NROOMS
TMRSUM(JT)=TMRSUM(JT)+TMR(JT)
18 TISUM(JT)=TISUM(JT)+TI(JT)
ISUM=ISUM+1
C - - - - - - - - - - - - - - - - - - - -
C--------MOISTURE BALANCE ON ROOM
C DEACTIVATE IN HEATING MODE TO SAVE TIME.
C IN HEATING MODE, CALC MOISTURE WITH HUMIDIFIER OPERATION
IF(IMODE.EQ.1.OR.(IMODE.EQ.2.AND.CFMBP.GT.0.))THEN
CALL WIZONE(AIRMAS,FINFB,FLOC,FLOW10,FLOW14,WIN,
+ WIM,WINF,WINFC,WINFS,WINFSS,WINT,IDBG)
C FIND REL HUMIDITY TO EVAP COIL, RHIN
IPSY=-4
WIMN=AVGWV(WI,NROOMS,ROMVOL)
CALL PSY (IPSY, TIMN, TDUM, TDUM, RHIN, WIMN, HDUM)
ELSE
DO 19 JT=1,NROOMS
19 WIN(JT)=WI(JT)
RHIN = RELHMI
ENDIF
IF (IWATER.GT.0 .AND. IWATER.LT.120) THEN
IWATER=IWATER+1
WRITE(60, 501) RHIN, WIMN, WINF, WINT, WHUM, WINFS
END IF
C
C--------FIND NEW SET POINTS FOR ALL THERMOSTATS
C ALSO PRINT EVENT FILES: AND IF IBPRT, PRINT TI AND ALL EVENTS
CALL TSTATD (5, IAC, IAC1, IBURN, IEFAN, IDBG)
IF (MODE.LE.1) THEN
RHSN=TCRH*(RHI-RHS)+RHS
IHUMN=(1.-.0001*(RHSN-(SETHS+DIFFHS*IHUM)))*IBLPF (I10)
END IF
C
C========WRITE PROGRAM GENERATED EVENT FILE(MOVED TO TSTATD 3/7/88)
C MEAN SUPPLY AIR TEMP TO ACTIVELY CONDITIONED ZONES
TSUPM=AVGWV(TSUP,NROOMS,RWSDCT)
C
C========ILINES USAGE:
C = 1, DEBUG PRINT
C = 2, STORE HOURLY TOTALS
C = 3, SKIP DEBUG AND HOURLY STORAGE
IF (ILINES.EQ.3) GO TO 30
IF (ILINES.EQ.1) THEN
WRITE(60, 503) TIME, TODDB, TI(1), RHI, TPL, TSUPM,
+ TRETB, TBAS, TATTC(1), TFLUE, IAC, IBURN, IEFAN, IHON,
+ EXCESS
WRITE(60, 504) QVENTB, QSUPB, QRETB, QPLENB, QDRAFT,
+ QINFFRN, QBASFT, I10
WRITE(60, *) 'QDUCTZ, WDUCTZ...', QDUCTZ, WDUCTZ
LINES=LINES+1
IF (LINES.GT.IDEBUG .AND. NSEQW.EQ.0) ILINES=3
IF (NDPRE.NE.0) GO TO 30
END IF
C--------END OF SPACE CALCULATIONS
C--------CALCULATE HOURLY TOTALS
HROUT (1, IT)=HROUT (1, IT)+TODDB
HROUT (2, IT)=HROUT (2, IT)+TIMN
HROUT (3, IT)=HROUT (3, IT)+RHI
HROUT (4, IT)=HROUT (4, IT)+IAC
HROUT (5, IT)=HROUT (5, IT)+IBURN
HROUT (6, IT)=HROUT (6, IT)+IEFAN-IAC
HROUT (7, IT)=HROUT (7, IT)+QEXT+QP
HROUT (8, IT)=HROUT (8, IT)+EFANPH*(IEFAN-IAC)
HROUT (9, IT)=HROUT (9, IT)+CMPUMP
HROUT (10, IT)=HROUT (10, IT)+QSUM1
HROUT (11, IT)=HROUT (11, IT)+QCEIL4
HROUT (12, IT)=HROUT (12, IT)+QINF
HROUT (13, IT)=HROUT (13, IT)+QWINST
C SUM THE DUCT LOSSES NOT IN THE CONDITIONED SPACE
SQDZ=0.0
IQDZS=2
IF(ICTRLZ(NZNBAS).NE.0)IQDZS=3
DO 20 IQDZ=IQDZS,8
SQDZ=SQDZ+QDUCTZ (IQDZ)
20 CONTINUE
HROUT (14, IT)=HROUT (14, IT)+QSUM2-SQDZ-QDCTZF
HROUT (15, IT)=HROUT (15, IT)+
+ (WINF+WINT+VMIX*(WMIXS-WIM)+WINFS)*1061.
HROUT (16, IT)=HROUT (16, IT)-TCR
HROUT (17, IT)=HROUT (17, IT)-SHCR
HROUT (18, IT)=HROUT (18, IT)+POW*IAC
HROUT (19, IT)=HROUT (19, IT)+EFANC*IAC
HROUT (20, IT)=HROUT (20, IT)+CFANPC*IAC
HROUT (21, IT)=HROUT (21, IT)+FLOW11*(TPL-TRETB)
HROUT (22, IT)=HROUT (22, IT)+QFRLFE*IFLC1+QVNTLS
HROUT (23, IT)=HROUT (23, IT)+TMIX
HROUT (24, IT)=HROUT (24, IT)+TBAS
HROUT (25, IT)=HROUT (25, IT)+QFRLFE*(1-IFLC1)
HROUT (26, IT)=HROUT (26, IT)+WSPED
HROUT (27, IT)=HROUT (27, IT)+WAIRB
C HROUT (28, IT) IS COLLECTED AT THE END OF EACH HOUR IN HOUS_II
ACINV=AVGWV(ACINFL,NROOMS,ROMVOL)
HROUT (29, IT)=HROUT (29, IT)+ACINV
TOTVOL=TOTV(ROMVOL,NROOMS)
HROUT (30, IT)=HROUT (30, IT)+
+ WAIRB*PHI*SRCEAB/(RHOAIR*TOTVOL)
HROUT (31, IT)=HROUT (31, IT)+TSUPM
TATCM=AVGWV(TATTC,NATC,ATCVOL)
HROUT (32, IT)=HROUT (32, IT)+TATCM
HROT(1,IT)=HROT(1,IT)+SQDZ
HROT(2,IT)=HROT(2,IT)+QNT
HROT(3,IT)=HROT(3,IT)+QDCTZN
C
IF (IAPRT.EQ.1) THEN
C NOTE----VALUES BELOW ARE FOR ATTIC 1 ONLY
ATOUT (1, IT)=ATOUT (1, IT)+TRO
ATOUT (2, IT)=ATOUT (2, IT)+TMP(1,IZT+1)
ATOUT (3, IT)=ATOUT (3, IT)+TMP(4,IZT+1)
ATOUT (4, IT)=ATOUT (4, IT)+TMP(1,IZWC)
ATOUT (5, IT)=ATOUT (5, IT)+TMP(4,IZWC)
C ATOUT (6, IT)=NOT USED CURRENTLY
ATOUT (7, IT)=ATOUT (7, IT)+0.
ATOUT (8, IT)=ATOUT (8, IT)+QLOSRF
ATOUT (9, IT)=ATOUT (9, IT)+QCONRF
ATOUT (10, IT)=ATOUT (10, IT)+QSKY
ATOUT (11, IT)=ATOUT (11, IT)+QCRAD
END IF
C
IF (WHUM.LT.0.0) WHUM=0.0
WATER=WATER+WHUM
QSPT=QSPT+QSP
QWAS=QWAS+QWA
QHUMT=QHUMT+QHUM
HUMON=HUMON+IHUM
INC=INC+1
NROUT (IT)=NROUT (IT)+1
C
C--------KEEP TRACK OF HANDBOOK FACTORS
C
IF (HBKRNL.GE.0.0) THEN
HBKPEI=QEXT+QP
HBKAEI=BTUKWH*(CMPUMP+EFANPH*(IEFAN-IAC)+EFANPC*IAC)
C SUM OF DUCT LOSSES IN CONDITIONED SPACE
SQDZCS=QDUCTZ(1)
IF(ICTRLZ(NZNBAS).NE.0)SQDZCS=SQDZCS+QDUCTZ(2)
IF(NROOMS.GT.1)THEN
IQ=8
DO 22 IR=2,NROOMS
IQ=IQ+1
SQDZCS=SQDZCS+QDUCTZ(IQ)
22 CONTINUE
ENDIF
HBK (1)=HBK (1)+FLOW11*(TA2-TMIX)
HBK (2)=HBK (2)+(HBKPEI+HBKAEI)-(QVLLOS+QVSLOS)
HBK (3)=HBK (3)+QPLEN*NCELLS+(SQDZ+SQDZCS)+QNT
HBK (4)=HBK (4)+HBKPEI
HBK (5)=HBK (5)+HBKAEI
HBK (6)=HBK (6)+QNT
HBK (7)=HBK (7)+QNT+QVNTLS+SQDZCS+(QFRLFE)*IFLC1
END IF
C
C--------COLLECT DATA FOR WRITING
IF (ICOLL.NE.0) THEN
CTIME (1)=KM
CTIME (2)=IDAYM
CTIME (3)=IT
CTIME (4)=TIME
C
C CDATA (5 TO 16) IS SET IN GASF
C
CDATA (17)=TRETB
CDATA (18)=TSUPM
CDATA (19)=HROUT (7, IT)
CDATA (20)=HROUT (8, IT)
CDATA (21)=TIMN
CDATA (22)=TMR(1)
CDATA (23)=QIZONE
IF(NROOMS.GT.1)CDATA(23)=TMR(2)
CDATA (24)=TBAS
CDATA (25)=TATCM
CDATA (26)=TMP(1,IZWJ)
CDATA (27)=TMP(3,IZWJ)
CDATA (28)=WSPED
CDATA (29)=ACINV
CDATA (30)=VENBAS
C
CDATA (32)=TGARAG
CDATA (33)=TODDB
FLWINT=TOTV(FLOWIN,NROOMS)
CDATA (34)=FLWINT
CDATA (35)=TMP(1,IZWF)
C ABOVE GROUND BASEMENT WALL (IZWD)
CDATA (36)=TMP(3,IZWK)
CDATA (37)=TMP(4,IZWS(2))
CDATA (38)=TMP(4,IZT+1)
CDATA (39)=TMP(4,IZWC)
CDATA (40)=TMP(4,IZWS(1))
CDATA (41)=TMP(4,IZWS(3))
CDATA (42)=TMP(4,IZWS(4))
CDATA (43)=TMP(3,IZWF)
CDATA (44)=TMP(1,IZWK)
CDATA (45)=TMP(1,IZWS(2))
CDATA (46)=TMP(1,IZT+1)
CDATA (47)=TMP(1,IZWC)
CDATA (48)=TMP(3,IZWG)
CDATA (49)=TODAG1
CDATA (50)=TODAG2
DO 24 IR=1,NROOMS
NRM=NRMA(IR)
CDATA(50+NRM)=TI(NRM)
CDATA(55+NRM)=TMR(NRM)
24 CONTINUE
C CDATA (64) IS SET IN TSTAT
C
CALL COLLECT (1)
ENDIF
C
IF (INC.EQ.MPRINT) THEN
MPRINT=MPRINT+NINC
WRITE(60, 505) TIME, TODDB, TI(1), RHI, TPL, TSUPM,
+ TRETB, TBAS, TATTC(1), TFLUE, IAC, IBURN, IEFAN, IHON,
+ EXCESS
END IF
C
C--------CHECK FOR CYCLING OF A/C
IF (IACN.NE.IAC) ICYCCP=ICYCCP+1
C
C--------CHECK FOR CYCLING OF THE BURNER AND COLLECT TIME AND TEMP
IF ((IBURNN*(1-2*IBURN)+IBURN).GE.1) THEN
ICYC1=ICYC1+1
IF (IBURNN.EQ.0 .AND. ICYC1.GT.1) THEN
TON=TIME-TIMCYL
IF (TON.GT.TONMAX) TONMAX=TON
END IF
TIMCYL=TIME
END IF
IF (IHUMN.NE.IHUM) ICYC6=ICYC6+1
C--------RESET VALUES
30 CONTINUE
DO 32 JT=1,NROOMS
TI(JT)=TIN(JT)
32 WI(JT)=WIN(JT)
RHI=RHIN
C--------RESET VALUES IN THERMOSTAT MODEL
CALL TSTATD (6, IAC, IAC1, IBURN, IEFAN,IDBG)
RHS=RHSN
TBAS=TBASN
WBAS=WBASN
TCRW=TCRWN
IAC=IACN
RHA=RHA+RHI
QLSWL=0.
QLSFL=0.
SOLRQ=0.
DO 34 JT=1,NROOMS
NRM=NRMA(JT)
QLSWL=QLSWL+QLOSWL(NRM)
QLSFL=QLSFL+QLOSFL(NRM)
SOLRQ=SOLRQ+SOLARL(NRM+2)
34 TA(NRM)=TA(NRM)+TI(NRM)
DO 36 IA=1,NATC
TATTC(IA)=TATTCN(IA)
36 TATTA(IA)=TATTA(IA)+TATTC(IA)
TCRWA=TCRWA+TCRW
TS=TS+TVENTI
IHUM=IHUMN
C--------RESET THE EVAP FAN FLOW RATE VALUE
IBL=1+IAC
TBASA=TBASA+TBAS
C
EFAN=EFANPH*(IEFAN-IAC)
CALL QACCUM (TINDEX, DTIME, 56, QWALL (1), QWALL (2),
+ QWALL (3), QWALL (4), QWGR, QFLSPB, QFLSPC, QLSWL,
+ QWALL(6), QWINST, QINF, QSLFL, QPART, QLSFL, QINT, QINC,
+ QRAD, QNT, QDUCTZ (1), SOLRQ, QVNTLS, QSUM1, QSUM2,
+ QSUM, QLOSRF, QBWAG, QBWBGT, QBASFT, QFLBAS, QBASVN, QFRLFE,
+ QDUCTZ (2), QLEAK, QVENTB, QWALL(5),
+ QRADRF, QCEIL1, QAVENT, QVENTA, QPLENB, QDRAFT, QINFFRN,
+ CMPUMP, QPLEN, QJACK, QVSLOS, QVLLOS, QEXT, EFAN,
+ QP, QFLCRW, QCRWVN, QGRND)
C--------STEP TIME
TIME=TIME+DTIME
TINDEX=TINDEX+DTIME
TIMEOY=TINDEX-24.0
RLOADS=RLOADS+SHCR*IAC
RLOADL=RLOADL+(TCR-SHCR)*IAC
POWA=POWA+POW*IAC
C IF(ITMQQ.GE.24)GO TO 52
50 CONTINUE
C
IF(IDBG.NE.0)THEN
DO 60 IZU=1,IZT
60 WRITE(60,506)IZU,(TMP(I,IZU),I=1,4)
ENDIF
RETURN
C
500 FORMAT (' LOOP:QIFRNB,XQADNC,PHI,PHIINF,WAIRB,CPAIR,SRCEAB,',
+'TI(1),TCOMB,TODDB= '/2X,5G13.5/4X,5G13.5)
501 FORMAT (' WATER BAL INFO ', 6E12.4)
503 FORMAT (1X, F8.3, 9F10.2, 4I5, F8.3, ' *')
504 FORMAT (7E13.4, I5)
505 FORMAT (1X, F8.3, 9F10.2, 4I5, F8.3)
506 FORMAT(1X,'IZW,(TMP(I,IZW),I=1,4)=',I5,4G13.5)
7081 FORMAT(32X,'HOUR= ',I3,' DAY= ',I4)
END