Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | LoopName | |||
character(len=*), | intent(in) | :: | BranchName | |||
real(kind=r64), | intent(out) | :: | BranchMaxFlow | |||
integer, | intent(out) | :: | PressCurveType | |||
integer, | intent(out) | :: | PressCurveIndex | |||
integer, | intent(inout) | :: | NumComps | |||
type(ComponentData), | intent(inout), | DIMENSION(:) | :: | BComponents | ||
logical, | intent(inout) | :: | ErrorsFound |
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 GetInternalBranchData(LoopName,BranchName,BranchMaxFlow,PressCurveType,PressCurveIndex,NumComps,BComponents,ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN October 1999
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine gets the Branch Data (internal structure) for the requested
! Branch Name and returns it to the calling routine. This is used internally
! in the module.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: LoopName ! Loop Name for Branch
CHARACTER(len=*), INTENT(IN) :: BranchName ! Requested Branch Name
REAL(r64), INTENT(OUT) :: BranchMaxFlow ! Max Flow Rate for Branch
INTEGER, INTENT(OUT) :: PressCurveType ! Index of pressure curve object
INTEGER, INTENT(OUT) :: PressCurveIndex ! Index of pressure curve object
INTEGER, INTENT(INOUT) :: NumComps ! Number of Components on Branch
TYPE (ComponentData), INTENT(INOUT), &
DIMENSION(:) :: BComponents ! Component data returned
LOGICAL, INTENT(INOUT) :: ErrorsFound ! True when Loop Name is already assigned and this not same loop
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: Found ! Pointer to requested Branch Name
IF (GetBranchInputFlag) THEN
CALL GetBranchInput
GetBranchInputFlag=.false.
ENDIF
Found=FindItemInList(BranchName,Branch%Name,NumOfBranches)
IF (Found == 0) THEN
CALL ShowSevereError('GetInternalBranchData: Branch not found='//TRIM(BranchName))
ErrorsFound=.true.
BranchMaxFlow=0.0d0
NumComps=0
ELSE
IF (Branch(Found)%AssignedLoopName == Blank) THEN
Branch(Found)%AssignedLoopName=LoopName
BranchMaxFlow=Branch(Found)%MaxFlowRate
PressCurveType=Branch(Found)%PressureCurveType
PressCurveIndex=Branch(Found)%PressureCurveIndex
NumComps=Branch(Found)%NumOfComponents
! IF (ALLOCATED(BComponents)) THEN
! DEALLOCATE(BComponents)
! ENDIF
! ALLOCATE(BComponents(NumComps))
BComponents(1:NumComps)=Branch(Found)%Component(1:NumComps)
ELSEIF (Branch(Found)%AssignedLoopName /= LoopName) THEN
CALL ShowSevereError('Attempt to assign branch to two different loops, Branch='//TRIM(BranchName))
CALL ShowContinueError('Branch already assigned to loop='//TRIM(Branch(Found)%AssignedLoopName))
CALL ShowContinueError('New attempt to assign to loop='//TRIM(LoopName))
ErrorsFound=.true.
BranchMaxFlow=0.0d0
NumComps=0
ELSE
BranchMaxFlow=Branch(Found)%MaxFlowRate
PressCurveType=Branch(Found)%PressureCurveType
PressCurveIndex=Branch(Found)%PressureCurveIndex
NumComps=Branch(Found)%NumOfComponents
! IF (ALLOCATED(BComponents)) THEN
! DEALLOCATE(BComponents)
! ENDIF
! ALLOCATE(BComponents(NumComps))
BComponents(1:NumComps)=Branch(Found)%Component(1:NumComps)
ENDIF
ENDIF
RETURN
END SUBROUTINE GetInternalBranchData