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) | :: | ListNum |
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 ReportDemandManagerList(ListNum)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN July 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculates report variables.
! METHODOLOGY EMPLOYED:
! Standard EnergyPlus methodology.
! USE STATEMENTS:
USE DataGlobals, ONLY: MinutesPerTimeStep
USE DataEnvironment, ONLY: Month
USE ScheduleManager, ONLY: GetCurrentScheduleValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ListNum
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: BillingPeriod
INTEGER :: Item
INTEGER :: AveragingWindow
LOGICAL :: OnPeak
REAL(r64) :: OverLimit
! FLOW:
IF (DemandManagerList(ListNum)%BillingSchedule .EQ. 0) THEN
BillingPeriod = Month
ELSE
BillingPeriod = GetCurrentScheduleValue(DemandManagerList(ListNum)%BillingSchedule)
END IF
IF (DemandManagerList(ListNum)%BillingPeriod .NE. BillingPeriod) THEN
! Reset variables for new billing period
!DemandManagerList(ListNum)%History = 0.0 ! Don't reset--continue from previous billing period
!DemandManagerList(ListNum)%AverageDemand = 0.0 ! Don't reset--continue from previous billing period
DemandManagerList(ListNum)%PeakDemand = 0.0d0
DemandManagerList(ListNum)%OverLimitDuration = 0.0d0
DemandManagerList(ListNum)%BillingPeriod = BillingPeriod
END IF
! Add new timestep to demand history and subtract oldest timestep
AveragingWindow = DemandManagerList(ListNum)%AveragingWindow
DemandManagerList(ListNum)%AverageDemand = DemandManagerList(ListNum)%AverageDemand &
+ (DemandManagerList(ListNum)%MeterDemand - DemandManagerList(ListNum)%History(1)) / AveragingWindow
! Update demand history
DO Item = 1, AveragingWindow - 1
DemandManagerList(ListNum)%History(Item) = DemandManagerList(ListNum)%History(Item + 1)
END DO
DemandManagerList(ListNum)%History(AveragingWindow) = DemandManagerList(ListNum)%MeterDemand
IF (DemandManagerList(ListNum)%PeakSchedule .EQ. 0) THEN
OnPeak = .TRUE.
ELSE
IF (GetCurrentScheduleValue(DemandManagerList(ListNum)%PeakSchedule) .EQ. 1) THEN
OnPeak = .TRUE.
ELSE
OnPeak = .FALSE.
END IF
END IF
IF (OnPeak) THEN
DemandManagerList(ListNum)%PeakDemand = &
MAX(DemandManagerList(ListNum)%AverageDemand,DemandManagerList(ListNum)%PeakDemand)
OverLimit = DemandManagerList(ListNum)%AverageDemand - DemandManagerList(ListNum)%ScheduledLimit
IF (OverLimit > 0.0d0) THEN
DemandManagerList(ListNum)%OverLimit = OverLimit
DemandManagerList(ListNum)%OverLimitDuration = DemandManagerList(ListNum)%OverLimitDuration + (MinutesPerTimeStep / 60.0d0)
ELSE
DemandManagerList(ListNum)%OverLimit = 0.0d0
END IF
ELSE
DemandManagerList(ListNum)%OverLimit = 0.0d0
END IF
RETURN
END SUBROUTINE ReportDemandManagerList