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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | WrapperName | |||
integer, | intent(in) | :: | EquipFlowCtrl | |||
integer, | intent(inout) | :: | CompIndex | |||
integer, | intent(in) | :: | LoopNum | |||
logical, | intent(in) | :: | RunFlag | |||
logical, | intent(in) | :: | FirstIteration | |||
logical, | intent(inout) | :: | InitLoopEquip | |||
real(kind=r64), | intent(inout) | :: | MyLoad | |||
real(kind=r64), | intent(out) | :: | MaxCap | |||
real(kind=r64), | intent(out) | :: | MinCap | |||
real(kind=r64), | intent(out) | :: | OptCap | |||
logical, | intent(in) | :: | GetSizingFactor | |||
real(kind=r64), | intent(inout) | :: | SizingFactor |
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 SimCentralGroundSourceHeatPump(WrapperName,EquipFlowCtrl, CompIndex,LoopNum, RunFlag,FirstIteration, &
InitLoopEquip,MyLoad,MaxCap,MinCap,OptCap,GetSizingFactor,SizingFactor)
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, SameString, FindItemInList
USE DataIPShortCuts
USE CurveManager, ONLY: GetCurveIndex
USE CurveManager, ONLY: CurveValue
USE DataPlant, ONLY: TypeOf_CentralGroundSourceHeatPump
USE DataSizing, ONLY: CurLoopNum
USE DataGlobals, ONLY: Outputfiledebug, DayOfsim, HourOfDay, Warmupflag
USE General, ONLY: TrimSigDigits, RoundSigDigits
USE PlantUtilities, ONLY: UpdateChillerComponentCondenserSide
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: WrapperName ! User specified name of wrapper
INTEGER, INTENT(IN) :: EquipFlowCtrl ! Flow control mode for the equipment
INTEGER, INTENT(INOUT) :: CompIndex ! Chiller number pointer
INTEGER, INTENT(IN) :: LoopNum ! plant loop index pointer
LOGICAL, INTENT(IN) :: RunFlag ! Simulate chiller when TRUE
LOGICAL, INTENT(IN) :: FirstIteration ! Initialize variables when TRUE
LOGICAL, INTENT(INOUT) :: InitLoopEquip ! If not zero, calculate the max load for operating conditions
LOGICAL, INTENT(IN) :: GetSizingFactor ! TRUE when just the sizing factor is requested
REAL(r64), INTENT(INOUT) :: MyLoad ! Loop demand component will meet [W]
REAL(r64), INTENT(OUT) :: MaxCap ! Maximum operating capacity of chiller [W]
REAL(r64), INTENT(OUT) :: MinCap ! Minimum operating capacity of chiller [W]
REAL(r64), INTENT(OUT) :: OptCap ! Optimal operating capacity of chiller [W]
REAL(r64), INTENT(INOUT) :: SizingFactor ! sizing factor
LOGICAL :: SimulCoolingDominant = .FALSE. ! Simultaneous clg/htg mode - cooling dominant
LOGICAL :: SimulCoolingHeating = .FALSE. ! Simultaneous clg/htg mode - heating dominant
INTEGER :: OpMode ! Operation mode
INTEGER :: WrapperNum ! Wrapper number pointer
INTEGER :: NumChillerHeater ! Chiller heater number pointer
INTEGER :: LoopSide ! Plant loop side
INTEGER :: ChillerHeaterNum ! Chiller heater number
REAL(r64) :: SimulLoadRatio ! Cooling/heating ratio to determine a load domination
! Get user input values
IF (GetInputWrapper) THEN
CALL GetWrapperInput
GetInputWrapper = .FALSE.
END IF
! Find the correct wrapper
IF (CompIndex == 0) THEN
WrapperNum = FindItemInList(WrapperName,Wrapper%Name,NumWrappers)
IF (WrapperNum == 0) THEN
CALL ShowFatalError('SimCentralGroundSourceHeatPump: Specified Wrapper not one of Valid Wrappers='//TRIM(WrapperName))
ENDIF
CompIndex=WrapperNum
ELSE
WrapperNum=CompIndex
IF (WrapperNum > NumWrappers .or. WrapperNum < 1) THEN
CALL ShowFatalError('SimCentralGroundSourceHeatPump: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(WrapperNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumWrappers))// &
', Entered Unit name='//TRIM(WrapperName))
ENDIF
IF (CheckEquipName(WrapperNum)) THEN
IF (WrapperName /= Wrapper(WrapperNum)%Name) THEN
CALL ShowFatalError('SimCentralGroundSourceHeatPump: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(WrapperNum))// &
', Unit name='//TRIM(WrapperName)//', stored Unit Name for that index='// &
TRIM(Wrapper(WrapperNum)%Name))
ENDIF
CheckEquipName(WrapperNum)=.false.
ENDIF
ENDIF
IF (InitLoopEquip) THEN ! Initializagion loop if not done
CALL InitWrapper(WrapperNum,RunFlag,FirstIteration,MyLoad,LoopNum)
MinCap = 0.0d0
MaxCap = 0.0d0
OptCap = 0.0d0
IF (LoopNum == Wrapper(WrapperNum)%CWLoopNum) THEN ! Chilled water loop
IF (Wrapper(WrapperNum)%ControlMode == SmartMixing) THEN ! control mode is SmartMixing
DO NumChillerHeater = 1 , Wrapper(WrapperNum)%ChillerHeaterNums
MaxCap = Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%RefCapCooling * &
Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%MaxPartLoadRatCooling + MaxCap
OptCap = Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%RefCapCooling * &
Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%OptPartLoadRatCooling + OptCap
MinCap = Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%RefCapCooling * &
Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%MinPartLoadRatCooling + MinCap
END DO
END IF
ELSE IF (LoopNum == Wrapper(WrapperNum)%HWLoopNum ) THEN ! Hot water loop
IF (Wrapper(WrapperNum)%ControlMode == SmartMixing) THEN ! control mode is SmartMixing
DO NumChillerHeater = 1 , Wrapper(WrapperNum)%ChillerHeaterNums
MaxCap = Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%RefCapClgHtg * &
Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%MaxPartLoadRatClgHtg + MaxCap
OptCap = Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%RefCapClgHtg * &
Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%OptPartLoadRatClgHtg + OptCap
MinCap = Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%RefCapClgHtg * &
Wrapper(WrapperNum)%Chillerheater(NumChillerHeater)%MinPartLoadRatClgHtg + MinCap
END DO
END IF ! End of control mode determination
END IF ! End of loop determination
IF (GetSizingFactor) THEN
SizingFactor = 1.0d0 ! Always equal to one now. The conponent may have its own sizing factor
END IF
RETURN
ENDIF ! End of initialization
IF (LoopNum /= Wrapper(WrapperNum)%GLHELoopNum) THEN
CALL InitWrapper(WrapperNum,RunFlag,FirstIteration,MyLoad,LoopNum)
CALL CalcWrapperModel(WrapperNum,MyLoad,Runflag,FirstIteration,EquipFlowCtrl,LoopNum)
ELSE IF (LoopNum == Wrapper(WrapperNum)%GLHELoopNum) THEN
LoopSide = Wrapper(WrapperNum)%GLHELoopSideNum
CALL UpdateChillerComponentCondenserSide(LoopNum, LoopSide, TypeOf_CentralGroundSourceHeatPump, &
Wrapper(WrapperNum)%GLHEInletNodeNum, &
Wrapper(WrapperNum)%GLHEOutletNodeNum, &
WrapperReport(WrapperNum)%GLHERate, &
WrapperReport(WrapperNum)%GLHEInletTemp, &
WrapperReport(WrapperNum)%GLHEOutletTemp, &
WrapperReport(WrapperNum)%GLHEmdot, FirstIteration)
! Use the first chiller heater's evaporator capacity ratio to determine dominant load
SimulClgDominant = .FALSE.
SimulHtgDominant = .FALSE.
IF (Wrapper(WrapperNum)%WrapperCoolingLoad > 0 .AND. Wrapper(WrapperNum)%WrapperHeatingLoad > 0) THEN
SimulLoadRatio = Wrapper(WrapperNum)%WrapperCoolingLoad / Wrapper(WrapperNum)%WrapperHeatingLoad
IF (SimulLoadRatio > Wrapper(WrapperNum)%Chillerheater(1)%ClgHtgToCoolingCapRatio) THEN
SimulClgDominant = .TRUE.
SimulHtgDominant = .FALSE.
ELSE
SimulHtgDominant = .TRUE.
SimulClgDominant = .FALSE.
END IF
END IF
END IF
RETURN
END SUBROUTINE SimCentralGroundSourceHeatPump