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) | :: | ComponentInletNodeNum | |||
| real(kind=r64), | intent(in) | :: | DesPlantFlow |
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 RegisterPlantCompDesignFlow(ComponentInletNodeNum,DesPlantFlow)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl(previosly SaveCompDesWaterFlow in General.f90)
! DATE WRITTEN January 2004
! MODIFIED
! RE-ENGINEERED B. Griffith April 2011, allow to enter repeatedly
! PURPOSE OF THIS SUBROUTINE:
! Regester the design fluid flow rates of plant components for sizing purposes
! in an array that can be accessed by the plant manager routines
! allows sizing routines to iterate by safely processing repeated calls from the same component
! METHODOLOGY EMPLOYED:
! Derived from SaveCompDesWaterFlow but changed to allow re entry with the same node just update
! the information at the same location in the structure
! The design flow rate is stored in a dynamic structure array along with the plant component's inlet node number
! (which is used by plant as a component identifier instead if name and type).
! REFERENCES:
! na
! USE STATEMENTS:
USE DataSizing
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ComponentInletNodeNum ! the component's water inlet node number
! (condenser side for water / water components)
REAL(r64), INTENT(IN) :: DesPlantFlow ! the component's design fluid volume flow rate [m3/s]
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
TYPE (CompDesWaterFlowData), ALLOCATABLE, DIMENSION(:) :: CompDesWaterFlow0 ! scratch array to store components'
! design water flow rate
INTEGER :: NumPlantComps
INTEGER :: PlantCompNum ! component do loop index
Logical :: Found
INTEGER :: thisCallNodeIndex
NumPlantComps = SaveNumPlantComps
IF (NumPlantComps == 0) THEN ! first time in, fill and return
NumPlantComps = 1
ALLOCATE(CompDesWaterFlow(NumPlantComps))
! save the new data
CompDesWaterFlow(NumPlantComps)%SupNode = ComponentInletNodeNum
CompDesWaterFlow(NumPlantComps)%DesVolFlowRate = DesPlantFlow
SaveNumPlantComps = NumPlantComps
RETURN
ENDIF
Found = .FALSE.
! find node num index in structure if any
Do PlantCompNum = 1, NumPlantComps
IF (ComponentInletNodeNum == CompDesWaterFlow(PlantCompNum)%SupNode) THEN
Found = .TRUE.
thisCallNodeIndex = PlantCompNum
ENDIF
IF (Found) EXIT
ENDDO
IF (.NOT. Found) THEN ! grow structure and add new node at the end
NumPlantComps = NumPlantComps + 1 ! increment the number of components that use water as a source of heat or coolth
! save the existing data in a scratch array
ALLOCATE(CompDesWaterFlow0(NumPlantComps-1))
CompDesWaterFlow0(1:NumPlantComps-1)%SupNode = CompDesWaterFlow(1:NumPlantComps-1)%SupNode
CompDesWaterFlow0(1:NumPlantComps-1)%DesVolFlowRate = CompDesWaterFlow(1:NumPlantComps-1)%DesVolFlowRate
! get rid of the old array
DEALLOCATE(CompDesWaterFlow)
! allocate a new array
ALLOCATE(CompDesWaterFlow(NumPlantComps))
! save the new data
CompDesWaterFlow(NumPlantComps)%SupNode = ComponentInletNodeNum
CompDesWaterFlow(NumPlantComps)%DesVolFlowRate = DesPlantFlow
! move the old data back from the scratch array
CompDesWaterFlow(1:NumPlantComps-1)%SupNode = CompDesWaterFlow0(1:NumPlantComps-1)%SupNode
CompDesWaterFlow(1:NumPlantComps-1)%DesVolFlowRate = CompDesWaterFlow0(1:NumPlantComps-1)%DesVolFlowRate
DEALLOCATE(CompDesWaterFlow0)
SaveNumPlantComps = NumPlantComps
ELSE
CompDesWaterFlow(thisCallNodeIndex)%SupNode = ComponentInletNodeNum
CompDesWaterFlow(thisCallNodeIndex)%DesVolFlowRate = DesPlantFlow
ENDIF
RETURN
END SUBROUTINE RegisterPlantCompDesignFlow