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 | :: | ZoneNum |
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 DayltgElecLightingControl(ZoneNum)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Winkelmann
! DATE WRITTEN July 1997
! MODIFIED Mar 2004, FCW: add inter-reflected illuminance from interior windows to DaylIllum
! Apr 2004, FCW: move CALL ReportIllumMap from DayltgInteriorIllum2 (DayltgInteriorMapIllum)
! Apr 2010, BG NREL: remove inter-reflected illuminance to stop double counting
! Aug 2012, BG NREL: added availability schedule logic
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! For a daylit space, determines lighting power reduction factor due to
! daylighting for different lighting control systems.
! Called by InitSurfaceHeatBalance.
! METHODOLOGY EMPLOYED:
! REFERENCES:
! Based on DOE-2.1E subroutine DLTSYS.
! USE STATEMENTS:
USE ScheduleManager, ONLY : GetCurrentScheduleValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER :: ZoneNum ! Zone number
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: TotReduction ! Electric lighting power reduction factor for a zone
! due to daylighting
INTEGER :: NREFPT ! Number of daylighting reference points in a zone
REAL(r64) :: ZFTOT ! Fraction of zone's floor area that has daylighting controls
INTEGER :: IL ! Reference point index
INTEGER :: LSYSTP ! Lighting control type: 1=continuous dimming, 2=stepped,
! 3=continuous dimming then off
REAL(r64) :: ZFRAC ! Fraction of zone controlled by a reference point
REAL(r64) :: FL ! Fraction electric lighting output required to meet setpoint
REAL(r64) :: FP ! Fraction electric lighting power input required to meet setpoint
REAL(r64) :: XRAN ! Random number between 0 and 1
INTEGER :: MapNum ! Illuminance map number
INTEGER :: ILM
LOGICAL :: ScheduledAvailable
! FLOW:
TotReduction = 0.d0
! ScheduledAvailable = .TRUE.
! check if scheduled to be available
! IF (ZoneDaylight(ZoneNum)%AvailSchedNum > 0) THEN
IF (GetCurrentScheduleValue(ZoneDaylight(ZoneNum)%AvailSchedNum) > 0.d0) THEN
ScheduledAvailable = .TRUE.
ELSE
ScheduledAvailable = .FALSE.
ENDIF
! ENDIF
IF (ScheduledAvailable) THEN
! Limit the number of control reference points to 2
NREFPT = ZoneDaylight(ZoneNum)%TotalDaylRefPoints
IF (NREFPT > 2) NREFPT = 2
! Total fraction of zone that is daylit
ZFTOT = ZoneDaylight(ZoneNum)%FracZoneDaylit(1)
IF (NREFPT > 1) ZFTOT = ZFTOT + ZoneDaylight(ZoneNum)%FracZoneDaylit(2)
! Loop over reference points
DO IL = 1,NREFPT
DaylIllum(IL) = ZoneDaylight(ZoneNum)%DaylIllumAtRefPt(IL)
IF (DaylIllum(IL) >= ZoneDaylight(ZoneNum)%IllumSetPoint(IL)) THEN
FL = 0.0d0
ELSE
FL = (ZoneDaylight(ZoneNum)%IllumSetPoint(IL) - DaylIllum(IL)) / ZoneDaylight(ZoneNum)%IllumSetPoint(IL)
END IF
! BRANCH ON LIGHTING SYSTEM TYPE
LSYSTP = ZoneDaylight(ZoneNum)%LightControlType
IF (LSYSTP /= 2) THEN
! Continuously dimmable system with linear power curve
!
! Fractional output power required to meet setpoint
FP = 1.0d0
! LIGHT-CTRL-TYPE = CONTINUOUS (LSYSTP = 1)
IF (FL <= ZoneDaylight(ZoneNum)%MinLightFraction) FP = ZoneDaylight(ZoneNum)%MinPowerFraction
! LIGHT-CTRL-TYPE = CONTINUOUS/OFF (LSYSTP = 3)
IF (FL <= ZoneDaylight(ZoneNum)%MinLightFraction .AND. LSYSTP == 3) FP = 0.0d0
IF (FL > ZoneDaylight(ZoneNum)%MinLightFraction .AND. FL < 1.0d0) &
FP = (FL + (1.d0 - FL) * ZoneDaylight(ZoneNum)%MinPowerFraction - ZoneDaylight(ZoneNum)%MinLightFraction) / &
(1.d0 - ZoneDaylight(ZoneNum)%MinLightFraction)
ELSE ! LSYSTP = 2
! Stepped system
FP = 0.0d0
IF (DaylIllum(IL) > 0.0d0.AND. DaylIllum(IL) < ZoneDaylight(ZoneNum)%IllumSetPoint(IL)) &
FP = REAL(INT(ZoneDaylight(ZoneNum)%LightControlSteps*FL) + 1,r64) / REAL(ZoneDaylight(ZoneNum)%LightControlSteps,r64)
IF (DaylIllum(IL) == 0.0d0) FP = 1.0d0
IF (ZoneDaylight(ZoneNum)%LightControlProbability < 1.0d0) THEN
! Manual operation. Occupant sets lights one level too high a fraction of the time equal to
! 1. - ZoneDaylight(ZoneNum)%LightControlProbability. RANDOM_NUMBER returns a random number
! between 0 and 1.
CALL RANDOM_NUMBER(XRAN)
IF (XRAN >= ZoneDaylight(ZoneNum)%LightControlProbability) THEN
! Set level one higher
IF (FP < 1.0d0) FP = FP + (1.0d0 / REAL(ZoneDaylight(ZoneNum)%LightControlSteps,r64))
END IF ! XRAN
END IF ! Light Control Probability < 1
END IF ! Lighting System Type
ZoneDaylight(ZoneNum)%RefPtPowerReductionFactor(IL) = FP
! Accumulate net ltg power reduction factor for entire zone
ZFRAC = ZoneDaylight(ZoneNum)%FracZoneDaylit(IL)
TotReduction = TotReduction + ZoneDaylight(ZoneNum)%RefPtPowerReductionFactor(IL) * ZFRAC
END DO ! End of loop over reference points, IL
! Correct for fraction of zone (1-ZFTOT) not controlled by
! the reference points. For this fraction (which is usually zero),
! the electric lighting is unaffected and the power reduction
! factor is therefore 1.0.
TotReduction = TotReduction + (1.0d0- ZFTOT)
ELSE ! controls not currently available
TotReduction = 1.d0
ENDIF
ZoneDaylight(ZoneNum)%ZonePowerReductionFactor = TotReduction
! IF(TotIllumMaps > 0 .and. .not. DoingSizing .and. .not. WarmupFlag .and. .not. KickoffSimulation) THEN
IF(TotIllumMaps > 0 .and. .not. DoingSizing .and. .not. WarmupFlag) THEN
! If an illuminance map is associated with this zone, generate the map
IF (TimeStep == 1) mapResultsToReport=.false.
DO ILM=1,ZoneDaylight(ZoneNum)%MapCount
MapNum=ZoneDaylight(ZoneNum)%ZoneToMap(ILM)
DO IL = 1,IllumMapCalc(MapNum)%TotalMapRefPoints
IllumMapCalc(MapNum)%DaylIllumAtMapPtHr(IL) = IllumMapCalc(MapNum)%DaylIllumAtMapPtHr(IL) + &
IllumMapCalc(MapNum)%DaylIllumAtMapPt(IL)/REAL(NumOfTimeStepInHour,r64)
IF (IllumMapCalc(MapNum)%DaylIllumAtMapPtHr(IL) > 0.0d0) THEN
mapResultsToReport=.true.
mapResultsReported=.true.
ENDIF
END DO
CALL ReportIllumMap(MapNum)
IF (TimeStep == NumOfTimeStepInHour) THEN
IllumMapCalc(MapNum)%DaylIllumAtMapPtHr=0.0d0
IllumMapCalc(MapNum)%DaylIllumAtMapPt=0.0d0
ENDIF
END DO
END IF
RETURN
END SUBROUTINE DayltgElecLightingControl