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) | :: | PeopleNum | |||
integer, | intent(in) | :: | ComfortControlNum | |||
real(kind=r64), | intent(in) | :: | PMVSet | |||
real(kind=r64), | intent(out) | :: | TSet |
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 GetComfortSetpoints(PeopleNum, ComfortControlNum, PMVSet, Tset)
! SUBROUTINE INFORMATION:
! AUTHOR Lixing Gu
! DATE WRITTEN May, 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine sets what the thermal comfort setpoints for each controlled zone should be based on air tempeature
! obtained from thermal comfort models.
! This is called each time step.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: SolveRegulaFalsi
USE ThermalComfort, ONLY: CalcThermalComfortFanger
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: PeopleNum !
INTEGER, INTENT(IN) :: ComfortControlNum !
REAL(r64), INTENT(IN) :: PMVSet !
REAL(r64), INTENT(OUT) :: TSet ! drybulb setpoint temperature for a given PMV value
! 0 = Solution; 1 = Set to Min; 2 Set to Max
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64),PARAMETER :: Acc = 0.001D0 ! accuracy control for SolveRegulaFalsi
INTEGER,PARAMETER :: MaxIter = 500 !iteration control for SolveRegulaFalsi
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: Tmin ! Minimun drybulb setpoint temperature
REAL(r64) :: Tmax ! Maximun drybulb setpoint temperature
REAL(r64) :: PMVResult ! Calculated PMV value
REAL(r64) :: PMVMin ! Minimum allowed PMV value
REAL(r64) :: PMVMax ! Calculated PMV value
REAL(r64) :: Par(2) ! Passed parameter for RegularFalsi function
INTEGER :: SolFla !feed back flag from SolveRegulaFalsi
INTEGER, SAVE :: IterLimitExceededNum1 = 0
INTEGER, SAVE :: IterLimitErrIndex1 = 0
INTEGER, SAVE :: IterLimitExceededNum2 = 0
INTEGER, SAVE :: IterLimitErrIndex2 = 0
Tmin = ComfortControlledZone(ComfortControlNum)%TdbMinSetPoint
Tmax = ComfortControlledZone(ComfortControlNum)%TdbMaxSetPoint
CALL CalcThermalComfortFanger(PeopleNum,Tmin,PMVResult)
PMVmin = PMVResult
CALL CalcThermalComfortFanger(PeopleNum,Tmax,PMVResult)
PMVmax = PMVResult
If (PMVset > PMVmin .AND. PMVset < PMVmax) then
Par(1)=PMVset
Par(2)=REAL(PeopleNum,r64)
CALL SolveRegulaFalsi(Acc, MaxIter, SolFla, Tset, PMVResidual, Tmin, Tmax, Par)
IF (SolFla == -1) THEN
IF(.NOT. WarmupFlag)THEN
IterLimitExceededNum1 = IterLimitExceededNum1 + 1
IF (IterLimitExceededNum1 .EQ. 1) THEN
CALL ShowWarningError(TRIM(ComfortControlledZone(ComfortControlNum)%Name) // &
': Iteration limit exceeded calculating thermal comfort Fanger setpoint and non-converged setpoint is used')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(ComfortControlledZone(ComfortControlNum)%Name)// &
': Iteration limit exceeded calculating thermal comfort setpoint.', &
IterLimitErrIndex1, Tset, Tset)
END IF
END IF
ELSE IF (SolFla == -2) THEN
IF(.NOT. WarmupFlag)THEN
IterLimitExceededNum2 = IterLimitExceededNum2 + 1
IF (IterLimitExceededNum2 .EQ. 1) THEN
CALL ShowWarningError(TRIM(ComfortControlledZone(ComfortControlNum)%Name) // &
': Solution is not found in calculating thermal comfort Fanger setpoint and the minimum setpoint is used')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(ComfortControlledZone(ComfortControlNum)%Name)// &
': Solution is not found in calculating thermal comfort Fanger setpoint.', &
IterLimitErrIndex2, Tset, Tset)
END IF
END IF
END IF
else if (PMVset < PMVmin) then
Tset = Tmin
else if (PMVset > PMVmax) then
Tset = Tmax
End If
RETURN
END SUBROUTINE GetComfortSetpoints