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) | :: | UnitarySysNum | |||
logical, | intent(in) | :: | FirstHVACIteration |
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 ControlHeatingSystem(UnitarySysNum, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN February 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulate the coil object at the required PLR.
! METHODOLOGY EMPLOYED:
! Calculate operating PLR and adjust speed when using multispeed coils.
! REFERENCES:
! na
! USE STATEMENTS:
USE Psychrometrics , ONLY: PsyHFnTdbW, PsyTdpFnWPb
USE General, ONLY: SolveRegulaFalsi, RoundSigDigits
USE DXCoils, ONLY: SimDXCoil, SimDXCoilMultiSpeed, DXCoilOutletTemp, DXCoilOutletHumRat
USE HeatingCoils, ONLY: SimulateHeatingCoilComponents
USE DataAirLoop, ONLY: LoopHeatingCoilMaxRTF, LoopDXCoilRTF
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE SteamCoils, ONLY: SimulateSteamCoilComponents
USE PlantUtilities, ONLY: SetComponentFlowRate
USE WatertoAirHeatPumpSimple, ONLY: SimWatertoAirHPSimple
USE WatertoAirHeatPump, ONLY: SimWaterToAirHP
USE VariableSpeedCoils, ONLY: SimVariableSpeedCoils, VarSpeedCoil
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(In) :: UnitarySysNum ! index to Unitary System
LOGICAL, INTENT(In) :: FirstHVACIteration ! First HVAC iteration flag
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIte = 500 ! Maximum number of iterations for solver
REAL(r64), PARAMETER :: Acc = 1.0d-3 ! Accuracy of solver result
REAL(r64), PARAMETER :: HumRatAcc = 1.0d-6 ! Accuracy of solver result
LOGICAL, PARAMETER :: SuppHeatingCoilFlag = .FALSE.
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength) :: CompName ! Name of the heating coil
INTEGER :: CompIndex ! Index to the heating coil
! REAL(r64) :: NoOutput ! Sensible capacity (outlet - inlet) when the compressor is off
REAL(r64) :: FullOutput ! Sensible capacity (outlet - inlet) when the compressor is on
REAL(r64) :: ReqOutput ! Sensible capacity (outlet - inlet) required to meet load or set point temperature
Integer :: InletNode ! Inlet node number of the DX cooling coil
Integer :: OutletNode ! Outlet node number of the DX cooling coil
Integer :: ControlNode ! The node number where a set point is placed to control the DX cooling coil
REAL(r64) :: PartLoadFrac ! The part-load fraction of the compressor
REAL(r64) :: SpeedRatio ! SpeedRatio = (CompressorSpeed - CompressorSpeedMin) /
! (CompressorSpeedMax - CompressorSpeedMin)
! for variable speed or 2 speed compressors
INTEGER :: SpeedNum
REAL(r64) :: CycRatio ! Cycling part-load ratio for variable speed or 2 speed compressors
REAL(r64) :: DesOutTemp ! Desired outlet temperature of the DX cooling coil
INTEGER :: SolFla ! Flag of solver, num iterations if >0, else error index
REAL(r64), DIMENSION(8) :: Par ! Parameter array passed to solver
LOGICAL :: SensibleLoad ! True if there is a sensible cooling load on this system
LOGICAL :: LatentLoad ! True if there is a latent cooling load on this system
INTEGER :: FanOpMode ! Supply air fan operating mode
REAL(R64) :: LoopHeatingCoilMaxRTFSave ! Used to find RTF of heating coils without overwriting globabl variable
REAL(R64) :: LoopDXCoilMaxRTFSave ! Used to find RTF of DX heating coils without overwriting globabl variable
REAL(r64) :: dummy ! dummy variable for heating latent demand
REAL(r64) :: WSHPRuntimeFrac ! Run time fraction of water to air hp
REAL(R64) :: OutdoorDryBulb ! local variable for OutDryBulbTemp
REAL(R64) :: OutdoorHumRat ! local variable for OutHumRat
REAL(R64) :: OutdoorPressure ! local variable for OutBaroPress
REAL(R64) :: OutdoorWetBulb ! local variable for OutWetBulbTemp
REAL(R64) :: OutletTemp
! Set local variables
! Retrieve the load on the controlled zone
InletNode = UnitarySystem(UnitarySysNum)%HeatCoilInletNodeNum
OutletNode = UnitarySystem(UnitarySysNum)%HeatCoilOutletNodeNum
ControlNode = UnitarySystem(UnitarySysNum)%SystemHeatControlNodeNum
DesOutTemp = UnitarySystem(UnitarySysNum)%DesiredOutletTemp
LoopHeatingCoilMaxRTFSave=LoopHeatingCoilMaxRTF
LoopHeatingCoilMaxRTF = 0.0d0
LoopDXCoilMaxRTFSave=LoopDXCoilRTF
LoopDXCoilRTF=0.0d0
CompName = UnitarySystem(UnitarySysNum)%HeatingCoilName
CompIndex = UnitarySystem(UnitarySysNum)%HeatingCoilIndex
FanOpMode = UnitarySystem(UnitarySysNum)%FanOpMode
PartLoadFrac = 0.0d0
SpeedRatio = 0.0d0
CycRatio = 0.0d0
Dummy = 0.0d0
SolFla = 0.0d0
SensibleLoad = .FALSE.
LatentLoad = .FALSE.
IF (UnitarySystem(UnitarySysNum)%CondenserNodeNum /= 0) THEN
OutdoorDryBulb = Node(UnitarySystem(UnitarySysNum)%CondenserNodeNum)%Temp
IF(UnitarySystem(UnitarySysNum)%CondenserType == WaterCooled)THEN
OutdoorHumRat = OutHumRat
OutdoorPressure = OutBaroPress
OutdoorWetBulb = OutWetBulbTemp
ELSE
OutdoorPressure = Node(UnitarySystem(UnitarySysNum)%CondenserNodeNum)%Press
! IF node is not connected to anything, pressure = default, use weather data
IF(OutdoorPressure == DefaultNodeValues%Press)THEN
OutdoorDryBulb = OutDryBulbTemp
OutdoorHumRat = OutHumRat
OutdoorPressure = OutBaroPress
OutdoorWetBulb = OutWetBulbTemp
ELSE
OutdoorHumRat = Node(UnitarySystem(UnitarySysNum)%CondenserNodeNum)%HumRat
! this should use Node%WetBulbTemp or a PSYC function, not OAWB
OutdoorWetBulb = Node(UnitarySystem(UnitarySysNum)%CondenserNodeNum)%OutAirWetBulb
END IF
END IF
ELSE
OutdoorDryBulb = OutDryBulbTemp
OutdoorHumRat = OutHumRat
OutdoorPressure = OutBaroPress
OutdoorWetBulb = OutWetBulbTemp
END IF
! IF DXHeatingSystem is scheduled on and there is flow
IF(GetCurrentScheduleValue(UnitarySystem(UnitarySysNum)%SysAvailSchedPtr) > 0.0d0 .AND. &
GetCurrentScheduleValue(UnitarySystem(UnitarySysNum)%HeatingCoilAvailSchPtr) > 0.0d0 .AND. &
Node(InletNode)%MassFlowRate .gt. MinAirMassFlow .AND. UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac == 0.0d0) THEN
! Determine if there is a sensible load on this system
! IF((Node(InletNode)%Temp < Node(ControlNode)%TempSetPoint) .AND. &
IF((Node(InletNode)%Temp < DesOutTemp) .AND. &
(ABS(Node(InletNode)%Temp - DesOutTemp) .gt. TempControlTol) ) SensibleLoad = .TRUE.
! IF DXHeatingSystem runs with a heating load then set PartLoadFrac on Heating System
IF (SensibleLoad ) THEN
ReqOutput = Node(InletNode)%MassFlowRate * &
(PsyHFnTdbW(UnitarySystem(UnitarySysNum)%DesiredOutletTemp,Node(InletNode)%HumRat) - &
PsyHFnTdbW(Node(InletNode)%Temp,Node(InletNode)%HumRat))
! Get no load result
PartLoadFrac = 0.0d0
WSHPRuntimeFrac = 0.0d0
SELECT CASE(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)
CASE (CoilDX_HeatingEmpirical) ! Coil:Heating:DX:SingleSpeed
CALL SimDXCoil(CompName,On,FirstHVACIteration,PartLoadFrac,UnitarySystem(UnitarySysNum)%HeatingCoilIndex,FanOpMode)
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = PartLoadFrac
CASE (CoilDX_MultiSpeedHeating, Coil_HeatingAirToAirVariableSpeed, Coil_HeatingWaterToAirHPVSEquationFit, &
Coil_HeatingElectric_MultiStage, Coil_HeatingGas_MultiStage)
CALL SimMultiSpeedCoils(UnitarySysNum, FirstHVACIteration, SensibleLoad, LatentLoad, PartLoadFrac, &
HeatingCoil)
CASE (Coil_HeatingGas,Coil_HeatingElectric,Coil_HeatingDesuperheater )
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=CompIndex, &
FanOpMode=FanOpMode, QCoilReq = 0.0d0)
CASE (Coil_HeatingWater)
CALL SimWaterCoils(UnitarySysNum, FirstHVACIteration, PartLoadFrac, HeatingCoil)
CASE (Coil_HeatingSteam)
CALL SimSteamCoils(UnitarySysNum, FirstHVACIteration, PartLoadFrac, HeatingCoil)
IF(UnitarySystem(UnitarySysNum)%MaxHeatCoilFluidFlow .GT. 0.0d0)PartLoadFrac = &
MIN(1.0d0,Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidOutletNodeNum)%MassFlowRate/ &
UnitarySystem(UnitarySysNum)%MaxHeatCoilFluidFlow)
CASE(Coil_HeatingWaterToAirHPSimple)
CALL SimWatertoAirHPSimple(Blank, UnitarySystem(UnitarySysNum)%HeatingCoilIndex, ReqOutput, Dummy, &
FanOpMode,WSHPRuntimeFrac, UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, UnitarySystem(UnitarySysNum)%FanDelayTime, &
0, PartLoadFrac, FirstHVACIteration)
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = PartLoadFrac
CASE(Coil_HeatingWaterToAirHP)
CALL SimWatertoAirHP(Blank, UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%MaxHeatAirMassFlow,FanOpMode, &
FirstHVACIteration,WSHPRuntimeFrac,UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, UnitarySystem(UnitarySysNum)%FanDelayTime, &
UnitarySystem(UnitarySysNum)%InitHeatPump, ReqOutput,Dummy,0, PartLoadFrac)
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = PartLoadFrac
CASE DEFAULT
END SELECT
! IF outlet temp at no load is within ACC of set point, do not run the coil
IF(ABS(Node(OutletNode)%Temp-DesOutTemp) < Acc)THEN
! do nothing, coil is at the set point.
ELSE IF ((Node(OutletNode)%Temp-DesOutTemp) > Acc) THEN ! IF outlet temp is above set point turn off coil
PartLoadFrac = 0.0d0
ELSE ! ELSE get full load result
! Get full load result
PartLoadFrac = 1.0d0
WSHPRuntimeFrac = 1.0d0
SELECT CASE(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)
CASE (CoilDX_HeatingEmpirical) ! Coil:Heating:DX:SingleSpeed
CALL SimDXCoil(CompName,On,FirstHVACIteration,PartLoadFrac,UnitarySystem(UnitarySysNum)%HeatingCoilIndex,FanOpMode)
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = PartLoadFrac
CASE (CoilDX_MultiSpeedHeating, Coil_HeatingAirToAirVariableSpeed, Coil_HeatingWaterToAirHPVSEquationFit, &
Coil_HeatingElectric_MultiStage, Coil_HeatingGas_MultiStage)
CycRatio = 1.0d0
DO SpeedNum = 1, UnitarySystem(UnitarySysNum)%NumOfSpeedHeating
CALL SimMultiSpeedCoils(UnitarySysNum, FirstHVACIteration, SensibleLoad, LatentLoad, PartLoadFrac, &
HeatingCoil, SpeedNum)
OutletTemp = Node(OutletNode)%Temp
SpeedRatio = REAL(SpeedNum,r64) - 1.0d0
IF (OutletTemp > DesOutTemp .AND. SensibleLoad) EXIT
END DO
CASE (Coil_HeatingGas,Coil_HeatingElectric)
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=CompIndex, &
FanOpMode=FanOpMode, QCoilReq = UnitarySystem(UnitarySysNum)%DesignHeatingCapacity)
CASE (Coil_HeatingDesuperheater )
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=CompIndex, &
FanOpMode=FanOpMode, QCoilReq = ReqOutput)
CASE (Coil_HeatingWater)
CALL SimWaterCoils(UnitarySysNum, FirstHVACIteration, PartLoadFrac, HeatingCoil)
CASE (Coil_HeatingSteam)
CALL SimSteamCoils(UnitarySysNum, FirstHVACIteration, PartLoadFrac, HeatingCoil)
IF(UnitarySystem(UnitarySysNum)%MaxHeatCoilFluidFlow .GT. 0.0d0)PartLoadFrac = &
MIN(1.0d0,Node(UnitarySystem(UnitarySysNum)%HeatCoilFluidOutletNodeNum)%MassFlowRate/ &
UnitarySystem(UnitarySysNum)%MaxHeatCoilFluidFlow)
CASE(Coil_HeatingWaterToAirHPSimple)
CALL SimWatertoAirHPSimple(Blank, UnitarySystem(UnitarySysNum)%HeatingCoilIndex, ReqOutput, Dummy, &
FanOpMode,WSHPRuntimeFrac, UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, UnitarySystem(UnitarySysNum)%FanDelayTime, &
0, PartLoadFrac, FirstHVACIteration)
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = PartLoadFrac
CASE(Coil_HeatingWaterToAirHP)
CALL SimWatertoAirHP(Blank, UnitarySystem(UnitarySysNum)%HeatingCoilIndex, &
UnitarySystem(UnitarySysNum)%MaxHeatAirMassFlow,FanOpMode, &
FirstHVACIteration,WSHPRuntimeFrac,UnitarySystem(UnitarySysNum)%MaxONOFFCyclesperHour, &
UnitarySystem(UnitarySysNum)%HPTimeConstant, UnitarySystem(UnitarySysNum)%FanDelayTime, &
UnitarySystem(UnitarySysNum)%InitHeatPump, ReqOutput,Dummy,0, PartLoadFrac)
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = PartLoadFrac
CASE DEFAULT
END SELECT
FullOutput = Node(InletNode)%MassFlowRate * &
(PsyHFnTdbW(Node(OutletNode)%Temp,Node(InletNode)%HumRat) &
- PsyHFnTdbW(Node(InletNode)%Temp,Node(InletNode)%HumRat))
! If the outlet temp is within ACC of set point,
IF(ABS(Node(OutletNode)%Temp-DesOutTemp) < Acc)THEN
! do nothing, coil is at set point
ELSE IF (Node(OutletNode)%Temp .LT. (DesOutTemp-Acc)) THEN ! IF outlet temp is below set point coil must be on
PartLoadFrac = 1.0d0
ELSE ! ELSE find the PLR to meet the set point
SELECT CASE(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)
CASE (CoilDX_HeatingEmpirical) ! Coil:Heating:DX:SingleSpeed
Par(1) = REAL(UnitarySystem(UnitarySysNum)%HeatingCoilIndex,r64)
Par(2) = DesOutTemp
Par(3) = 1.0d0 !OnOffAirFlowFrac assume = 1.0 for continuous fan dx system
Par(5) = REAL(FanOpMode,r64) ! this does nothing since set point based control requires constant fan
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, PartLoadFrac, DXHeatingCoilResidual, 0.0d0, &
1.0d0, Par)
UnitarySystem(UnitarySysNum)%CompPartLoadRatio = PartLoadFrac
CASE (CoilDX_MultiSpeedHeating, Coil_HeatingAirToAirVariableSpeed, Coil_HeatingWaterToAirHPVSEquationFit, &
Coil_HeatingElectric_MultiStage, Coil_HeatingGas_MultiStage)
Par(1) = REAL(UnitarySystem(UnitarySysNum)%HeatingCoilIndex,r64)
Par(2) = DesOutTemp
Par(3) = UnitarySysNum
! Par(4) = CycRatio or SpeedRatio
Par(5) = UnitarySystem(UnitarySysNum)%HeatingSpeedNum
Par(6) = 1.0d0 ! UnitarySystem(UnitarySysNum)%FanOpMode
Par(7) = 1.0d0 ! UnitarySystem(UnitarySysNum)%CompOp
Par(8) = ReqOutput ! UnitarySystem(UnitarySysNum)%FanOpMode
IF (SpeedRatio == 1.0d0) THEN
Par(4) = CycRatio
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, SpeedRatio, HeatingCoilVarSpeedResidual, 0.0d0, &
1.0d0, Par)
UnitarySystem(UnitarySysNum)%HeatingCycRatio = CycRatio
UnitarySystem(UnitarySysNum)%HeatingSpeedRatio = SpeedRatio
UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac = SpeedRatio
CALL CalcPassiveSystem(UnitarySysNum, FirstHVACIteration)
PartLoadFrac = SpeedRatio
ELSE
SpeedRatio = 0.0d0
UnitarySystem(UnitarySysNum)%HeatingSpeedRatio = SpeedRatio
Par(4) = SpeedRatio
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, CycRatio, HeatingCoilVarSpeedCycResidual, 0.0d0, &
1.0d0, Par)
UnitarySystem(UnitarySysNum)%HeatingCycRatio = CycRatio
UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac = CycRatio
CALL CalcPassiveSystem(UnitarySysNum, FirstHVACIteration)
PartLoadFrac = CycRatio
END IF
CASE (Coil_HeatingGas,Coil_HeatingElectric, Coil_HeatingDesuperheater)
Par(1) = REAL(UnitarySysNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.0d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = DesOutTemp
IF (SuppHeatingCoilFlag) THEN
Par(4) = 1.0d0
ELSE
Par(4) = 0.0d0
END IF
Par(5) = FanOpMode
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, PartLoadFrac, GasElecHeatingCoilResidual, 0.0d0, &
1.0d0, Par)
CASE (Coil_HeatingWater)
Par(1) = REAL(UnitarySysNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.0d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = DesOutTemp
IF (SuppHeatingCoilFlag) THEN
Par(4) = 1.0d0
ELSE
Par(4) = 0.0d0
END IF
Par(5) = 0.0d0
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, PartLoadFrac, HotWaterHeatingCoilResidual, 0.0d0, &
1.0d0, Par)
CASE (Coil_HeatingSteam)
Par(1) = REAL(UnitarySysNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.0d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = DesOutTemp
IF (SuppHeatingCoilFlag) THEN
Par(4) = 1.0d0
ELSE
Par(4) = 0.0d0
END IF
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, PartLoadFrac, SteamHeatingCoilResidual, 0.0d0, &
1.0d0, Par)
CASE(Coil_HeatingWaterToAirHPSimple, Coil_HeatingWaterToAirHP)
Par(1) = REAL(UnitarySysNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.0d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = DesOutTemp
Par(4) = ReqOutput
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, PartLoadFrac, HeatWatertoAirHPTempResidual, 0.0d0, &
1.0d0, Par)
CASE DEFAULT
CALL ShowMessage(' For :'//TRIM(UnitarySystem(UnitarySysNum)%UnitarySystemType)//'="'// &
TRIM(UnitarySystem(UnitarySysNum)%Name)//'"')
CALL ShowFatalError('ControlHeatingSystem: Invalid heating coil type = '// &
TRIM(CALLCoilTypes(UnitarySystem(UnitarySysNum)%HeatingCoilType_Num)))
END SELECT
END IF
END IF
END IF
END IF
IF(PartLoadFrac .GT. 1.0d0) THEN
PartLoadFrac = 1.0d0
ELSEIF(PartLoadFrac < 0.0d0) THEN
PartLoadFrac = 0.0d0
END IF
IF (SolFla == -1) THEN
IF(.NOT. WarmupFlag)THEN
IF(UnitarySystem(UnitarySysNum)%HeatCoilSensPLRIter .LT. 1)THEN
UnitarySystem(UnitarySysNum)%HeatCoilSensPLRIter = UnitarySystem(UnitarySysNum)%HeatCoilSensPLRIter+1
CALL ShowWarningError(TRIM(UnitarySystem(UnitarySysNum)%UnitarySystemType)// &
' - Iteration limit exceeded calculating sensible '// &
'part-load ratio for unit = '//TRIM(UnitarySystem(UnitarySysNum)%Name))
CALL ShowContinueError('Estimated part-load ratio = '//RoundSigDigits((ReqOutput/FullOutput),3))
CALL ShowContinueError('Calculated part-load ratio = '//RoundSigDigits(PartLoadFrac,3))
CALL ShowContinueErrorTimeStamp('The calculated part-load ratio will be used and the simulation'// &
' continues. Occurrence info: ')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(UnitarySystem(UnitarySysNum)%UnitarySystemType)//' "'&
//TRIM(UnitarySystem(UnitarySysNum)%Name)//'" - Iteration limit exceeded calculating'// &
' sensible part-load ratio error continues. Sensible PLR statistics follow.' &
,UnitarySystem(UnitarySysNum)%HeatCoilSensPLRIterIndex,PartLoadFrac,PartLoadFrac)
END IF
END IF
ELSEIF (SolFla == -2) THEN
PartLoadFrac = ReqOutput/FullOutput
IF(.NOT. WarmupFlag)THEN
IF(UnitarySystem(UnitarySysNum)%HeatCoilSensPLRFail .LT. 1)THEN
UnitarySystem(UnitarySysNum)%HeatCoilSensPLRFail = UnitarySystem(UnitarySysNum)%HeatCoilSensPLRFail+1
CALL ShowWarningError(TRIM(UnitarySystem(UnitarySysNum)%UnitarySystemType)//' - sensible part-'// &
'load ratio calculation failed: part-load ratio limits exceeded, for unit = '// &
TRIM(UnitarySystem(UnitarySysNum)%Name))
CALL ShowContinueError('Estimated part-load ratio = '//RoundSigDigits(PartLoadFrac,3))
CALL ShowContinueErrorTimeStamp('The estimated part-load ratio will be used and the simulation'// &
' continues. Occurrence info: ')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(UnitarySystem(UnitarySysNum)%UnitarySystemType)//' "'&
//TRIM(UnitarySystem(UnitarySysNum)%Name)//'" - sensible part-load ratio calculation'// &
' failed error continues. Sensible PLR statistics follow.' &
,UnitarySystem(UnitarySysNum)%HeatCoilSensPLRFailIndex,PartLoadFrac,PartLoadFrac)
END IF
END IF
END IF
!Set the final results
UnitarySystem(UnitarySysNum)%HeatingPartLoadFrac = PartLoadFrac
UnitarySystem(UnitarySysNum)%HeatingSpeedRatio = SpeedRatio
UnitarySystem(UnitarySysNum)%HeatingCycRatio = CycRatio
LoopHeatingCoilMaxRTF = MAX(LoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave)
LoopDXCoilRTF = MAX(LoopDXCoilRTF, LoopDXCoilMaxRTFSave)
RETURN
END SUBROUTINE ControlHeatingSystem