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) | :: | IndexTypeKey |
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 GatherPeakDemandForTimestep(IndexTypeKey)
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer
! DATE WRITTEN January 2009
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine gathers data for producing the Peak Demand
! by end-use report
! METHODOLOGY EMPLOYED:
! Uses get input structure similar to other objects
! Meter names are of two forms:
!
! <ResourceType>:<name>
! or
!
! <EndUseType>:<ResourceType>
!
! For the purposes of this routine, only the facility <name>
! is used. Remember that 'Building' is actually the sum of
! the zones only without system,plant and exterior. The only
! way to get them all is to use 'facility'
!
! The <EndUseType> are:
! Heating
! Cooling
! InteriorLights
! ExteriorLights
! InteriorEquipment
! ExteriorEquipment
! Fans
! Pumps
! HeatRejection
! Humidifier
! HeatRecovery
! DHW
! Refrigeration
! Cogeneration
!
! The <ResourceType> are:
! Electricity
! Gas
! Gasoline
! Diesel
! Coal
! FuelOil#1
! FuelOil#2
! Propane
! Water
! Steam
! DistrictCooling
! DistrictHeating
! REFERENCES:
! na
! USE STATEMENTS:
USE OutputProcessor, ONLY: EndUseCategory
USE DataStringGlobals, ONLY: CharComma, CharTab, CharSpace
USE DataEnvironment, ONLY: Month, DayOfMonth
USE General, ONLY: EncodeMonDayHrMin,DetermineMinuteForReporting
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: IndexTypeKey ! What kind of data to update (Zone, HVAC)
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: iResource
INTEGER :: jEndUse
INTEGER :: kEndUseSub
REAL(r64) :: curDemandValue
INTEGER :: curMeterNumber
INTEGER :: minuteCalculated
INTEGER :: timestepTimeStamp
REAL(r64), external :: GetCurrentMeterValue
IF ((displayDemandEndUse) .AND. (IndexTypeKey .EQ. stepTypeZone)) THEN
! loop through all of the resources and end uses for the entire facility
DO iResource = 1, numResourceTypes
curMeterNumber = meterNumTotalsBEPS(iResource)
IF (curMeterNumber .GT. 0) THEN
curDemandValue = GetCurrentMeterValue(curMeterNumber) / (TimeStepZone * SecInHour)
! check if current value is greater than existing peak demand value
IF (curDemandValue .GT. gatherDemandTotal(iResource)) THEN
gatherDemandTotal(iResource) = curDemandValue
! save the time that the peak demand occured
! minuteCalculated = (CurrentTime - INT(CurrentTime))*60
minuteCalculated = DetermineMinuteForReporting(IndexTypeKey)
CALL EncodeMonDayHrMin(timestepTimeStamp,Month,DayOfMonth,HourOfDay,minuteCalculated)
gatherDemandTimeStamp(iResource)= timestepTimeStamp
! if new peak demand is set, then gather all of the end use values at this particular
! time to find the components of the peak demand
DO jEndUse = 1, numEndUses
curMeterNumber = meterNumEndUseBEPS(jEndUse, iResource)
IF (curMeterNumber .GT. 0) THEN
curDemandValue = GetCurrentMeterValue(curMeterNumber) / (TimeStepZone * SecInHour)
gatherDemandEndUse(jEndUse, iResource) = curDemandValue
DO kEndUseSub = 1, EndUseCategory(jEndUse)%NumSubcategories
curMeterNumber = meterNumEndUseSubBEPS(iResource,jEndUse,kEndUseSub)
IF (curMeterNumber .GT. 0) THEN
curDemandValue = GetCurrentMeterValue(curMeterNumber) / (TimeStepZone * SecInHour)
gatherDemandEndUseSub(iResource,jEndUse,kEndUseSub) = curDemandValue
END IF
END DO
END IF
END DO
END IF
END IF
END DO
END IF
END SUBROUTINE GatherPeakDemandForTimestep