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) | :: | AbsorberType | |||
character(len=*), | intent(in) | :: | AbsorberName | |||
integer, | intent(in) | :: | EquipFlowCtrl | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(in) | :: | RunFlag | |||
logical, | intent(in) | :: | FirstIteration | |||
logical, | intent(inout) | :: | InitLoopEquip | |||
real(kind=r64), | intent(inout) | :: | MyLoad | |||
integer, | intent(in) | :: | BranchInletNodeNum | |||
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 | |||
real(kind=r64), | intent(inout) | :: | TempCondInDesign | |||
real(kind=r64), | intent(inout) | :: | TempEvapOutDesign |
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 SimGasAbsorber(AbsorberType,AbsorberName,EquipFlowCtrl, CompIndex,RunFlag,FirstIteration,InitLoopEquip,&
MyLoad,BranchInletNodeNum,MaxCap,MinCap,OptCap,GetSizingFactor,SizingFactor, &
TempCondInDesign,TempEvapOutDesign)
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer
! DATE WRITTEN March 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE: This is the Absorption Chiller model driver. It
! gets the input for the models, initializes simulation variables, call
! the appropriate model and sets up reporting variables.
! METHODOLOGY EMPLOYED: na
! REFERENCES: na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE CurveManager, ONLY : CurveValue
USE DataPlant, ONLY : TypeOf_Chiller_DFAbsorption
USE PlantUtilities, ONLY : UpdateChillerComponentCondenserSide
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: AbsorberType ! type of Absorber
CHARACTER(len=*), INTENT(IN) :: AbsorberName ! user specified name of Absorber
INTEGER, INTENT(IN) :: EquipFlowCtrl ! Flow control mode for the equipment
INTEGER , INTENT(IN) :: BranchInletNodeNum ! node number of inlet to calling branch,
! used to determine if heating side or cooling
! side of chiller-heater is being called
LOGICAL , INTENT(IN) :: RunFlag ! simulate Absorber when TRUE
LOGICAL , INTENT(IN) :: FirstIteration ! initialize variables when TRUE
LOGICAL, INTENT(INOUT) :: InitLoopEquip ! If not false, calculate the max load for operating conditions
REAL(r64), INTENT(INOUT) :: MyLoad ! loop demand component will meet
REAL(r64), INTENT(OUT) :: MinCap ! W - minimum operating capacity of Absorber
REAL(r64), INTENT(OUT) :: MaxCap ! W - maximum operating capacity of Absorber
REAL(r64), INTENT(OUT) :: OptCap ! W - optimal operating capacity of Absorber
INTEGER, INTENT(INOUT) :: CompIndex ! Absorber number counter
LOGICAL, INTENT(IN) :: GetSizingFactor ! TRUE when just the sizing factor is requested
REAL(r64), INTENT(INOUT) :: SizingFactor ! sizing factor
REAL(r64), INTENT(INOUT) :: TempCondInDesign
REAL(r64), INTENT(INOUT) :: TempEvapOutDesign
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: HeatCap = 0.0d0 ! W - nominal heating capacity
LOGICAL, SAVE :: GetInput = .TRUE. ! then TRUE, calls subroutine to read input file.
INTEGER :: ChillNum ! Absorber number counter
!Get Absorber data from input file
IF (GetInput) THEN
CALL GetGasAbsorberInput
GetInput = .FALSE.
END IF
! Find the correct Equipment
IF (CompIndex == 0) THEN
ChillNum = FindItemInList(AbsorberName,GasAbsorber%Name,NumGasAbsorbers)
IF (ChillNum == 0) THEN
CALL ShowFatalError('SimGasAbsorber: Unit not found='//TRIM(AbsorberName))
ENDIF
CompIndex=ChillNum
ELSE
ChillNum=CompIndex
IF (ChillNum > NumGasAbsorbers .or. ChillNum < 1) THEN
CALL ShowFatalError('SimGasAbsorber: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(ChillNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumGasAbsorbers))// &
', Entered Unit name='//TRIM(AbsorberName))
ENDIF
IF (CheckEquipName(ChillNum)) THEN
IF (AbsorberName /= GasAbsorber(ChillNum)%Name) THEN
CALL ShowFatalError('SimGasAbsorber: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(ChillNum))// &
', Unit name='//TRIM(AbsorberName)//', stored Unit Name for that index='// &
TRIM(GasAbsorber(ChillNum)%Name))
ENDIF
CheckEquipName(ChillNum)=.false.
ENDIF
ENDIF
! Check that this is a valid call
IF (InitLoopEquip) THEN
TempEvapOutDesign = GasAbsorber(ChillNum)%TempDesCHWSupply
TempCondInDesign = GasAbsorber(ChillNum)%TempDesCondReturn
CALL InitGasAbsorber(ChillNum,RunFlag)
CALL SizeGasAbsorber(ChillNum)
! Match inlet node name of calling branch to determine if this call is for heating or cooling
IF (BranchInletNodeNum == GasAbsorber(ChillNum)%ChillReturnNodeNum) THEN ! Operate as chiller
MinCap = GasAbsorber(ChillNum)%NomCoolingCap*GasAbsorber(ChillNum)%MinPartLoadRat
MaxCap = GasAbsorber(ChillNum)%NomCoolingCap*GasAbsorber(ChillNum)%MaxPartLoadRat
OptCap = GasAbsorber(ChillNum)%NomCoolingCap*GasAbsorber(ChillNum)%OptPartLoadRat
ELSEIF (BranchInletNodeNum == GasAbsorber(ChillNum)%HeatReturnNodeNum) THEN ! Operate as heater
HeatCap = GasAbsorber(ChillNum)%NomCoolingCap*GasAbsorber(ChillNum)%NomHeatCoolRatio
MinCap = HeatCap*GasAbsorber(ChillNum)%MinPartLoadRat
MaxCap = HeatCap*GasAbsorber(ChillNum)%MaxPartLoadRat
OptCap = HeatCap*GasAbsorber(ChillNum)%OptPartLoadRat
ELSEIF (BranchInletNodeNum == GasAbsorber(ChillNum)%CondReturnNodeNum) THEN ! called from condenser loop
HeatCap = 0.d0
MinCap = 0.d0
MaxCap = 0.d0
OptCap = 0.d0
ELSE ! Error, nodes do not match
CALL ShowSevereError('SimGasAbsorber: Invalid call to Gas Absorbtion Chiller-Heater '//TRIM(AbsorberName))
CALL ShowContinueError('Node connections in branch are not consistent with object nodes.')
CALL ShowFatalError('Preceding conditions cause termination.')
ENDIF ! Operate as Chiller or Heater
IF (GetSizingFactor) THEN
SizingFactor = GasAbsorber(ChillNum)%SizFac
END IF
RETURN
END IF
! Match inlet node name of calling branch to determine if this call is for heating or cooling
IF (BranchInletNodeNum .EQ. GasAbsorber(ChillNum)%ChillReturnNodeNum) THEN ! Operate as chiller
! Calculate Node Values
! Calculate Equipment and Update Variables
IF (RunFlag) THEN
GasAbsorber(ChillNum)%InCoolingMode = .TRUE.
ELSE
GasAbsorber(ChillNum)%InCoolingMode = .FALSE.
ENDIF
CALL InitGasAbsorber(ChillNum,RunFlag)
CALL CalcGasAbsorberChillerModel(ChillNum,MyLoad,Runflag)
CALL UpdateGasAbsorberCoolRecords(MyLoad,RunFlag,ChillNum)
ELSEIF (BranchInletNodeNum .EQ. GasAbsorber(ChillNum)%HeatReturnNodeNum) THEN ! Operate as heater
! Calculate Node Values
! Calculate Equipment and Update Variables
IF (RunFlag) THEN
GasAbsorber(ChillNum)%InHeatingMode = .TRUE.
ELSE
GasAbsorber(ChillNum)%InHeatingMode = .FALSE.
ENDIF
CALL InitGasAbsorber(ChillNum,RunFlag)
CALL CalcGasAbsorberHeaterModel(ChillNum,MyLoad,Runflag)
CALL UpdateGasAbsorberHeatRecords(MyLoad,RunFlag,ChillNum)
ELSEIF (BranchInletNodeNum == GasAbsorber(ChillNum)%CondReturnNodeNum) THEN ! called from condenser loop
CALL UpdateChillerComponentCondenserSide(GasAbsorber(ChillNum)%CDLoopNum, &
GasAbsorber(ChillNum)%CDLoopSideNum, &
TypeOf_Chiller_DFAbsorption, &
GasAbsorber(ChillNum)%CondReturnNodeNum, &
GasAbsorber(ChillNum)%CondSupplyNodeNum, &
GasAbsorberReport(ChillNum)%TowerLoad, &
GasAbsorberReport(ChillNum)%CondReturnTemp, &
GasAbsorberReport(ChillNum)%CondSupplyTemp, &
GasAbsorberReport(ChillNum)%CondWaterFlowRate, &
FirstIteration)
ELSE ! Error, nodes do not match
CALL ShowSevereError('Invalid call to Gas Absorber Chiller '//TRIM(AbsorberName))
CALL ShowContinueError('Node connections in branch are not consistent with object nodes.')
CALL ShowFatalError('Preceding conditions cause termination.')
ENDIF
RETURN
END SUBROUTINE SimGasAbsorber