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) | :: | CoilTypeNum | |||
character(len=*), | intent(in) | :: | CoilName | |||
integer, | intent(in) | :: | EquipFlowCtrl | |||
integer, | intent(in) | :: | LoopNum | |||
integer, | intent(in) | :: | LoopSide | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
logical, | intent(inout) | :: | InitLoopEquip |
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 UpdateWaterToAirCoilPlantConnection(CoilTypeNum, &
CoilName, &
EquipFlowCtrl, &
LoopNum, &
LoopSide, &
CompIndex, &
FirstHVACIteration, &
InitLoopEquip)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN February 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! update sim routine called from plant
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY: KickOffSimulation
Use DataLoopNode, ONLY: Node
USE DataPlant, ONLY: ccSimPlantEquipTypes, PlantLoop
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
USE DataHVACGlobals, ONLY: SimAirLoopsFlag, SimZoneEquipmentFlag
USE DataInterfaces, ONLY: ShowContinueErrorTimeStamp
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: CoilTypeNum
CHARACTER(len=*), INTENT(IN) :: CoilName
INTEGER, INTENT(IN) :: EquipFlowCtrl ! Flow control mode for the equipment
INTEGER, INTENT(IN) :: LoopNum ! Plant loop index for where called from
INTEGER, INTENT(IN) :: LoopSide ! Plant loop side index for where called from
INTEGER, INTENT(INOUT) :: CompIndex ! Chiller number pointer
LOGICAL , INTENT(IN) :: FirstHVACIteration !
LOGICAL, INTENT(INOUT) :: InitLoopEquip ! If not zero, calculate the max load for operating conditions
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Integer :: CoilNum
LOGICAL :: DidAnythingChange = .FALSE. ! set to true if conditions changed
INTEGER :: InletNodeNum
INTEGER :: OutletNodeNum
! Find the correct water coil
IF (CompIndex == 0) THEN
CoilNum = FindItemInList(CoilName,WaterCoil%Name,NumWaterCoils)
IF (CoilNum == 0) THEN
CALL ShowFatalError('UpdateWaterToAirCoilPlantConnection: Specified Coil not one of Valid water coils='//TRIM(CoilName))
ENDIF
CompIndex=CoilNum
ELSE
CoilNum=CompIndex
IF (CoilNum > NumWaterCoils .or. CoilNum < 1) THEN
CALL ShowFatalError('UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(CoilNum))// &
', Number of Coils='//TRIM(TrimSigDigits(NumWaterCoils))// &
', Entered Coil name='//TRIM(CoilName))
ENDIF
IF (KickOffSimulation) THEN
IF (CoilName /= WaterCoil(CoilNum)%Name) THEN
CALL ShowFatalError('UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(CoilNum))// &
', Coil name='//TRIM(CoilName)//', stored Coil Name for that index='// &
TRIM(WaterCoil(CoilNum)%Name))
ENDIF
IF (CoilTypeNum /= WaterCoil(CoilNum)%WaterCoilType_Num) THEN
CALL ShowFatalError('UpdateWaterToAirCoilPlantConnection: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(CoilNum))// &
', Coil name='//TRIM(CoilName)//', stored Coil Name for that index='// &
TRIM(ccSimPlantEquipTypes(CoilTypeNum)) )
ENDIF
ENDIF
ENDIF
IF (InitLoopEquip) THEN
RETURN
END IF
DidAnythingChange = .FALSE.
InletNodeNum = WaterCoil(CoilNum)%WaterInletNodeNum
OutletNodeNum = WaterCoil(CoilNum)%WaterOutletNodeNum
IF (Node(InletNodeNum)% Temp /= WaterCoil(CoilNum)%InletWaterTemp) DidAnythingChange = .TRUE.
IF (Node(OutletNodeNum)%Temp /= WaterCoil(CoilNum)%OutletWaterTemp) DidAnythingChange = .TRUE.
IF (Node(InletNodeNum)%MassFlowRate /= WaterCoil(CoilNum)%OutletWaterMassFlowRate) THEN
DidAnythingChange = .TRUE.
Node(OutletNodeNum)%MassFlowRate = Node(InletNodeNum)%MassFlowRate ! make sure flows are consistent
ENDIF
IF (Node(OutletNodeNum)%MassFlowRate /= WaterCoil(CoilNum)%OutletWaterMassFlowRate) DidAnythingChange = .TRUE.
IF (DidAnythingChange) THEN
! set sim flag for this loop
PlantLoop(LoopNum)%LoopSide(LoopSide)%SimLoopSideNeeded = .TRUE.
!set sim flags for air side users of coils
SimAirLoopsFlag = .TRUE.
SimZoneEquipmentFlag = .TRUE.
ELSE ! nothing changed so turn off sim flag
PlantLoop(LoopNum)%LoopSide(LoopSide)%SimLoopSideNeeded = .FALSE.
ENDIF
RETURN
END SUBROUTINE UpdateWaterToAirCoilPlantConnection