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=MaxNameLength), | intent(in) | :: | CompName | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(out) | :: | SensLoadMet | |||
real(kind=r64), | intent(out) | :: | LatLoadMet | |||
integer, | intent(inout) | :: | CompIndex |
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 SimHeatPumpWaterHeater(CompName,FirstHVACIteration,SensLoadMet,LatLoadMet,CompIndex)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad
! DATE WRITTEN April 2005
! MODIFIED Don Shirey, Aug 2009 (LatLoadMet)
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine acts as an interface to SimWaterHeater.
! HPWHs defined as zone equipment and not connected to a plant loop are called here by ZoneEquipmentManager
! METHODOLOGY EMPLOYED:
! The necessary control flags and dummy variables are set and passed into SimWaterHeater.
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
USE DataGlobals, ONLY: DoingSizing
USE DataInterfaces, ONLY: ShowFatalError
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=MaxNameLength), INTENT(IN) :: CompName
LOGICAL, INTENT(IN) :: FirstHVACIteration
REAL(r64), INTENT(OUT) :: SensLoadMet ! sensible load met by this equipment and sent to zone, W
REAL(r64), INTENT (OUT) :: LatLoadMet ! net latent load met and sent to zone (kg/s), dehumid = negative
INTEGER, INTENT(INOUT) :: CompIndex
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: LocalRunFlag,LocalInitLoopEquip ! local variables of similar name as others used in Sim modules
INTEGER :: LocalFlowLock ! local variables of similar name as others used in sim modules
INTEGER :: HeatPumpNum
REAL(r64) :: MyLoad, MinCap, MaxCap, OptCap
! FLOW:
IF (GetWaterThermalTankInputFlag) THEN
CALL GetWaterThermalTankInput
GetWaterThermalTankInputFlag = .FALSE.
END IF
! Find the correct Heat Pump Water Heater
IF (CompIndex == 0) THEN
HeatPumpNum = FindItemInList(CompName, HPWaterHeater%Name, NumHeatPumpWaterHeater)
IF (HeatPumpNum == 0) THEN
CALL ShowFatalError('SimHeatPumpWaterHeater: Unit not found='//TRIM(CompName))
ENDIF
CompIndex=HeatPumpNum
ELSE
HeatPumpNum=CompIndex
IF (HeatPumpNum > NumHeatPumpWaterHeater .or. HeatPumpNum < 1) THEN
CALL ShowFatalError('SimHeatPumpWaterHeater: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(HeatPumpNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumHeatPumpWaterHeater))// &
', Entered Unit name='//TRIM(CompName))
ENDIF
END IF
! Only simulate HPWHs specified as zone equipment and not connected to a plant loop.
! HPWHs not defined as zone equipment with no plant connections are simulated in NonZoneEquipmentManager.
! Plant connected HPWHs are called by PlantLoopEquipments (but only those on supply side ).
SensLoadMet = 0.0d0
LatLoadMet = 0.0d0
LocalRunFlag = .TRUE.
LocalFlowLock = 1 ! .TRUE.
LocalInitLoopEquip = .FALSE.
! HPWH will not be included in sizing calculations, fan is initialized only during BeginEnvrnFlag (FALSE during sizing)
! (fan will be turned off during Standard Ratings procedure yielding incorrect results)
IF(DoingSizing)RETURN
! For HPWHs, StandAlone means not connected to a plant loop (use nodes are not used, source nodes are connected to a HPWH)
IF(HPWaterHeater(HeatPumpNum)%StandAlone)THEN
CALL SimWaterThermalTank(HPWaterHeater(HeatPumpNum)%TypeNum,HPWaterHeater(HeatPumpNum)%Name, HeatPumpNum, &
LocalRunFlag,LocalInitLoopEquip,MyLoad,MinCap,MaxCap,OptCap,FirstHVACIteration)
SensLoadMet = HPWaterHeater(HeatPumpNum)%HPWaterHeaterSensibleCapacity
LatLoadMet = HPWaterHeater(HeatPumpNum)%HPWaterHeaterLatentCapacity
ELSE
! HPWH is plant connected and will get simulated when called from plant SimWaterThermalTank, but need to update loads met here
SensLoadMet = HPWaterHeater(HeatPumpNum)%HPWaterHeaterSensibleCapacity
LatLoadMet = HPWaterHeater(HeatPumpNum)%HPWaterHeaterLatentCapacity
END IF
RETURN
END SUBROUTINE SimHeatPumpWaterHeater