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) | :: | CompNum | |||
integer, | intent(in) | :: | ZoneNum |
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.
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 InitAirTerminalUserDefined(CompNum, ZoneNum)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN March 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE FluidProperties, ONLY: GetDensityGlycol, GetSpecificHeatGlycol
USE Psychrometrics, ONLY: PsyRhoAirFnPbTdbW, PsyCpAirFnWTdb
USE DataEnvironment, ONLY: OutBaroPress
USE DataZoneEnergyDemands, ONLY: ZoneSysEnergyDemand, ZoneSysMoistureDemand
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: CompNum
INTEGER, INTENT(IN) :: ZoneNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL, SAVE :: MyOneTimeFlag = .TRUE. ! one time flag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyFlag
LOGICAL :: errFlag
INTEGER :: Loop
IF (MyOneTimeFlag) THEN
ALLOCATE(MyFlag(NumUserAirTerminals))
MyFlag = .TRUE.
MyOneTimeFlag = .FALSE.
END IF
IF (MyFlag(CompNum)) THEN
IF (UserAirTerminal(CompNum)%NumPlantConnections > 0) THEN
DO Loop = 1, UserAirTerminal(CompNum)%NumPlantConnections
errFlag = .false.
CALL ScanPlantLoopsForObject(UserAirTerminal(CompNum)%Name, &
TypeOf_AirTerminalUserDefined, &
UserAirTerminal(CompNum)%Loop(loop)%LoopNum, &
UserAirTerminal(CompNum)%Loop(loop)%LoopSideNum, &
UserAirTerminal(CompNum)%Loop(loop)%BranchNum, &
UserAirTerminal(CompNum)%Loop(loop)%CompNum , &
InletNodeNumber = UserAirTerminal(CompNum)%Loop(loop)%InletNodeNum)
IF (errFlag) THEN
CALL ShowFatalError('InitPlantUserComponent: Program terminated due to previous condition(s).')
ENDIF
!set user input for flow priority
PlantLoop(UserAirTerminal(CompNum)%Loop(loop)%LoopNum)% &
LoopSide(UserAirTerminal(CompNum)%Loop(loop)%LoopSideNum)% &
Branch(UserAirTerminal(CompNum)%Loop(loop)%BranchNum)% &
Comp(UserAirTerminal(CompNum)%Loop(loop)%CompNum)%FlowPriority &
= UserAirTerminal(CompNum)%Loop(loop)%FlowPriority
! set user input for how loads served
PlantLoop(UserAirTerminal(CompNum)%Loop(loop)%LoopNum)% &
LoopSide(UserAirTerminal(CompNum)%Loop(loop)%LoopSideNum)% &
Branch(UserAirTerminal(CompNum)%Loop(loop)%BranchNum)% &
Comp(UserAirTerminal(CompNum)%Loop(loop)%CompNum)%HowLoadServed &
= UserAirTerminal(CompNum)%Loop(loop)%HowLoadServed
ENDDO
ENDIF
ENDIF
! fill internal variable targets
UserAirTerminal(CompNum)%RemainingOutputToHeatingSP = ZoneSysEnergyDemand(ZoneNum)%RemainingOutputReqToHeatSP
UserAirTerminal(CompNum)%RemainingOutputToCoolingSP = ZoneSysEnergyDemand(ZoneNum)%RemainingOutputReqToCoolSP
UserAirTerminal(CompNum)%RemainingOutputReqToDehumidSP = ZoneSysMoistureDemand(ZoneNum)%RemainingOutputReqToDehumidSP
UserAirTerminal(CompNum)%RemainingOutputReqToHumidSP = ZoneSysMoistureDemand(ZoneNum)%RemainingOutputReqToHumidSP
UserAirTerminal(CompNum)%AirLoop%InletRho = PsyRhoAirFnPbTdbW(OutBaroPress, &
Node(UserAirTerminal(CompNum)%AirLoop%InletNodeNum)%Temp, &
Node(UserAirTerminal(CompNum)%AirLoop%InletNodeNum)%HumRat, &
'InitAirTerminalUserDefined' )
UserAirTerminal(CompNum)%AirLoop%InletCp = PsyCpAirFnWTdb( &
Node(UserAirTerminal(CompNum)%AirLoop%InletNodeNum)%HumRat, &
Node(UserAirTerminal(CompNum)%AirLoop%InletNodeNum)%Temp , &
'InitAirTerminalUserDefined')
UserAirTerminal(CompNum)%AirLoop%InletTemp = &
Node(UserAirTerminal(CompNum)%AirLoop%InletNodeNum)%Temp
UserAirTerminal(CompNum)%AirLoop%InletHumRat = &
Node(UserAirTerminal(CompNum)%AirLoop%InletNodeNum)%HumRat
IF (UserAirTerminal(CompNum)%SourceAir%InletNodeNum > 0) THEN
UserAirTerminal(CompNum)%SourceAir%InletRho = PsyRhoAirFnPbTdbW(OutBaroPress, &
Node(UserAirTerminal(CompNum)%SourceAir%InletNodeNum)%Temp, &
Node(UserAirTerminal(CompNum)%SourceAir%InletNodeNum)%HumRat, &
'InitAirTerminalUserDefined')
UserAirTerminal(CompNum)%SourceAir%InletCp = PsyCpAirFnWTdb( &
Node(UserAirTerminal(CompNum)%SourceAir%InletNodeNum)%HumRat, &
Node(UserAirTerminal(CompNum)%SourceAir%InletNodeNum)%Temp, &
'InitAirTerminalUserDefined' )
UserAirTerminal(CompNum)%SourceAir%InletTemp = &
Node(UserAirTerminal(CompNum)%SourceAir%InletNodeNum)%Temp
UserAirTerminal(CompNum)%SourceAir%InletHumRat = &
Node(UserAirTerminal(CompNum)%SourceAir%InletNodeNum)%HumRat
ENDIF
IF (UserAirTerminal(CompNum)%NumPlantConnections > 0) THEN
Do Loop = 1, UserAirTerminal(CompNum)%NumPlantConnections
UserAirTerminal(CompNum)%Loop(Loop)%InletRho = GetDensityGlycol( &
PlantLoop(UserAirTerminal(CompNum)%Loop(Loop)%LoopNum)%FluidName, &
Node(UserAirTerminal(CompNum)%Loop(Loop)%InletNodeNum)%Temp, &
PlantLoop(UserAirTerminal(CompNum)%Loop(Loop)%LoopNum)%FluidIndex, &
'InitAirTerminalUserDefined')
UserAirTerminal(CompNum)%Loop(Loop)%InletCp = GetSpecificHeatGlycol( &
PlantLoop(UserAirTerminal(CompNum)%Loop(Loop)%LoopNum)%FluidName, &
Node(UserAirTerminal(CompNum)%Loop(Loop)%InletNodeNum)%Temp, &
PlantLoop(UserAirTerminal(CompNum)%Loop(Loop)%LoopNum)%FluidIndex, &
'InitAirTerminalUserDefined')
UserAirTerminal(CompNum)%Loop(Loop)%InletTemp = &
Node(UserAirTerminal(CompNum)%Loop(Loop)%InletNodeNum)%Temp
UserAirTerminal(CompNum)%Loop(Loop)%InletMassFlowRate = &
Node(UserAirTerminal(CompNum)%Loop(Loop)%InletNodeNum)%MassFlowRate
ENDDO
ENDIF
RETURN
END SUBROUTINE InitAirTerminalUserDefined