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) | :: | Loop1Num | |||
integer, | intent(in) | :: | Loop1LoopSideNum | |||
integer, | intent(in) | :: | Loop2Num | |||
integer, | intent(in) | :: | Loop2LoopSideNum | |||
integer, | intent(in) | :: | PlantComponentTypeOfNum | |||
logical, | intent(in) | :: | Loop1DemandsOnLoop2 |
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 InterConnectTwoPlantLoopSides(Loop1Num, Loop1LoopSideNum,Loop2Num, Loop2LoopSideNum,&
PlantComponentTypeOfNum, Loop1DemandsOnLoop2 )
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN February 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Setup PlantLoop data structure pointers to direct interacting loops
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
Use DataPlant, Only: PlantLoop, ConnectedLoopData
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: Loop1Num
INTEGER, INTENT(IN) :: Loop1LoopSideNum
INTEGER, INTENT(IN) :: Loop2Num
INTEGER, INTENT(IN) :: Loop2LoopSideNum
INTEGER, INTENT(IN) :: PlantComponentTypeOfNum
LOGICAL, INTENT(IN) :: Loop1DemandsOnLoop2
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
TYPE(ConnectedLoopData), DIMENSION(:), ALLOCATABLE :: TemporaryConnectedLoops
INTEGER :: CurrentNumConnectedLoops
LOGICAL :: Loop2DemandsOnLoop1
IF (Loop1Num .EQ. 0 .OR. Loop1LoopSideNum .EQ. 0 .OR. &
Loop2Num .EQ. 0 .OR. Loop2LoopSideNum .EQ. 0) THEN
RETURN ! Associated ScanPlantLoopsForObject couldn't find the component in the the plant loop structure...
ENDIF ! This is a Fatal error condition
Loop2DemandsOnLoop1 = .FALSE.
IF (.NOT. Loop1DemandsOnLoop2) Loop2DemandsOnLoop1 = .TRUE.
IF (ALLOCATED(PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected)) THEN
CurrentNumConnectedLoops = PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%TotalConnected
ALLOCATE(TemporaryConnectedLoops(CurrentNumConnectedLoops))
TemporaryConnectedLoops = PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected
DEALLOCATE( PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected )
ALLOCATE( PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(CurrentNumConnectedLoops +1) )
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%TotalConnected = CurrentNumConnectedLoops +1
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(1:CurrentNumConnectedLoops) = TemporaryConnectedLoops
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%LoopNum = Loop2Num
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%LoopSideNum = Loop2LoopSideNum
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%ConnectorTypeOf_Num &
= PlantComponentTypeOfNum
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%LoopDemandsOnRemote &
= Loop1DemandsOnLoop2
DEALLOCATE(TemporaryConnectedLoops)
ELSE
ALLOCATE( PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(1) )
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%TotalConnected = 1
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(1)%LoopNum = Loop2Num
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(1)%LoopSideNum = Loop2LoopSideNum
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(1)%ConnectorTypeOf_Num &
= PlantComponentTypeOfNum
PlantLoop(Loop1Num)%LoopSide(Loop1LoopSideNum)%Connected(1)%LoopDemandsOnRemote &
= Loop1DemandsOnLoop2
ENDIF
IF (ALLOCATED(PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected)) THEN
CurrentNumConnectedLoops = PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%TotalConnected
ALLOCATE(TemporaryConnectedLoops(CurrentNumConnectedLoops))
TemporaryConnectedLoops = PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected
DEALLOCATE( PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected )
ALLOCATE( PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(CurrentNumConnectedLoops +1) )
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%TotalConnected = CurrentNumConnectedLoops +1
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(1:CurrentNumConnectedLoops) = TemporaryConnectedLoops
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%LoopNum = Loop1Num
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%LoopSideNum = Loop1LoopSideNum
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%ConnectorTypeOf_Num &
= PlantComponentTypeOfNum
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(CurrentNumConnectedLoops+1)%LoopDemandsOnRemote &
= Loop2DemandsOnLoop1
DEALLOCATE(TemporaryConnectedLoops)
ELSE
ALLOCATE( PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(1) )
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%TotalConnected = 1
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(1)%LoopNum = Loop1Num
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(1)%LoopSideNum = Loop1LoopSideNum
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(1)%ConnectorTypeOf_Num = PlantComponentTypeOfNum
PlantLoop(Loop2Num)%LoopSide(Loop2LoopSideNum)%Connected(1)%LoopDemandsOnRemote = Loop2DemandsOnLoop1
ENDIF
RETURN
END SUBROUTINE InterConnectTwoPlantLoopSides