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) | :: | CompType | |||
character(len=*) | :: | PipeName | ||||
integer, | intent(inout) | :: | CompIndex | |||
real(kind=r64), | intent(in) | :: | MaxVolFlowRate | |||
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 SimPipes(CompType,PipeName,CompIndex, MaxVolFlowRate,InitLoopEquip,FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN Sept. 1998
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! METHODOLOGY EMPLOYED:
! REFERENCES:
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList, SameString
USE General, ONLY: TrimSigDigits
USE DataPlant, ONLY: PlantLoop, ScanPlantLoopsForObject
USE PlantUtilities, ONLY: SafeCopyPlantNode, InitComponentNodes
USE DataGlobals, ONLY: BeginEnvrnFlag
IMPLICIT NONE
! SUBROUTINE PARAMETER DEFINITIONS:
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: CompType
CHARACTER(len=*) :: PipeName
INTEGER,INTENT(INOUT) :: CompIndex
LOGICAL, INTENT(IN) :: FirstHVACIteration
REAL(r64), INTENT(IN) :: MaxVolFlowRate
LOGICAL, INTENT(IN) :: InitLoopEquip
! INTERFACE BLOCK SPECIFICATIONS
! DERIVED TYPE DEFINITIONS
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: PipeNum
! INTEGER :: LoopNum
! INTEGER :: LoopSideNum
! INTEGER :: BranchNum
! INTEGER :: CompNum
INTEGER :: FoundOnLoop
LOGICAL :: errFlag
!FLOW
!GET INPUT
IF (GetPipeInputFlag) THEN
CALL GetPipeInput
GetPipeInputFlag = .FALSE.
END IF
IF (CompIndex == 0) THEN
PipeNum=FindItemInList(PipeName,LocalPipe%Name,NumLocalPipes)
IF (PipeNum == 0) THEN
CALL ShowFatalError('SimPipes: Pipe requested not found ='//TRIM(PipeName)) ! Catch any bad names before crashing
ENDIF
CompIndex=PipeNum
ELSE
PipeNum=CompIndex
IF (PipeNum > NumLocalPipes .or. PipeNum < 1) THEN
CALL ShowFatalError('SimPipes: Invalid CompIndex passed='//TRIM(TrimSigDigits(PipeNum))// &
', Number of Pipes='//TRIM(TrimSigDigits(NumLocalPipes))//', Pipe name='//TRIM(PipeName))
ENDIF
IF (LocalPipe(PipeNum)%CheckEquipName) THEN
IF (PipeName /= LocalPipe(PipeNum)%Name) THEN
CALL ShowFatalError('SimPipes: Invalid CompIndex passed='//TRIM(TrimSigDigits(PipeNum))// &
', Pipe name='//TRIM(PipeName)//', stored Pipe Name for that index='// &
TRIM(LocalPipe(PipeNum)%Name))
ENDIF
LocalPipe(PipeNum)%CheckEquipName=.false.
ENDIF
ENDIF
IF(LocalPipe(PipeNum)%OneTimeInit) THEN
FoundOnLoop = 0
errFlag=.false.
CALL ScanPlantLoopsForObject(LocalPipe(PipeNum)%Name, &
CompType, &
LocalPipe(PipeNum)%LoopNum, &
LocalPipe(PipeNum)%LoopSide, &
LocalPipe(PipeNum)%BranchIndex, &
LocalPipe(PipeNum)%CompIndex, &
CountMatchPlantLoops = FoundOnLoop, &
errFlag=errFlag)
IF (FoundOnLoop == 0) THEN
CALL ShowFatalError('SimPipes: Pipe="'//trim(PipeName)//'" not found on a Plant Loop.')
ENDIF
IF (errFlag) THEN
CALL ShowFatalError('SimPipes: Program terminated due to previous condition(s).')
ENDIF
LocalPipe(PipeNum)%OneTimeInit=.FALSE.
END IF
IF (BeginEnvrnFlag .AND. LocalPipe(PipeNum)%EnvrnFlag) THEN
CALL InitComponentNodes( 0.d0, PlantLoop(LocalPipe(PipeNum)%LoopNum)%MaxMassFlowRate, &
LocalPipe(PipeNum)%InletNodeNum, &
LocalPipe(PipeNum)%OutletNodeNum, &
LocalPipe(PipeNum)%LoopNum, &
LocalPipe(PipeNum)%LoopSide, &
LocalPipe(PipeNum)%BranchIndex, &
LocalPipe(PipeNum)%CompIndex)
LocalPipe(PipeNum)%EnvrnFlag = .FALSE.
ENDIF
IF (.NOT. BeginEnvrnFlag) LocalPipe(PipeNum)%EnvrnFlag = .TRUE.
CALL SafeCopyPlantNode(LocalPipe(PipeNum)%InletNodeNum, &
LocalPipe(PipeNum)%OutletNodeNum, LocalPipe(PipeNum)%LoopNum )
! Node(LocalPipe(PipeNum)%OutletNodeNum)%FluidType = Node(LocalPipe(PipeNum)%InletNodeNum)%FluidType
! Node(LocalPipe(PipeNum)%OutletNodeNum)%Temp = Node(LocalPipe(PipeNum)%InletNodeNum)%Temp
! Node(LocalPipe(PipeNum)%OutletNodeNum)%TempMin = Node(LocalPipe(PipeNum)%InletNodeNum)%TempMin
! Node(LocalPipe(PipeNum)%OutletNodeNum)%TempMax = Node(LocalPipe(PipeNum)%InletNodeNum)%TempMax
! Node(LocalPipe(PipeNum)%OutletNodeNum)%MassFlowRate = Node(LocalPipe(PipeNum)%InletNodeNum)%MassFlowRate
! Node(LocalPipe(PipeNum)%OutletNodeNum)%MassFlowRateMin = Node(LocalPipe(PipeNum)%InletNodeNum)%MassFlowRateMin
! Node(LocalPipe(PipeNum)%OutletNodeNum)%MassFlowRateMax = Node(LocalPipe(PipeNum)%InletNodeNum)%MassFlowRateMax
! Node(LocalPipe(PipeNum)%OutletNodeNum)%MassFlowRateMinAvail = Node(LocalPipe(PipeNum)%InletNodeNum)%MassFlowRateMinAvail
! Node(LocalPipe(PipeNum)%OutletNodeNum)%MassFlowRateMaxAvail = Node(LocalPipe(PipeNum)%InletNodeNum)%MassFlowRateMaxAvail
! Node(LocalPipe(PipeNum)%OutletNodeNum)%Quality = Node(LocalPipe(PipeNum)%InletNodeNum)%Quality
! !Only pass pressure if we aren't doing a pressure simulation
! IF (PlantLoop(LocalPipe(PipeNum)%LoopNum)%PressureSimType > 1) THEN
! !Don't do anything
! ELSE
! Node(LocalPipe(PipeNum)%OutletNodeNum)%Press = Node(LocalPipe(PipeNum)%InletNodeNum)%Press
! END IF
! Node(LocalPipe(PipeNum)%OutletNodeNum)%Enthalpy = Node(LocalPipe(PipeNum)%InletNodeNum)%Enthalpy
! Node(LocalPipe(PipeNum)%OutletNodeNum)%HumRat = Node(LocalPipe(PipeNum)%InletNodeNum)%HumRat
RETURN
END SUBROUTINE SimPipes