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) | :: | CompType | |||
character(len=*), | intent(in) | :: | CompName | |||
logical, | intent(out) | :: | MatchFound | |||
integer, | intent(out) | :: | MatchLoopType | |||
integer, | intent(out) | :: | MatchLoop | |||
integer, | intent(out) | :: | MatchBranch | |||
integer, | intent(out) | :: | MatchComp |
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 FindDemandSideMatch(CompType,CompName,MatchFound,MatchLoopType,MatchLoop,MatchBranch,MatchComp)
! SUBROUTINE INFORMATION:
! AUTHOR Rick Strand
! DATE WRITTEN September 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine intializes the connections between various loops.
! Due to the fact that this requires numerous string compares, it
! is much more efficient to find this information once and then
! store it in module level variables (LoopConnect derived type).
! METHODOLOGY EMPLOYED:
! Simply cycles through the plant and condenser demand sides until
! a component is found that matches the component type and name
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY : SameString
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: CompType ! Inlet node of the component to find the match of
CHARACTER(len=*), INTENT(IN) :: CompName ! Outlet node of the component to find the match of
LOGICAL, INTENT(OUT) :: MatchFound ! Set to .TRUE. when a match is found
INTEGER, INTENT(OUT) :: MatchLoopType ! Loop number of the match
INTEGER, INTENT(OUT) :: MatchLoop ! Loop number of the match
INTEGER, INTENT(OUT) :: MatchBranch ! Branch number of the match
INTEGER, INTENT(OUT) :: MatchComp ! Component number of the match
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: PassBranchNum ! DO loop counter for branches
INTEGER :: PassCompNum ! DO loop counter for components
INTEGER :: PassLoopNum ! DO loop counter for loops or the top level of the hierarchy
! FLOW:
! Initialize all of the output variables
MatchFound = .FALSE.
MatchLoopType = 0
MatchLoop = 0
MatchLoop = 0
MatchBranch = 0
MatchComp = 0
! Now cycle through all of the demand side loops to see if we can find
! a match for the component type and name. Once a match is found,
! record the type of loop and the loop, branch, and component numbers.
IF (.NOT. MatchFound) THEN ! Go through the plant demand side loops
DO PassLoopNum = 1, NumPlantLoops
DO PassBranchNum = 1, VentRepPlantDemandSide(PassLoopNum)%TotalBranches
DO PassCompNum = 1, VentRepPlantDemandSide(PassLoopNum)%Branch(PassBranchNum)%TotalComponents
IF ( SameString(CompType,VentRepPlantDemandSide(PassLoopNum)%Branch(PassBranchNum)%Comp(PassCompNum)%TypeOf) .AND. &
SameString(CompName,VentRepPlantDemandSide(PassLoopNum)%Branch(PassBranchNum)%Comp(PassCompNum)%Name) ) THEN
! Found a match on the plant demand side--increment the counter
MatchFound = .TRUE.
MatchLoopType = 1
MatchLoop = PassLoopNum
MatchBranch = PassBranchNum
MatchComp = PassCompNum
EXIT ! PassCompNum DO loop
END IF
END DO
IF (MatchFound) EXIT ! PassBranchNum DO loop
END DO
IF (MatchFound) EXIT ! PassLoopNum DO loop
END DO
END IF
IF (.NOT. MatchFound) THEN ! Go through the condenser demand side loops
DO PassLoopNum = 1, NumCondLoops
DO PassBranchNum = 1, VentRepCondDemandSide(PassLoopNum)%TotalBranches
DO PassCompNum = 1, VentRepCondDemandSide(PassLoopNum)%Branch(PassBranchNum)%TotalComponents
IF ( SameString(CompType,VentRepCondDemandSide(PassLoopNum)%Branch(PassBranchNum)%Comp(PassCompNum)%TypeOf) .AND. &
SameString(CompName,VentRepCondDemandSide(PassLoopNum)%Branch(PassBranchNum)%Comp(PassCompNum)%Name) ) THEN
! Found a match on the plant demand side--increment the counter
MatchFound = .TRUE.
MatchLoopType = 2
MatchLoop = PassLoopNum
MatchBranch = PassBranchNum
MatchComp = PassCompNum
EXIT ! PassCompNum DO loop
END IF
END DO
IF (MatchFound) EXIT ! PassBranchNum DO loop
END DO
IF (MatchFound) EXIT ! PassLoopNum DO loop
END DO
END IF
RETURN
END SUBROUTINE FindDemandSideMatch