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) | :: | EquipTypeNum | |||
character(len=*), | intent(in) | :: | CompName | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(in) | :: | InitLoopEquip | |||
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.
SUBROUTINE SimulateWaterUseConnection(EquipTypeNum, CompName, CompIndex, InitLoopEquip, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith March 2010, Demand Side Update
! DATE WRITTEN August 2006
! MODIFIED
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Plant sim call for plant loop connected water use and connections
! (based on SimulateWaterUse by P. Ellis)
! METHODOLOGY EMPLOYED:
!
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits, TrimSigDigits
USE InputProcessor, ONLY: FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIterations = 100
REAL(r64), PARAMETER :: Tolerance = 0.1d0 ! Make input?
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: EquipTypeNum
CHARACTER(len=*), INTENT(IN) :: CompName
INTEGER, INTENT(INOUT) :: CompIndex
LOGICAL, INTENT(IN) :: InitLoopEquip
LOGICAL, INTENT(IN) :: FirstHVACIteration
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! INTEGER :: WaterEquipNum
INTEGER :: WaterConnNum
INTEGER :: NumIteration
INTEGER, SAVE :: MaxIterationsErrorCount
LOGICAL, SAVE :: MyEnvrnFlag = .TRUE.
! FLOW:
IF (GetWaterUseInputFlag) THEN
CALL GetWaterUseInput
GetWaterUseInputFlag = .FALSE.
END IF
IF (CompIndex == 0) THEN
WaterConnNum = FindItemInList(CompName , WaterConnections%Name, NumWaterConnections )
IF (WaterConnNum == 0) THEN
CALL ShowFatalError('SimulateWaterUseConnection: Unit not found='//TRIM(CompName))
ENDIF
CompIndex = WaterConnNum
ELSE
WaterConnNum = CompIndex
IF (WaterConnNum > NumWaterConnections .OR. WaterConnNum < 1) THEN
Call ShowFatalError('SimulateWaterUseConnection: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(WaterConnNum))// &
', Number of Units='//Trim(TrimSigDigits(NumWaterConnections))// &
', Entered Unit name='//Trim(CompName))
ENDIF
IF (CheckEquipName(WaterConnNum)) THEN
IF (CompName /= WaterConnections(WaterConnNum)%Name) THEN
CALL ShowFatalError('SimulateWaterUseConnection: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(WaterConnNum))// &
', Unit name='//Trim(CompName )// ', stored Unit Name for that index='// &
TRIM(WaterConnections(WaterConnNum)%Name) )
ENDIF
CheckEquipName(WaterConnNum) = .FALSE.
ENDIF
ENDIF
IF (InitLoopEquip) THEN
RETURN
ENDIF
IF (BeginEnvrnFlag .and. MyEnvrnFlag) THEN
MaxIterationsErrorCount = 0
IF (NumWaterEquipment > 0) THEN
WaterEquipment%SensibleRate = 0.0d0
WaterEquipment%SensibleEnergy = 0.0d0
WaterEquipment%LatentRate = 0.0d0
WaterEquipment%LatentEnergy = 0.0d0
WaterEquipment%MixedTemp = 0.0d0
WaterEquipment%TotalMassFlowRate = 0.0d0
WaterEquipment%DrainTemp = 0.0d0
ENDIF
IF (NumWaterConnections > 0) THEN
WaterConnections%TotalMassFlowRate = 0.0d0
ENDIF
MyEnvrnFlag = .false.
END IF
IF ( .NOT. BeginEnvrnFlag) MyEnvrnFlag = .true.
CALL InitConnections(WaterConnNum)
NumIteration = 0
DO WHILE (.TRUE.)
NumIteration = NumIteration + 1
CALL CalcConnectionsFlowRates(WaterConnNum, FirstHVACIteration)
CALL CalcConnectionsDrainTemp(WaterConnNum)
CALL CalcConnectionsHeatRecovery(WaterConnNum)
IF (WaterConnections(WaterConnNum)%TempError < Tolerance) THEN
EXIT
ELSE IF (NumIteration > MaxIterations) THEN
IF (.NOT. WarmupFlag) THEN
IF (WaterConnections(WaterConnNum)%MaxIterationsErrorIndex == 0) THEN
CALL ShowWarningError('WaterUse:Connections = '//TRIM(WaterConnections(WaterConnNum)%Name)// &
': Heat recovery temperature did not converge')
CALL ShowContinueErrorTimeStamp(' ')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('WaterUse:Connections = '//TRIM(WaterConnections(WaterConnNum)%Name)// &
': Heat recovery temperature did not converge', &
WaterConnections(WaterConnNum)%MaxIterationsErrorIndex)
END IF
EXIT
END IF
END DO ! WHILE
CALL UpdateWaterConnections(WaterConnNum)
CALL ReportWaterUse(WaterConnNum)
RETURN
END SUBROUTINE SimulateWaterUseConnection