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) | :: | EnergyType | |||
character(len=*), | intent(in) | :: | EquipName | |||
integer, | intent(in) | :: | EquipFlowCtrl | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(in) | :: | RunFlag | |||
logical, | intent(in) | :: | InitLoopEquip | |||
real(kind=r64), | intent(inout) | :: | MyLoad | |||
real(kind=r64), | intent(inout) | :: | MaxCap | |||
real(kind=r64), | intent(inout) | :: | MinCap | |||
real(kind=r64), | intent(inout) | :: | OptCap | |||
logical, | intent(in) | :: | FirstHVACIteration |
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 SimOutsideEnergy(EnergyType,EquipName,EquipFlowCtrl,CompIndex,RunFlag, &
InitLoopEquip,MyLoad,MaxCap,MinCap,OptCap, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN Sept. 1998
! MODIFIED May 2010; Edwin Lee; Linda Lawrie (consolidation)
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Manage the simulation of district (aka purchased) energy.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: EnergyType
CHARACTER(len=*), INTENT(IN) :: EquipName
INTEGER, INTENT(IN) :: EquipFlowCtrl ! Flow control mode for the equipment
INTEGER, INTENT(INOUT) :: CompIndex
LOGICAL, INTENT(IN) :: RunFlag
LOGICAL, INTENT(IN) :: InitLoopEquip
REAL(r64), INTENT(INOUT) :: MyLoad
REAL(r64), INTENT(INOUT) :: MinCap
REAL(r64), INTENT(INOUT) :: MaxCap
REAL(r64), INTENT(INOUT) :: OptCap
LOGICAL, INTENT(IN) :: FirstHVACIteration
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL, SAVE :: GetInputFlag = .true. ! Get input once and once only
INTEGER :: EqNum
REAL(r64) :: InletTemp
REAL(r64) :: OutletTemp
REAL(r64) :: MassFlowRate
!FLOW
!GET INPUT
IF (GetInputFlag) THEN
CALL GetOutsideEnergySourcesInput
GetInputFlag=.false.
ENDIF
! Find the correct Equipment
IF (CompIndex == 0) THEN
EqNum = FindItemInList(EquipName, EnergySource%Name, NumDistrictUnits)
IF (EqNum == 0) THEN
CALL ShowFatalError('SimOutsideEnergy: Unit not found='//TRIM(EquipName))
ENDIF
CompIndex=EqNum
ELSE
EqNum=CompIndex
IF (EnergySource(EqNum)%CheckEquipName) THEN
IF (EqNum > NumDistrictUnits .or. EqNum < 1) THEN
CALL ShowFatalError('SimOutsideEnergy: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(EqNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumDistrictUnits))// &
', Entered Unit name='//TRIM(EquipName))
ENDIF
IF (EquipName /= EnergySource(EqNum)%Name) THEN
CALL ShowFatalError('SimOutsideEnergy: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(EqNum))// &
', Unit name='//TRIM(EquipName)//', stored Unit Name for that index='// &
TRIM(EnergySource(EqNum)%Name))
ENDIF
EnergySource(EqNum)%CheckEquipName=.false.
ENDIF
ENDIF
!CALCULATE
IF (InitLoopEquip) THEN
CALL InitSimVars(EqNum,MassFlowRate,InletTemp,OutletTemp, MyLoad)
MinCap = 0.0d0
MaxCap = EnergySource(EqNum)%NomCap
OptCap = EnergySource(EqNum)%NomCap
RETURN
END IF
CALL InitSimVars(EqNum,MassFlowRate,InletTemp,OutletTemp, MyLoad)
CALL SimDistrictEnergy(RunFlag,EqNum,MyLoad,MassFlowRate,InletTemp,OutletTemp)
CALL UpdateRecords(MyLoad,EqNum,MassFlowRate,OutletTemp)
RETURN
END SUBROUTINE SimOutsideEnergy