Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | CBVAVNum | |||
real(kind=r64), | intent(inout) | :: | QZoneReq |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE GetZoneLoads(CBVAVNum, QZoneReq)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad
! DATE WRITTEN July 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is used to poll the thermostats in each zone and determine the
! mode of operation, either cooling, heating, or none.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEnergyDemands, ONLY: ZoneSysEnergyDemand, CurDeadBandOrSetback
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: CBVAVNum ! Index to CBVAV unit being simulated
REAL(r64), INTENT (INOUT) :: QZoneReq ! Total zone load served by this air loop
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: ZoneNum ! Zone number of controlled zone in CBVAV loop
REAL(r64) :: QZoneReqCool ! Total cooling load in all controlled zones [W]
REAL(r64) :: QZoneReqHeat ! Total heating load in all controlled zones [W]
REAL(r64) :: ZoneLoad ! Total load in controlled zone [W]
REAL(r64) :: ZoneLoadToCoolSPSequenced
REAL(r64) :: ZoneLoadToHeatSPSequenced
QZoneReqCool = 0.0d0
QZoneReqHeat = 0.0d0
CBVAV(CBVAVNum)%NumZonesCooled = 0
CBVAV(CBVAVNum)%NumZonesHeated = 0
CBVAV(CBVAVNum)%HeatCoolMode = 0
DO ZoneNum = 1, CBVAV(CBVAVNum)%NumControlledZones
IF ((CBVAV(CBVAVNum)%ZoneSequenceCoolingNum(ZoneNum) > 0) .AND. (CBVAV(CBVAVNum)%ZoneSequenceHeatingNum(ZoneNum) > 0)) THEN
ZoneLoadToCoolSPSequenced = ZoneSysEnergyDemand(CBVAV(CBVAVNum)%ControlledZoneNum(ZoneNum))%&
SequencedOutputRequiredToCoolingSP(CBVAV(CBVAVNum)%ZoneSequenceCoolingNum(ZoneNum))
ZoneLoadToHeatSPSequenced = ZoneSysEnergyDemand(CBVAV(CBVAVNum)%ControlledZoneNum(ZoneNum))%&
SequencedOutputRequiredToHeatingSP(CBVAV(CBVAVNum)%ZoneSequenceHeatingNum(ZoneNum))
IF (ZoneLoadToHeatSPSequenced > 0.d0 .AND. ZoneLoadToCoolSPSequenced > 0.d0) THEN
ZoneLoad = ZoneLoadToHeatSPSequenced
ELSEIF (ZoneLoadToHeatSPSequenced < 0.d0 .AND. ZoneLoadToCoolSPSequenced < 0.d0) THEN
ZoneLoad = ZoneLoadToCoolSPSequenced
ELSEIF (ZoneLoadToHeatSPSequenced <= 0.d0 .AND. ZoneLoadToCoolSPSequenced >= 0.d0) THEN
ZoneLoad = 0.d0
ENDIF
ELSE
ZoneLoad= ZoneSysEnergyDemand(CBVAV(CBVAVNum)%ControlledZoneNum(ZoneNum))%RemainingOutputRequired
ENDIF
IF(.NOT. CurDeadBandOrSetback(ZoneNum))THEN
IF(ZoneLoad .GT. 0.0d0 .AND. ABS(ZoneLoad) .GT. SmallLoad)THEN
QZoneReqHeat = QZoneReqHeat + ZoneLoad
CBVAV(CBVAVNum)%NumZonesHeated = CBVAV(CBVAVNum)%NumZonesHeated + 1
ELSE IF(ZoneLoad .LT. 0.0d0 .AND. ABS(ZoneLoad) .GT. SmallLoad)THEN
QZoneReqCool = QZoneReqCool + ZoneLoad
CBVAV(CBVAVNum)%NumZonesCooled = CBVAV(CBVAVNum)%NumZonesCooled + 1
END IF
END IF
END DO
SELECT CASE(CBVAV(CBVAVNum)%PriorityControl)
CASE (CoolingPriority)
IF(QZoneReqCool .LT. 0.0d0)THEN
QZoneReq = QZoneReqCool
CBVAV(CBVAVNum)%HeatCoolMode = CoolingMode
ELSE IF(QZoneReqHeat .GT. 0.0d0)THEN
QZoneReq = QZoneReqHeat
CBVAV(CBVAVNum)%HeatCoolMode = HeatingMode
ELSE
QZoneReq = 0.0d0
END IF
CASE (HeatingPriority)
IF(QZoneReqHeat .GT. 0.0d0)THEN
QZoneReq = QZoneReqHeat
CBVAV(CBVAVNum)%HeatCoolMode = HeatingMode
ELSE IF(QZoneReqCool .LT. 0.0d0)THEN
QZoneReq = QZoneReqCool
CBVAV(CBVAVNum)%HeatCoolMode = CoolingMode
ELSE
QZoneReq = 0.0d0
END IF
CASE (ZonePriority)
IF(CBVAV(CBVAVNum)%NumZonesHeated .GT. CBVAV(CBVAVNum)%NumZonesCooled)THEN
IF(QZoneReqHeat .GT. 0.0d0)THEN
QZoneReq = QZoneReqHeat
CBVAV(CBVAVNum)%HeatCoolMode = HeatingMode
ELSE IF(QZoneReqCool .LT. 0.0d0)THEN
QZoneReq = QZoneReqCool
CBVAV(CBVAVNum)%HeatCoolMode = CoolingMode
ELSE
QZoneReq = 0.0d0
END IF
ELSE IF(CBVAV(CBVAVNum)%NumZonesCooled .GT. CBVAV(CBVAVNum)%NumZonesHeated)THEN
IF(QZoneReqCool .LT. 0.0d0)THEN
QZoneReq = QZoneReqCool
CBVAV(CBVAVNum)%HeatCoolMode = CoolingMode
ELSE IF(QZoneReqHeat .GT. 0.0d0)THEN
QZoneReq = QZoneReqHeat
CBVAV(CBVAVNum)%HeatCoolMode = HeatingMode
ELSE
QZoneReq = 0.0d0
END IF
ELSE
IF(ABS(QZoneReqCool) .GT. ABS(QZoneReqHeat) .AND. QZoneReqCool .NE. 0.0d0)THEN
QZoneReq = QZoneReqCool
CBVAV(CBVAVNum)%HeatCoolMode = CoolingMode
ELSE IF(ABS(QZoneReqCool) .LT. ABS(QZoneReqHeat) .AND. QZoneReqHeat .NE. 0.0d0)THEN
QZoneReq = QZoneReqHeat
CBVAV(CBVAVNum)%HeatCoolMode = HeatingMode
ELSE IF(ABS(QZoneReqCool) .EQ. ABS(QZoneReqHeat) .AND. QZoneReqCool .NE. 0.0d0)THEN
QZoneReq = QZoneReqCool
CBVAV(CBVAVNum)%HeatCoolMode = CoolingMode
ELSE
QZoneReq = 0.0d0
END IF
END IF
END SELECT
RETURN
END SUBROUTINE GetZoneLoads