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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | LoopName | |||
character(len=*), | intent(in) | :: | ConnectorListName | |||
character(len=MaxNameLength), | intent(out) | :: | SplitterName | |||
logical, | intent(out) | :: | IsSplitter | |||
character(len=MaxNameLength), | intent(out) | :: | InletNodeName | |||
integer, | intent(out) | :: | InletNodeNum | |||
integer, | intent(out) | :: | NumOutletNodes | |||
character(len=MaxNameLength), | intent(out), | DIMENSION(:) | :: | OutletNodeNames | ||
integer, | intent(out), | DIMENSION(:) | :: | OutletNodeNums | ||
logical, | intent(inout) | :: | ErrorsFound | |||
integer, | intent(in), | optional | :: | ConnectorNumber | ||
integer, | intent(inout), | optional | :: | SplitterNumber |
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 GetLoopSplitter(LoopName,ConnectorListName,SplitterName,IsSplitter,InletNodeName,InletNodeNum,NumOutletNodes, &
OutletNodeNames,OutletNodeNums,ErrorsFound,ConnectorNumber,SplitterNumber)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN October 1999
! MODIFIED October 2001, Automatic Extensibility
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine gets the data for the requested Connector List and returns values indicating
! if this connector list name is a splitter or not.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: TrimSigDigits
USE InputProcessor, ONLY: SameString
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: LoopName ! Loop Name for this Splitter
CHARACTER(len=*), INTENT(IN) :: ConnectorListName ! Requested Connector List Name
CHARACTER(len=MaxNameLength), INTENT(OUT) :: SplitterName ! Name of Splitter
LOGICAL, INTENT(OUT) :: IsSplitter ! True if splitter on this connector list
CHARACTER(len=MaxNameLength), INTENT(OUT) :: InletNodeName ! Inlet Node ID
INTEGER, INTENT(OUT) :: InletNodeNum ! Inlet Node Number
INTEGER, INTENT(OUT) :: NumOutletNodes ! Number of Outlet Nodes
CHARACTER(len=MaxNameLength), INTENT(OUT), &
DIMENSION(:) :: OutletNodeNames ! Outlet Node IDs
INTEGER, INTENT(OUT), DIMENSION(:) :: OutletNodeNums ! Outlet Node Numbers
LOGICAL, INTENT(INOUT) :: ErrorsFound
INTEGER, OPTIONAL, INTENT(IN) :: ConnectorNumber ! number of the current item in connector list
INTEGER, OPTIONAL, INTENT(INOUT) :: SplitterNumber ! splitter number for this specific splitter
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: Count ! Loop Counter
INTEGER :: Loop ! Loop Counter
TYPE (ConnectorData) :: Connectoid ! Connector Data
TYPE (ComponentData), ALLOCATABLE, &
DIMENSION(:) :: BComponents ! Branch Component Data
INTEGER NumComps ! Number of Components on this Branch
REAL(r64) MaxFlowRate ! Branch Max Flow Rate
INTEGER :: PressCurveType
INTEGER :: PressCurveIndex
LOGICAL :: errFlag ! Error flag from RegisterNodeConnection
INTEGER :: NumParams
INTEGER :: NumAlphas
INTEGER :: NumNumbers
IF (GetSplitterInputFlag) THEN
CALL GetSplitterInput
GetSplitterInputFlag=.false.
ENDIF
IF (ConnectorListName == Blank) THEN
CALL ShowSevereError('GetLoopSplitter: ConnectorListName is blank. LoopName='//TRIM(LoopName))
CALL ShowFatalError('Program terminates due to previous condition.')
ENDIF
CALL GetConnectorList(ConnectorListName,Connectoid,ConnectorNumber)
IF (SameString(Connectoid%ConnectorType(1) , cSPLITTER)) THEN
Count=FindItemInList(Connectoid%ConnectorName(1),Splitters%Name,NumSplitters)
IF(PRESENT(SplitterNumber)) SplitterNumber = SplitterNumber + 1
IF (Count == 0) THEN
CALL ShowFatalError('GetLoopSplitter: No Splitter Found='//TRIM(Connectoid%ConnectorName(1)))
ENDIF
ELSEIF (SameString(Connectoid%ConnectorType(2) , cSPLITTER)) THEN
Count=FindItemInList(Connectoid%ConnectorName(2),Splitters%Name,NumSplitters)
IF (Count == 0) THEN
CALL ShowFatalError('GetLoopSplitter: No Splitter Found='//TRIM(Connectoid%ConnectorName(2)))
ENDIF
ELSE
Count=0
ENDIF
! Default for any errors
SplitterName=Blank
IsSplitter=.false.
InletNodeName=Blank
InletNodeNum=0
NumOutletNodes=0
OutletNodeNames=Blank
OutletNodeNums=0
IF (Count /= 0) THEN ! Build up Output list(s). For each component(?)
! The inlet node for the splitter will be the last "outlet" node of the inlet
! branch. The outlet nodes for the splitter will be the first "inlet" node of
! each corresponding outlet branch since that would be the first node on the branch.
SplitterName=Splitters(Count)%Name
IsSplitter=.true.
! The number of "components" on a Splitter is the number of branches. This is the number of alpha arguments -1.
CALL GetObjectDefMaxArgs('Branch',NumParams,NumAlphas,NumNumbers)
ALLOCATE(BComponents(NumAlphas-1))
errFlag=.false.
CALL GetInternalBranchData(LoopName,Splitters(Count)%InletBranchName,MaxFlowRate,PressCurveType,PressCurveIndex, &
NumComps,BComponents,errFlag)
IF (errFlag) THEN
CALL ShowContinueError('..occurs for Splitter Name='//TRIM(Splitters(Count)%Name))
ErrorsFound=.true.
ENDIF
IF (NumComps > 0) THEN
InletNodeName=BComponents(NumComps)%OutletNodeName
InletNodeNum=BComponents(NumComps)%OutletNode
NumOutletNodes=Splitters(Count)%NumOutletBranches
! Register this node connection because the splitter gets node information indirectly from the branch
errFlag=.false.
CALL RegisterNodeConnection(InletNodeNum,NodeID(InletNodeNum),'Connector:Splitter',SplitterName, &
ValidConnectionTypes(NodeConnectionType_Inlet),1,ObjectIsNotParent,errFlag)
IF (NumOutletNodes > SIZE(OutletNodeNames) .or. NumOutletNodes > SIZE(OutletNodeNums)) THEN
CALL ShowSevereError('GetLoopSplitter: Connector:Splitter='//TRIM(SplitterName)// &
' contains too many outlets for size of '// &
'Outlet Array.')
CALL ShowContinueError('Max array size='//TRIM(TrimSigDigits(SIZE(OutletNodeNames)))// &
', Splitter statement outlets='//TRIM(TrimSigDigits(NumOutLetNodes)))
CALL ShowFatalError('Program terminates due to preceding condition.')
ENDIF
OutletNodeNums=0
OutletNodeNames=Blank
DO Loop=1,Splitters(Count)%NumOutletBranches
CALL GetInternalBranchData(LoopName,Splitters(Count)%OutletBranchNames(Loop),MaxFlowRate,PressCurveType,PressCurveIndex,&
NumComps,BComponents,ErrorsFound)
IF (NumComps > 0) THEN
OutletNodeNames(Loop)=BComponents(1)%InletNodeName
OutletNodeNums(Loop)=BComponents(1)%InletNode
! Register this node connection because the splitter gets node information indirectly from the branch
errFlag=.false.
CALL RegisterNodeConnection(OutletNodeNums(Loop),NodeID(OutletNodeNums(Loop)),'Connector:Splitter',SplitterName, &
ValidConnectionTypes(NodeConnectionType_Outlet),1,ObjectIsNotParent,errFlag)
ENDIF
ENDDO
ELSE
! Set so cascading errors don't happen
IsSplitter=.false.
ENDIF
DEALLOCATE(BComponents)
ENDIF
RETURN
END SUBROUTINE GetLoopSplitter