SUBROUTINE GatherHeatGainReport(IndexTypeKey)
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer
! DATE WRITTEN August 2011
! MODIFIED na
! RE-ENGINEERED na
!PURPOSE OF THIS SUBROUTINE:
! Gathers the data each zone timestep for the heat gain report.
!
! The routine generates an annual table with the following columns which correspond to
! the output variables and data structures shown:
!
! Column Output Variable Internal Data Structure Timestep Type
! ------ --------------- ----------------------- -------- -----
! HVAC Input Sensible Air Heating Zone Air Heat Balance System Air Transfer Rate ZnAirRpt()%SumMCpDTsystem HVAC Rate
! Zone Air Heat Balance System Convective Heat Gain Rate ZnAirRpt()%SumNonAirSystem HVAC Rate
!
! HVAC Input Sensible Air Cooling Zone Air Heat Balance System Air Transfer Rate ZnAirRpt()%SumMCpDTsystem HVAC Rate
! Zone Air Heat Balance System Convective Heat Gain Rate ZnAirRpt()%SumNonAirSystem HVAC Rate
!
! HVAC Input Heated Surface Heating Electric Low Temp Radiant Heating Energy ElecRadSys()%HeatEnergy HVAC Energy
! Zone Ventilated Slab Radiant Heating Energy VentSlab()%RadHeatingEnergy HVAC Energy
! Hydronic Low Temp Radiant Heating Energy HydrRadSys()%HeatEnergy HVAC Energy
! Constant Flow Low Temp Radiant Heating Energy CFloRadSys()%HeatEnergy HVAC Energy
!
! HVAC Input Cooled Surface Cooling Zone Ventilated Slab Radiant Cooling Energy -VentSlab()%RadCoolingEnergy HVAC Energy
! Hydronic Low Temp Radiant Cooling Energy -HydrRadSys()%CoolEnergy HVAC Energy
! Constant Flow Low Temp Radiant Cooling Energy -CFloRadSys()%CoolEnergy HVAC Energy
!
! People Sensible Heat Addition Zone People Sensible Heating Energy ZnRpt()%PeopleSenGain Zone Energy
!
! Lights Sensible Heat Addition Zone Lights Total Heating Energy ZnRpt()%LtsTotGain Zone Energy
!
! Equipment Sensible Heat Addition Zone Electric Equipment Radiant Heating Energy ZnRpt()%ElecRadGain Zone Energy
! Zone Gas Equipment Radiant Heating Energy ZnRpt()%GasRadGain Zone Energy
! Zone Steam Equipment Radiant Heating Energy ZnRpt()%SteamRadGain Zone Energy
! Zone Hot Water Equipment Radiant Heating Energy ZnRpt()%HWRadGain Zone Energy
! Zone Other Equipment Radiant Heating Energy ZnRpt()%OtherRadGain Zone Energy
! Zone Electric Equipment Convective Heating Energy ZnRpt()%ElecConGain Zone Energy
! Zone Gas Equipment Convective Heating Energy ZnRpt()%GasConGain Zone Energy
! Zone Steam Equipment Convective Heating Energy ZnRpt()%SteamConGain Zone Energy
! Zone Hot Water Equipment Convective Heating Energy ZnRpt()%HWConGain Zone Energy
! Zone Other Equipment Convective Heating Energy ZnRpt()%OtherConGain Zone Energy
!
! Window Heat Addition Zone Windows Total Heat Gain Energy ZoneWinHeatGainRepEnergy() Zone Energy
!
! Interzone Air Transfer Heat Addition Zone Air Heat Balance Interzone Air Transfer Rate ZnAirRpt()%SumMCpDTzones HVAC Rate
!
! Infiltration Heat Addition Zone Air Heat Balance Outdoor Air Transfer Rate ZnAirRpt()%SumMCpDtInfil HVAC Rate
!
! Equipment Sensible Heat Removal Zone Electric Equipment Radiant Heating Energy ZnRpt()%ElecRadGain Zone Energy
! Zone Gas Equipment Radiant Heating Energy ZnRpt()%GasRadGain Zone Energy
! Zone Steam Equipment Radiant Heating Energy ZnRpt()%SteamRadGain Zone Energy
! Zone Hot Water Equipment Radiant Heating Energy ZnRpt()%HWRadGain Zone Energy
! Zone Other Equipment Radiant Heating Energy ZnRpt()%OtherRadGain Zone Energy
! Zone Electric Equipment Convective Heating Energy ZnRpt()%ElecConGain Zone Energy
! Zone Gas Equipment Convective Heating Energy ZnRpt()%GasConGain Zone Energy
! Zone Steam Equipment Convective Heating Energy ZnRpt()%SteamConGain Zone Energy
! Zone Hot Water Equipment Convective Heating Energy ZnRpt()%HWConGain Zone Energy
! Zone Other Equipment Convective Heating Energy ZnRpt()%OtherConGain Zone Energy
!
! Window Heat Removal Zone Windows Total Heat Loss Energy -ZoneWinHeatLossRepEnergy() Zone Energy
!
! Interzone Air Transfer Heat Removal Zone Air Heat Balance Interzone Air Transfer Rate ZnAirRpt()%SumMCpDTzones HVAC Rate
!
! Infiltration Heat Removal Zone Air Heat Balance Outdoor Air Transfer Rate ZnAirRpt()%SumMCpDtInfil HVAC Rate
!
! The following two columns are derived based on the values of the other columns and need to be computed on every HVAC timestep.
! Opaque Surface Conduction and Other Heat Addition
! Opaque Surface Conduction and Other Heat Removal
!
! For variables that are updated on a zone timestep basis, the values are used on the HVAC timestep but are ratioed by the
! timestep lengths.
!
! The peak reports follow a similar example.
! USE STATEMENTS:
USE DataHeatBalance, ONLY: ZonePreDefRep, ZnAirRpt, ZnRpt, &
ZoneWinHeatGainRepEnergy, ZoneWinHeatLossRepEnergy, &
ZoneWinHeatGainRep,ZoneWinHeatLossRep, &
BuildingPreDefRep
USE VentilatedSlab, ONLY: VentSlab, NumOfVentSlabs
USE LowTempRadiantSystem, ONLY: HydrRadSys, NumOfHydrLowTempRadSys, &
CFloRadSys, NumOfCFloLowTempRadSys, &
ElecRadSys, NumOfElecLowTempRadSys
USE DataEnvironment, ONLY: Month, DayOfMonth
USE OutputReportPredefined, ONLY: pdrSensibleGain, reportName
USE DataHVACGlobals, ONLY: TimeStepSys,SysTimeElapsed
USE General, ONLY: EncodeMonDayHrMin,DetermineMinuteForReporting
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: IndexTypeKey ! What kind of data to update (Zone, HVAC)
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64),PARAMETER :: FracToMin=60.0d0
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: iZone = 0
INTEGER :: iRadiant = 0
INTEGER :: curZone = 0
REAL(r64) :: eqpSens = 0.0d0
REAL(r64) :: total = 0.0d0
! the following arrays store the radiant total for each timestep
REAL(r64), ALLOCATABLE, DIMENSION(:),SAVE :: radiantHeat
REAL(r64), ALLOCATABLE, DIMENSION(:),SAVE :: radiantCool
INTEGER :: timestepTimeStamp = 0
REAL(r64) :: bldgHtPk = 0.0d0
REAL(r64) :: bldgClPk = 0.0d0
REAL(r64) :: timeStepRatio = 0.0d0
LOGICAL, SAVE :: firstTime=.true.
integer ActualTimeMin
IF (.NOT. DoWeathSim) RETURN
IF (.not. reportName(pdrSensibleGain)%show) RETURN !don't gather data if report isn't requested
IF (IndexTypeKey .EQ. stepTypeZone) RETURN !only add values over the HVAC timestep basis
IF (firstTime) THEN
ALLOCATE(radiantHeat(NumOfZones))
ALLOCATE(radiantCool(NumOfZones))
firstTime=.false.
END IF
!clear the radiant surface accumulation variables
radiantHeat=0.0d0
radiantCool=0.0d0
!--------------------
! ANNUAL
!--------------------
timeStepRatio = TimeStepSys/TimeStepZone !the fraction of the zone time step used by the system timestep
DO iZone = 1, NumOfZones
!People Sensible Heat Addition
ZonePreDefRep(iZone)%SHGSAnPeoplAdd = ZonePreDefRep(iZone)%SHGSAnPeoplAdd + ZnRpt(iZone)%PeopleSenGain * timeStepRatio
!Lights Sensible Heat Addition
ZonePreDefRep(iZone)%SHGSAnLiteAdd = ZonePreDefRep(iZone)%SHGSAnLiteAdd + ZnRpt(iZone)%LtsTotGain * timeStepRatio
!HVAC Input Sensible Air Heating
!HVAC Input Sensible Air Cooling
IF ((ZnAirRpt(iZone)%SumMCpDTsystem + ZnAirRpt(iZone)%SumNonAirSystem) .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSAnHvacHt = ZonePreDefRep(iZone)%SHGSAnHvacHt + &
ZnAirRpt(iZone)%SumMCpDTsystem * TimeStepSys * SecInHour &
+ ZnAirRpt(iZone)%SumNonAirSystem * TimeStepSys * SecInHour
ELSE
ZonePreDefRep(iZone)%SHGSAnHvacCl = ZonePreDefRep(iZone)%SHGSAnHvacCl + &
ZnAirRpt(iZone)%SumMCpDTsystem * TimeStepSys * SecInHour &
+ ZnAirRpt(iZone)%SumNonAirSystem * TimeStepSys * SecInHour
END IF
!Interzone Air Transfer Heat Addition
!Interzone Air Transfer Heat Removal
IF (ZnAirRpt(iZone)%SumMCpDTzones .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSAnIzaAdd = ZonePreDefRep(iZone)%SHGSAnIzaAdd + &
ZnAirRpt(iZone)%SumMCpDTzones * TimeStepSys * SecInHour
ELSE
ZonePreDefRep(iZone)%SHGSAnIzaRem = ZonePreDefRep(iZone)%SHGSAnIzaRem + &
ZnAirRpt(iZone)%SumMCpDTzones * TimeStepSys * SecInHour
END IF
!Window Heat Addition
!Window Heat Removal
ZonePreDefRep(iZone)%SHGSAnWindAdd = ZonePreDefRep(iZone)%SHGSAnWindAdd + ZoneWinHeatGainRepEnergy(iZone) * timeStepRatio
ZonePreDefRep(iZone)%SHGSAnWindRem = ZonePreDefRep(iZone)%SHGSAnWindRem - ZoneWinHeatLossRepEnergy(iZone) * timeStepRatio
!Infiltration Heat Addition
!Infiltration Heat Removal
IF (ZnAirRpt(iZone)%SumMCpDtInfil .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSAnInfilAdd = ZonePreDefRep(iZone)%SHGSAnInfilAdd + &
ZnAirRpt(iZone)%SumMCpDtInfil * TimeStepSys * SecInHour
ELSE
ZonePreDefRep(iZone)%SHGSAnInfilRem = ZonePreDefRep(iZone)%SHGSAnInfilRem + &
ZnAirRpt(iZone)%SumMCpDtInfil * TimeStepSys * SecInHour
END IF
!Equipment Sensible Heat Addition
!Equipment Sensible Heat Removal
! the following variables are already gains so they do not need to be converted by multiplying by time.
eqpSens = (ZnRpt(iZone)%ElecRadGain + ZnRpt(iZone)%GasRadGain + ZnRpt(iZone)%HWRadGain + &
ZnRpt(iZone)%SteamRadGain + ZnRpt(iZone)%OtherRadGain + ZnRpt(iZone)%ElecConGain + &
ZnRpt(iZone)%GasConGain + ZnRpt(iZone)%HWConGain + ZnRpt(iZone)%SteamConGain + &
ZnRpt(iZone)%OtherConGain) &
* timeStepRatio
IF (eqpSens .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSAnEquipAdd = ZonePreDefRep(iZone)%SHGSAnEquipAdd + eqpSens
ELSE
ZonePreDefRep(iZone)%SHGSAnEquipRem = ZonePreDefRep(iZone)%SHGSAnEquipRem + eqpSens
ENDIF
END DO
! HVAC Input Heated Surface Heating
! HVAC Input Cooled Surface Cooling
DO iRadiant = 1, NumOfVentSlabs
curZone = VentSlab(iRadiant)%ZonePtr
IF ((curZone .GT. 0) .AND. (curZone .LE. NumOfZones)) THEN
ZonePreDefRep(curZone)%SHGSAnSurfHt = ZonePreDefRep(curZone)%SHGSAnSurfHt + VentSlab(iRadiant)%RadHeatingEnergy
ZonePreDefRep(curZone)%SHGSAnSurfCl = ZonePreDefRep(curZone)%SHGSAnSurfCl - VentSlab(iRadiant)%RadCoolingEnergy
radiantHeat(curZone) = VentSlab(iRadiant)%RadHeatingPower
radiantCool(curZone) = -VentSlab(iRadiant)%RadCoolingPower
END IF
END DO
DO iRadiant = 1, NumOfHydrLowTempRadSys
curZone = HydrRadSys(iRadiant)%ZonePtr
IF ((curZone .GT. 0) .AND. (curZone .LE. NumOfZones)) THEN
ZonePreDefRep(curZone)%SHGSAnSurfHt = ZonePreDefRep(curZone)%SHGSAnSurfHt + HydrRadSys(iRadiant)%HeatEnergy
ZonePreDefRep(curZone)%SHGSAnSurfCl = ZonePreDefRep(curZone)%SHGSAnSurfCl - HydrRadSys(iRadiant)%CoolEnergy
radiantHeat(curZone) = radiantHeat(curZone) + HydrRadSys(iRadiant)%HeatPower
radiantCool(curZone) = radiantCool(curZone) - HydrRadSys(iRadiant)%CoolPower
END IF
END DO
DO iRadiant = 1, NumOfCFloLowTempRadSys
curZone = CFloRadSys(iRadiant)%ZonePtr
IF ((curZone .GT. 0) .AND. (curZone .LE. NumOfZones)) THEN
ZonePreDefRep(curZone)%SHGSAnSurfHt = ZonePreDefRep(curZone)%SHGSAnSurfHt + CFloRadSys(iRadiant)%HeatEnergy
ZonePreDefRep(curZone)%SHGSAnSurfCl = ZonePreDefRep(curZone)%SHGSAnSurfCl - CFloRadSys(iRadiant)%CoolEnergy
radiantHeat(curZone) = radiantHeat(curZone) + CFloRadSys(iRadiant)%HeatPower
radiantCool(curZone) = radiantCool(curZone) - CFloRadSys(iRadiant)%CoolPower
END IF
END DO
DO iRadiant = 1, NumOfElecLowTempRadSys
curZone = ElecRadSys(iRadiant)%ZonePtr
IF ((curZone .GT. 0) .AND. (curZone .LE. NumOfZones)) THEN
ZonePreDefRep(curZone)%SHGSAnSurfHt = ZonePreDefRep(curZone)%SHGSAnSurfHt + ElecRadSys(iRadiant)%HeatEnergy
radiantHeat(curZone) = radiantHeat(curZone) + ElecRadSys(iRadiant)%HeatPower
END IF
END DO
! Opaque Surface Conduction and Other Heat Addition
! Opaque Surface Conduction and Other Heat Removal
DO iZone = 1, NumOfZones
total = ZonePreDefRep(iZone)%SHGSAnPeoplAdd &
+ ZonePreDefRep(iZone)%SHGSAnLiteAdd &
+ ZonePreDefRep(iZone)%SHGSAnHvacHt &
+ ZonePreDefRep(iZone)%SHGSAnHvacCl &
+ ZonePreDefRep(iZone)%SHGSAnIzaAdd &
+ ZonePreDefRep(iZone)%SHGSAnIzaRem &
+ ZonePreDefRep(iZone)%SHGSAnWindAdd &
+ ZonePreDefRep(iZone)%SHGSAnWindRem &
+ ZonePreDefRep(iZone)%SHGSAnInfilAdd &
+ ZonePreDefRep(iZone)%SHGSAnInfilRem &
+ ZonePreDefRep(iZone)%SHGSAnEquipAdd &
+ ZonePreDefRep(iZone)%SHGSAnEquipRem &
+ ZonePreDefRep(iZone)%SHGSAnSurfHt &
+ ZonePreDefRep(iZone)%SHGSAnSurfCl
total = -total !want to know the negative value of the sum since the row should add up to zero
IF (total .GT. 0) THEN
ZonePreDefRep(iZone)%SHGSAnOtherAdd = total
ELSE
ZonePreDefRep(iZone)%SHGSAnOtherRem = total
ENDIF
END DO
!--------------------------------
! ZONE PEAK COOLING AND HEATING
!--------------------------------
DO iZone = 1, NumOfZones
IF ((ZnAirRpt(iZone)%SumMCpDTsystem + radiantHeat(iZone)+ ZnAirRpt(iZone)%SumNonAirSystem) .GT. 0) THEN
IF ((ZnAirRpt(iZone)%SumMCpDTsystem + radiantHeat(iZone)+ ZnAirRpt(iZone)%SumNonAirSystem) &
.GT. ZonePreDefRep(iZone)%htPeak) THEN
ZonePreDefRep(iZone)%htPeak = ZnAirRpt(iZone)%SumMCpDTsystem + radiantHeat(iZone) + ZnAirRpt(iZone)%SumNonAirSystem
!determine timestamp
! ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed
! ActualtimeE = ActualTimeS+TimeStepSys
! ActualTimeHrS=INT(ActualTimeS)
! ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin)
ActualTimeMin=DetermineMinuteForReporting(IndexTypeKey)
CALL EncodeMonDayHrMin(timestepTimeStamp,Month,DayOfMonth,HourOfDay,ActualTimeMin)
ZonePreDefRep(iZone)%htPtTimeStamp = timestepTimeStamp
!HVAC Input Sensible Air Heating
!HVAC Input Sensible Air Cooling
ZonePreDefRep(iZone)%SHGSHtHvacHt = ZnAirRpt(iZone)%SumMCpDTsystem + ZnAirRpt(iZone)%SumNonAirSystem
ZonePreDefRep(iZone)%SHGSHtHvacCl = 0.0d0
! HVAC Input Heated Surface Heating
! HVAC Input Cooled Surface Cooling
ZonePreDefRep(iZone)%SHGSHtSurfHt = radiantHeat(iZone)
ZonePreDefRep(iZone)%SHGSHtSurfCl = radiantCool(iZone)
!People Sensible Heat Addition
ZonePreDefRep(iZone)%SHGSHtPeoplAdd = ZnRpt(iZone)%PeopleSenGainRate
!Lights Sensible Heat Addition
ZonePreDefRep(iZone)%SHGSHtLiteAdd = ZnRpt(iZone)%LtsTotGainRate
!Equipment Sensible Heat Addition
!Equipment Sensible Heat Removal
eqpSens = ZnRpt(iZone)%ElecRadGainRate + ZnRpt(iZone)%GasRadGainRate &
+ ZnRpt(iZone)%HWRadGainRate + ZnRpt(iZone)%SteamRadGainRate + ZnRpt(iZone)%OtherRadGainRate &
+ ZnRpt(iZone)%ElecConGainRate + ZnRpt(iZone)%GasConGainRate + ZnRpt(iZone)%HWConGainRate &
+ ZnRpt(iZone)%SteamConGainRate + ZnRpt(iZone)%OtherConGainRate
IF (eqpSens .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSHtEquipAdd = eqpSens
ZonePreDefRep(iZone)%SHGSHtEquipRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSHtEquipAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSHtEquipRem = eqpSens
END IF
!Window Heat Addition
!Window Heat Removal
ZonePreDefRep(iZone)%SHGSHtWindAdd = ZoneWinHeatGainRep(iZone)
ZonePreDefRep(iZone)%SHGSHtWindRem = -ZoneWinHeatLossRep(iZone)
IF (ZnAirRpt(iZone)%SumMCpDTzones .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSHtIzaAdd = ZnAirRpt(iZone)%SumMCpDTzones
ZonePreDefRep(iZone)%SHGSHtIzaRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSHtIzaAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSHtIzaRem = ZnAirRpt(iZone)%SumMCpDTzones
ENDIF
!Infiltration Heat Addition
!Infiltration Heat Removal
IF (ZnAirRpt(iZone)%SumMCpDtInfil .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSHtInfilAdd = ZnAirRpt(iZone)%SumMCpDtInfil
ZonePreDefRep(iZone)%SHGSHtInfilRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSHtInfilAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSHtInfilRem = ZnAirRpt(iZone)%SumMCpDtInfil
ENDIF
! Opaque Surface Conduction and Other Heat Addition
! Opaque Surface Conduction and Other Heat Removal
total = ZonePreDefRep(iZone)%SHGSHtPeoplAdd &
+ ZonePreDefRep(iZone)%SHGSHtLiteAdd &
+ ZonePreDefRep(iZone)%SHGSHtHvacHt &
+ ZonePreDefRep(iZone)%SHGSHtHvacCl &
+ ZonePreDefRep(iZone)%SHGSHtIzaAdd &
+ ZonePreDefRep(iZone)%SHGSHtIzaRem &
+ ZonePreDefRep(iZone)%SHGSHtWindAdd &
+ ZonePreDefRep(iZone)%SHGSHtWindRem &
+ ZonePreDefRep(iZone)%SHGSHtInfilAdd &
+ ZonePreDefRep(iZone)%SHGSHtInfilRem &
+ ZonePreDefRep(iZone)%SHGSHtEquipAdd &
+ ZonePreDefRep(iZone)%SHGSHtEquipRem &
+ ZonePreDefRep(iZone)%SHGSHtSurfHt &
+ ZonePreDefRep(iZone)%SHGSHtSurfCl
total = -total !want to know the negative value of the sum since the row should add up to zero
IF (total .GT. 0) THEN
ZonePreDefRep(iZone)%SHGSHtOtherAdd = total
ZonePreDefRep(iZone)%SHGSHtOtherRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSHtOtherAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSHtOtherRem = total
ENDIF
END IF
ELSE
IF ((ZnAirRpt(iZone)%SumMCpDTsystem + radiantCool(iZone) + ZnAirRpt(iZone)%SumNonAirSystem) &
.LT. ZonePreDefRep(iZone)%clPeak) THEN
ZonePreDefRep(iZone)%clPeak = ZnAirRpt(iZone)%SumMCpDTsystem + radiantCool(iZone) + ZnAirRpt(iZone)%SumNonAirSystem
!determine timestamp
! ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed
! ActualtimeE = ActualTimeS+TimeStepSys
! ActualTimeHrS=INT(ActualTimeS)
! ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin)
ActualTimeMin=DetermineMinuteForReporting(IndexTypeKey)
CALL EncodeMonDayHrMin(timestepTimeStamp,Month,DayOfMonth,HourOfDay,ActualTimeMin)
ZonePreDefRep(iZone)%clPtTimeStamp = timestepTimeStamp
!HVAC Input Sensible Air Heating
!HVAC Input Sensible Air Cooling
ZonePreDefRep(iZone)%SHGSClHvacHt = 0.0d0
ZonePreDefRep(iZone)%SHGSClHvacCl = ZnAirRpt(iZone)%SumMCpDTsystem + ZnAirRpt(iZone)%SumNonAirSystem
! HVAC Input Heated Surface Heating
! HVAC Input Cooled Surface Cooling
ZonePreDefRep(iZone)%SHGSClSurfHt = radiantHeat(iZone)
ZonePreDefRep(iZone)%SHGSClSurfCl = radiantCool(iZone)
!People Sensible Heat Addition
ZonePreDefRep(iZone)%SHGSClPeoplAdd = ZnRpt(iZone)%PeopleSenGainRate
!Lights Sensible Heat Addition
ZonePreDefRep(iZone)%SHGSClLiteAdd = ZnRpt(iZone)%LtsTotGainRate
!Equipment Sensible Heat Addition
!Equipment Sensible Heat Removal
eqpSens = ZnRpt(iZone)%ElecRadGainRate + ZnRpt(iZone)%GasRadGainRate &
+ ZnRpt(iZone)%HWRadGainRate + ZnRpt(iZone)%SteamRadGainRate + ZnRpt(iZone)%OtherRadGainRate &
+ ZnRpt(iZone)%ElecConGainRate + ZnRpt(iZone)%GasConGainRate + ZnRpt(iZone)%HWConGainRate &
+ ZnRpt(iZone)%SteamConGainRate + ZnRpt(iZone)%OtherConGainRate
IF (eqpSens .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSClEquipAdd = eqpSens
ZonePreDefRep(iZone)%SHGSClEquipRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSClEquipAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSClEquipRem = eqpSens
END IF
!Window Heat Addition
!Window Heat Removal
ZonePreDefRep(iZone)%SHGSClWindAdd = ZoneWinHeatGainRep(iZone)
ZonePreDefRep(iZone)%SHGSClWindRem = -ZoneWinHeatLossRep(iZone)
IF (ZnAirRpt(iZone)%SumMCpDTzones .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSClIzaAdd = ZnAirRpt(iZone)%SumMCpDTzones
ZonePreDefRep(iZone)%SHGSClIzaRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSClIzaAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSClIzaRem = ZnAirRpt(iZone)%SumMCpDTzones
ENDIF
!Infiltration Heat Addition
!Infiltration Heat Removal
IF (ZnAirRpt(iZone)%SumMCpDtInfil .GT. 0.0d0) THEN
ZonePreDefRep(iZone)%SHGSClInfilAdd = ZnAirRpt(iZone)%SumMCpDtInfil
ZonePreDefRep(iZone)%SHGSClInfilRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSClInfilAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSClInfilRem = ZnAirRpt(iZone)%SumMCpDtInfil
ENDIF
! Opaque Surface Conduction and Other Heat Addition
! Opaque Surface Conduction and Other Heat Removal
total = ZonePreDefRep(iZone)%SHGSClPeoplAdd &
+ ZonePreDefRep(iZone)%SHGSClLiteAdd &
+ ZonePreDefRep(iZone)%SHGSClHvacHt &
+ ZonePreDefRep(iZone)%SHGSClHvacCl &
+ ZonePreDefRep(iZone)%SHGSClIzaAdd &
+ ZonePreDefRep(iZone)%SHGSClIzaRem &
+ ZonePreDefRep(iZone)%SHGSClWindAdd &
+ ZonePreDefRep(iZone)%SHGSClWindRem &
+ ZonePreDefRep(iZone)%SHGSClInfilAdd &
+ ZonePreDefRep(iZone)%SHGSClInfilRem &
+ ZonePreDefRep(iZone)%SHGSClEquipAdd &
+ ZonePreDefRep(iZone)%SHGSClEquipRem &
+ ZonePreDefRep(iZone)%SHGSClSurfHt &
+ ZonePreDefRep(iZone)%SHGSClSurfCl
total = -total !want to know the negative value of the sum since the row should add up to zero
IF (total .GT. 0) THEN
ZonePreDefRep(iZone)%SHGSClOtherAdd = total
ZonePreDefRep(iZone)%SHGSClOtherRem = 0.0d0
ELSE
ZonePreDefRep(iZone)%SHGSClOtherAdd = 0.0d0
ZonePreDefRep(iZone)%SHGSClOtherRem = total
ENDIF
END IF
END IF
END DO
!------------------------------------
! BUILDING PEAK COOLING AND HEATING
!------------------------------------
bldgHtPk = 0.0d0
bldgClPk = 0.0d0
DO iZone = 1, NumOfZones
IF ((ZnAirRpt(iZone)%SumMCpDTsystem + radiantHeat(iZone) + ZnAirRpt(iZone)%SumNonAirSystem) .GT. 0) THEN
bldgHtPk = bldgHtPk + ZnAirRpt(iZone)%SumMCpDTsystem + radiantHeat(iZone) + ZnAirRpt(iZone)%SumNonAirSystem
ELSE
bldgClPk = bldgClPk + ZnAirRpt(iZone)%SumMCpDTsystem + radiantCool(iZone) + ZnAirRpt(iZone)%SumNonAirSystem
END IF
END DO
IF (bldgHtPk .GT. BuildingPreDefRep%htPeak) THEN
BuildingPreDefRep%htPeak = bldgHtPk
!determine timestamp
! ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed
! ActualtimeE = ActualTimeS+TimeStepSys
! ActualTimeHrS=INT(ActualTimeS)
! ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin)
ActualTimeMin=DetermineMinuteForReporting(IndexTypeKey)
CALL EncodeMonDayHrMin(timestepTimeStamp,Month,DayOfMonth,HourOfDay,ActualTimeMin)
BuildingPreDefRep%htPtTimeStamp = timestepTimeStamp
!reset building level results to zero prior to accumulating across zones
BuildingPreDefRep%SHGSHtHvacHt = 0.0d0
BuildingPreDefRep%SHGSHtHvacCl = 0.0d0
BuildingPreDefRep%SHGSHtSurfHt = 0.0d0
BuildingPreDefRep%SHGSHtSurfCl = 0.0d0
BuildingPreDefRep%SHGSHtPeoplAdd = 0.0d0
BuildingPreDefRep%SHGSHtLiteAdd = 0.0d0
BuildingPreDefRep%SHGSHtEquipAdd = 0.0d0
BuildingPreDefRep%SHGSHtWindAdd = 0.0d0
BuildingPreDefRep%SHGSHtIzaAdd = 0.0d0
BuildingPreDefRep%SHGSHtInfilAdd = 0.0d0
BuildingPreDefRep%SHGSHtOtherAdd = 0.0d0
BuildingPreDefRep%SHGSHtEquipRem = 0.0d0
BuildingPreDefRep%SHGSHtWindRem = 0.0d0
BuildingPreDefRep%SHGSHtIzaRem = 0.0d0
BuildingPreDefRep%SHGSHtInfilRem = 0.0d0
BuildingPreDefRep%SHGSHtOtherRem = 0.0d0
DO iZone = 1, NumOfZones
!HVAC Input Sensible Air Heating
!HVAC Input Sensible Air Cooling
BuildingPreDefRep%SHGSHtHvacHt = BuildingPreDefRep%SHGSHtHvacHt + ZnAirRpt(iZone)%SumMCpDTsystem &
+ ZnAirRpt(iZone)%SumNonAirSystem
! HVAC Input Heated Surface Heating
! HVAC Input Cooled Surface Cooling
BuildingPreDefRep%SHGSHtSurfHt = BuildingPreDefRep%SHGSHtSurfHt + radiantHeat(iZone)
BuildingPreDefRep%SHGSHtSurfCl = BuildingPreDefRep%SHGSHtSurfCl + radiantCool(iZone)
!People Sensible Heat Addition
BuildingPreDefRep%SHGSHtPeoplAdd = BuildingPreDefRep%SHGSHtPeoplAdd + ZnRpt(iZone)%PeopleSenGainRate
!Lights Sensible Heat Addition
BuildingPreDefRep%SHGSHtLiteAdd = BuildingPreDefRep%SHGSHtLiteAdd + ZnRpt(iZone)%LtsTotGainRate
!Equipment Sensible Heat Addition
!Equipment Sensible Heat Removal
eqpSens = ZnRpt(iZone)%ElecRadGainRate + ZnRpt(iZone)%GasRadGainRate &
+ ZnRpt(iZone)%HWRadGainRate + ZnRpt(iZone)%SteamRadGainRate + ZnRpt(iZone)%OtherRadGainRate &
+ ZnRpt(iZone)%ElecConGainRate + ZnRpt(iZone)%GasConGainRate + ZnRpt(iZone)%HWConGainRate &
+ ZnRpt(iZone)%SteamConGainRate + ZnRpt(iZone)%OtherConGainRate
IF (eqpSens .GT. 0.0d0) THEN
BuildingPreDefRep%SHGSHtEquipAdd = BuildingPreDefRep%SHGSHtEquipAdd + eqpSens
ELSE
BuildingPreDefRep%SHGSHtEquipRem = BuildingPreDefRep%SHGSHtEquipRem + eqpSens
END IF
!Window Heat Addition
!Window Heat Removal
BuildingPreDefRep%SHGSHtWindAdd = BuildingPreDefRep%SHGSHtWindAdd + ZoneWinHeatGainRep(iZone)
BuildingPreDefRep%SHGSHtWindRem = BuildingPreDefRep%SHGSHtWindRem -ZoneWinHeatLossRep(iZone)
IF (ZnAirRpt(iZone)%SumMCpDTzones .GT. 0.0d0) THEN
BuildingPreDefRep%SHGSHtIzaAdd = BuildingPreDefRep%SHGSHtIzaAdd + ZnAirRpt(iZone)%SumMCpDTzones
ELSE
BuildingPreDefRep%SHGSHtIzaRem = BuildingPreDefRep%SHGSHtIzaRem + ZnAirRpt(iZone)%SumMCpDTzones
ENDIF
!Infiltration Heat Addition
!Infiltration Heat Removal
IF (ZnAirRpt(iZone)%SumMCpDtInfil .GT. 00) THEN
BuildingPreDefRep%SHGSHtInfilAdd = BuildingPreDefRep%SHGSHtInfilAdd + ZnAirRpt(iZone)%SumMCpDtInfil
ELSE
BuildingPreDefRep%SHGSHtInfilRem = BuildingPreDefRep%SHGSHtInfilRem + ZnAirRpt(iZone)%SumMCpDtInfil
ENDIF
END DO
! Opaque Surface Conduction and Other Heat Addition
! Opaque Surface Conduction and Other Heat Removal
total = BuildingPreDefRep%SHGSHtPeoplAdd &
+ BuildingPreDefRep%SHGSHtLiteAdd &
+ BuildingPreDefRep%SHGSHtHvacHt &
+ BuildingPreDefRep%SHGSHtHvacCl &
+ BuildingPreDefRep%SHGSHtIzaAdd &
+ BuildingPreDefRep%SHGSHtIzaRem &
+ BuildingPreDefRep%SHGSHtWindAdd &
+ BuildingPreDefRep%SHGSHtWindRem &
+ BuildingPreDefRep%SHGSHtInfilAdd &
+ BuildingPreDefRep%SHGSHtInfilRem &
+ BuildingPreDefRep%SHGSHtEquipAdd &
+ BuildingPreDefRep%SHGSHtEquipRem &
+ BuildingPreDefRep%SHGSHtSurfHt &
+ BuildingPreDefRep%SHGSHtSurfCl
total = -total !want to know the negative value of the sum since the row should add up to zero
IF (total .GT. 0) THEN
BuildingPreDefRep%SHGSHtOtherAdd = BuildingPreDefRep%SHGSHtOtherAdd + total
ELSE
BuildingPreDefRep%SHGSHtOtherRem = BuildingPreDefRep%SHGSHtOtherRem + total
ENDIF
END IF
IF (bldgClPk .LT. BuildingPreDefRep%clPeak) THEN
BuildingPreDefRep%clPeak = bldgClPk
!determine timestamp
! ActualTimeS = CurrentTime-TimeStepZone+SysTimeElapsed
! ActualtimeE = ActualTimeS+TimeStepSys
! ActualTimeHrS=INT(ActualTimeS)
! ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin)
ActualTimeMin=DetermineMinuteForReporting(IndexTypeKey)
CALL EncodeMonDayHrMin(timestepTimeStamp,Month,DayOfMonth,HourOfDay,ActualTimeMin)
BuildingPreDefRep%clPtTimeStamp = timestepTimeStamp
!reset building level results to zero prior to accumulating across zones
BuildingPreDefRep%SHGSClHvacHt = 0.0d0
BuildingPreDefRep%SHGSClHvacCl = 0.0d0
BuildingPreDefRep%SHGSClSurfHt = 0.0d0
BuildingPreDefRep%SHGSClSurfCl = 0.0d0
BuildingPreDefRep%SHGSClPeoplAdd = 0.0d0
BuildingPreDefRep%SHGSClLiteAdd = 0.0d0
BuildingPreDefRep%SHGSClEquipAdd = 0.0d0
BuildingPreDefRep%SHGSClWindAdd = 0.0d0
BuildingPreDefRep%SHGSClIzaAdd = 0.0d0
BuildingPreDefRep%SHGSClInfilAdd = 0.0d0
BuildingPreDefRep%SHGSClOtherAdd = 0.0d0
BuildingPreDefRep%SHGSClEquipRem = 0.0d0
BuildingPreDefRep%SHGSClWindRem = 0.0d0
BuildingPreDefRep%SHGSClIzaRem = 0.0d0
BuildingPreDefRep%SHGSClInfilRem = 0.0d0
BuildingPreDefRep%SHGSClOtherRem = 0.0d0
DO iZone = 1, NumOfZones
!HVAC Input Sensible Air Heating
!HVAC Input Sensible Air Cooling
BuildingPreDefRep%SHGSClHvacCl = BuildingPreDefRep%SHGSClHvacCl + ZnAirRpt(iZone)%SumMCpDTsystem &
+ ZnAirRpt(iZone)%SumNonAirSystem
! HVAC Input Heated Surface Heating
! HVAC Input Cooled Surface Cooling
BuildingPreDefRep%SHGSClSurfHt = BuildingPreDefRep%SHGSClSurfHt + radiantHeat(iZone)
BuildingPreDefRep%SHGSClSurfCl = BuildingPreDefRep%SHGSClSurfCl + radiantCool(iZone)
!People Sensible Heat Addition
BuildingPreDefRep%SHGSClPeoplAdd = BuildingPreDefRep%SHGSClPeoplAdd + ZnRpt(iZone)%PeopleSenGainRate
!Lights Sensible Heat Addition
BuildingPreDefRep%SHGSClLiteAdd = BuildingPreDefRep%SHGSClLiteAdd + ZnRpt(iZone)%LtsTotGainRate
!Equipment Sensible Heat Addition
!Equipment Sensible Heat Removal
eqpSens = ZnRpt(iZone)%ElecRadGainRate + ZnRpt(iZone)%GasRadGainRate &
+ ZnRpt(iZone)%HWRadGainRate + ZnRpt(iZone)%SteamRadGainRate + ZnRpt(iZone)%OtherRadGainRate &
+ ZnRpt(iZone)%ElecConGainRate + ZnRpt(iZone)%GasConGainRate + ZnRpt(iZone)%HWConGainRate &
+ ZnRpt(iZone)%SteamConGainRate + ZnRpt(iZone)%OtherConGainRate
IF (eqpSens .GT. 0.0d0) THEN
BuildingPreDefRep%SHGSClEquipAdd = BuildingPreDefRep%SHGSClEquipAdd + eqpSens
ELSE
BuildingPreDefRep%SHGSClEquipRem = BuildingPreDefRep%SHGSClEquipRem + eqpSens
END IF
!Window Heat Addition
!Window Heat Removal
BuildingPreDefRep%SHGSClWindAdd = BuildingPreDefRep%SHGSClWindAdd + ZoneWinHeatGainRep(iZone)
BuildingPreDefRep%SHGSClWindRem = BuildingPreDefRep%SHGSClWindRem - ZoneWinHeatLossRep(iZone)
IF (ZnAirRpt(iZone)%SumMCpDTzones .GT. 0.0d0) THEN
BuildingPreDefRep%SHGSClIzaAdd = BuildingPreDefRep%SHGSClIzaAdd + ZnAirRpt(iZone)%SumMCpDTzones
ELSE
BuildingPreDefRep%SHGSClIzaRem = BuildingPreDefRep%SHGSClIzaRem + ZnAirRpt(iZone)%SumMCpDTzones
ENDIF
!Infiltration Heat Addition
!Infiltration Heat Removal
IF (ZnAirRpt(iZone)%SumMCpDtInfil .GT. 00) THEN
BuildingPreDefRep%SHGSClInfilAdd = BuildingPreDefRep%SHGSClInfilAdd + ZnAirRpt(iZone)%SumMCpDtInfil
ELSE
BuildingPreDefRep%SHGSClInfilRem = BuildingPreDefRep%SHGSClInfilRem + ZnAirRpt(iZone)%SumMCpDtInfil
ENDIF
END DO
! Opaque Surface Conduction and Other Heat Addition
! Opaque Surface Conduction and Other Heat Removal
total = BuildingPreDefRep%SHGSClPeoplAdd &
+ BuildingPreDefRep%SHGSClLiteAdd &
+ BuildingPreDefRep%SHGSClHvacHt &
+ BuildingPreDefRep%SHGSClHvacCl &
+ BuildingPreDefRep%SHGSClIzaAdd &
+ BuildingPreDefRep%SHGSClIzaRem &
+ BuildingPreDefRep%SHGSClWindAdd &
+ BuildingPreDefRep%SHGSClWindRem &
+ BuildingPreDefRep%SHGSClInfilAdd &
+ BuildingPreDefRep%SHGSClInfilRem &
+ BuildingPreDefRep%SHGSClEquipAdd &
+ BuildingPreDefRep%SHGSClEquipRem &
+ BuildingPreDefRep%SHGSClSurfHt &
+ BuildingPreDefRep%SHGSClSurfCl
total = -total !want to know the negative value of the sum since the row should add up to zero
IF (total .GT. 0) THEN
BuildingPreDefRep%SHGSClOtherAdd = BuildingPreDefRep%SHGSClOtherAdd + total
ELSE
BuildingPreDefRep%SHGSClOtherRem = BuildingPreDefRep%SHGSClOtherRem + total
ENDIF
END IF
END SUBROUTINE GatherHeatGainReport