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) | :: | LoopNum | |||
real(kind=r64), | intent(in) | :: | MyLoad |
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 InitPlantUserComponent(CompNum, LoopNum, MyLoad)
! SUBROUTINE INFORMATION:
! AUTHOR <author>
! DATE WRITTEN <date_written>
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE PlantUtilities, ONLY: InitComponentNodes
USE FluidProperties, ONLY: GetDensityGlycol, GetSpecificHeatGlycol
USE Psychrometrics , ONLY: PsyRhoAirFnPbTdbW, PsyCpAirFnWTdb
USE DataEnvironment , ONLY: OutBaroPress
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: CompNum
INTEGER, INTENT(IN) :: LoopNum
REAL(r64), INTENT(IN) ::MyLoad
! 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(:) :: MyEnvrnFlag ! environment flag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyFlag
INTEGER :: ConnectionNum
LOGICAL :: errFlag
! REAL(r64) :: rho
! REAL(r64) :: Cp
IF (MyOneTimeFlag) THEN
ALLOCATE(MyFlag(NumUserPlantComps))
ALLOCATE(MyEnvrnFlag(NumUserPlantComps))
MyFlag = .TRUE.
MyEnvrnFlag = .TRUE.
MyOneTimeFlag = .FALSE.
END IF
IF (MyFlag(CompNum)) THEN
! locate the connections to the plant loops
DO ConnectionNum = 1, UserPlantComp(CompNum)%NumPlantConnections
errFlag = .false.
CALL ScanPlantLoopsForObject(UserPlantComp(CompNum)%Name, &
Typeof_PlantComponentUserDefined, &
UserPlantComp(CompNum)%Loop(ConnectionNum)%LoopNum, &
UserPlantComp(CompNum)%Loop(ConnectionNum)%LoopSideNum, &
UserPlantComp(CompNum)%Loop(ConnectionNum)%BranchNum, &
UserPlantComp(CompNum)%Loop(ConnectionNum)%CompNum, &
InletNodeNumber = UserPlantComp(CompNum)%Loop(ConnectionNum)%InletNodeNum )
IF (errFlag) THEN
CALL ShowFatalError('InitPlantUserComponent: Program terminated due to previous condition(s).')
ENDIF
!set user input for flow priority
PlantLoop(UserPlantComp(CompNum)%Loop(ConnectionNum)%LoopNum)% &
LoopSide(UserPlantComp(CompNum)%Loop(ConnectionNum)%LoopSideNum)% &
Branch(UserPlantComp(CompNum)%Loop(ConnectionNum)%BranchNum)% &
Comp(UserPlantComp(CompNum)%Loop(ConnectionNum)%CompNum)%FlowPriority &
= UserPlantComp(CompNum)%Loop(ConnectionNum)%FlowPriority
! set user input for how loads served
PlantLoop(UserPlantComp(CompNum)%Loop(ConnectionNum)%LoopNum)% &
LoopSide(UserPlantComp(CompNum)%Loop(ConnectionNum)%LoopSideNum)% &
Branch(UserPlantComp(CompNum)%Loop(ConnectionNum)%BranchNum)% &
Comp(UserPlantComp(CompNum)%Loop(ConnectionNum)%CompNum)%HowLoadServed &
= UserPlantComp(CompNum)%Loop(ConnectionNum)%HowLoadServed
ENDDO
MyFlag(CompNum) = .FALSE.
ENDIF
IF (LoopNum <= 0 .OR. LoopNum > UserPlantComp(CompNum)%NumPlantConnections) RETURN
! fill internal variable targets
UserPlantComp(CompNum)%Loop(LoopNum)%MyLoad = MyLoad
UserPlantComp(CompNum)%Loop(LoopNum)%InletRho = GetDensityGlycol( &
PlantLoop(UserPlantComp(CompNum)%Loop(LoopNum)%LoopNum)%FluidName, &
Node(UserPlantComp(CompNum)%Loop(LoopNum)%InletNodeNum)%Temp, &
PlantLoop(UserPlantComp(CompNum)%Loop(LoopNum)%LoopNum)%FluidIndex, &
'InitPlantUserComponent')
UserPlantComp(CompNum)%Loop(LoopNum)%InletCp = GetSpecificHeatGlycol( &
PlantLoop(UserPlantComp(CompNum)%Loop(LoopNum)%LoopNum)%FluidName, &
Node(UserPlantComp(CompNum)%Loop(LoopNum)%InletNodeNum)%Temp, &
PlantLoop(UserPlantComp(CompNum)%Loop(LoopNum)%LoopNum)%FluidIndex, &
'InitPlantUserComponent')
UserPlantComp(CompNum)%Loop(LoopNum)%InletMassFlowRate = &
Node(UserPlantComp(CompNum)%Loop(LoopNum)%InletNodeNum)%MassFlowRate
UserPlantComp(CompNum)%Loop(LoopNum)%InletTemp = &
Node(UserPlantComp(CompNum)%Loop(LoopNum)%InletNodeNum)%Temp
IF (UserPlantComp(CompNum)%Air%InletNodeNum > 0) THEN
UserPlantComp(CompNum)%Air%InletRho = PsyRhoAirFnPbTdbW(OutBaroPress, &
Node(UserPlantComp(CompNum)%Air%InletNodeNum)%Temp, &
Node(UserPlantComp(CompNum)%Air%InletNodeNum)%HumRat, &
'InitPlantUserComponent')
UserPlantComp(CompNum)%Air%InletCp = PsyCpAirFnWTdb( &
Node(UserPlantComp(CompNum)%Air%InletNodeNum)%HumRat, &
Node(UserPlantComp(CompNum)%Air%InletNodeNum)%Temp , &
'InitPlantUserComponent')
UserPlantComp(CompNum)%Air%InletTemp = &
Node(UserPlantComp(CompNum)%Air%InletNodeNum)%Temp
UserPlantComp(CompNum)%Air%InletMassFlowRate = &
Node(UserPlantComp(CompNum)%Air%InletNodeNum)%MassFlowRate
UserPlantComp(CompNum)%Air%InletHumRat = &
Node(UserPlantComp(CompNum)%Air%InletNodeNum)%HumRat
ENDIF
RETURN
END SUBROUTINE InitPlantUserComponent