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 | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | LoadCenterNum | |||
real(kind=r64), | intent(out) | :: | ThermalLoad |
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 CalcLoadCenterThermalLoad(FirstHVACIteration, LoadCenterNum, ThermalLoad)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN Dec 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE DataPlant
USE DataHVACGlobals, ONLY: NumPlantLoops, SysTimeElapsed
USE InputProcessor, ONLY: SameString
USE DataGlobals, ONLY: dooutputreporting, MetersHaveBeenInitialized, warmupflag, &
doingsizing, currenttime
USE General, ONLY: TrimSigDigits
USE DataEnvironment, ONLY: Month, DayOfMonth
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT (IN) :: FirstHVACIteration !unused1208
INTEGER, INTENT (IN) :: LoadCenterNum ! Load Center number counter
REAL(r64), INTENT (OUT) :: ThermalLoad ! heat rate called for from cogenerator(watts)
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL, SAVE :: MyOneTimeSetupFlag = .true.
LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: MyCoGenSetupFlag
INTEGER :: FoundCount
INTEGER :: i
INTEGER :: j
INTEGER :: k
INTEGER :: m
INTEGER :: LoopID
INTEGER :: SideID
INTEGER :: BranchID
INTEGER :: CompID
CHARACTER(len=MaxNameLength) :: thisName
!unused INTEGER :: ThisTypeNum
!debugstuff
!unused REAL(r64) :: ActualTime
!unused CHARACTER*300 :: OutputString
!unused CHARACTER*5 :: strFirstHVACIteration
! need to do initial setups
IF (MyOneTimeSetupFlag) THEN
ALLOCATE(MyCoGenSetupFlag(NumLoadCenters))
MyCoGenSetupFlag = .true.
ThermalLoad = 0.0d0
MyOneTimeSetupFlag = .false.
return
ENDIF
FoundCount = 0
IF (MyCoGenSetupFlag(LoadCenterNum)) THEN
If (Allocated(PlantLoop)) then
! loop across generators and find match
Do i = 1, ElecLoadCenter(LoadCenterNum)%NumGenerators
thisName = ElecLoadCenter(LoadCenterNum)%ElecGen(i)%Name
Do j = 1, NumPlantLoops
Do k = 1, plantLoop(j)%LoopSide(SupplySide)%TotalBranches
Do m = 1, plantLoop(j)%LoopSide(SupplySide)%Branch(k)%TotalComponents
If (SameString(plantLoop(j)%LoopSide(SupplySide)%Branch(k)%Comp(m)%Name, thisName)) then
ElecLoadCenter(LoadCenterNum)%ElecGen(i)%PlantLoopNum = j
ElecLoadCenter(LoadCenterNum)%ElecGen(i)%LoopSideNum = SupplySide
ElecLoadCenter(LoadCenterNum)%ElecGen(i)%BranchNum = k
ElecLoadCenter(LoadCenterNum)%ElecGen(i)%CompNum = m
MyCoGenSetupFlag(LoadCenterNum) = .false.
FoundCount = FoundCount +1
ElecLoadCenter(LoadCenterNum)%ElecGen(i)%PlantInfoFound = .true.
ENDIF
ENDDO ! components
ENDDO ! branches
ENDDO ! plant loops
ENDDO ! generators in load center
ENDIF
ENDIF
! sum up "MyLoad" for all generators on this load center from plant structure
ThermalLoad = 0.0d0
Do i = 1, ElecLoadCenter(LoadCenterNum)%NumGenerators
If (ElecLoadCenter(LoadCenterNum)%ElecGen(i)%PlantInfoFound) then
LoopID = ElecLoadCenter(LoadCenterNum)%ElecGen(i)%PlantLoopNum
SideID = ElecLoadCenter(LoadCenterNum)%ElecGen(i)%LoopSideNum
BranchID = ElecLoadCenter(LoadCenterNum)%ElecGen(i)%BranchNum
CompID = ElecLoadCenter(LoadCenterNum)%ElecGen(i)%CompNum
ThermalLoad = ThermalLoad + &
PlantLoop(LoopID)%LoopSide(SideID)%Branch(BranchID)%Comp(CompID)%MyLoad
ENDIF
ENDDO
ThermalLoad = ThermalLoad
END SUBROUTINE CalcLoadCenterThermalLoad