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.
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 GetOutsideEnergySourcesInput
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN April 1998
! MODIFIED May 2010; Edwin Lee; Linda Lawrie (consolidation)
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine obtains the input data puts it into the
! component arrays. Data items in the component arrays
! are initialized. Output variables are set up.
! METHODOLOGY EMPLOYED: to be determined...
! USE STATEMENTS:
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName
USE DataIPShortCuts
USE NodeInputManager, ONLY: GetOnlySingleNode
USE BranchNodeConnections, ONLY: TestCompSet
USE ScheduleManager, ONLY: GetScheduleIndex, CheckScheduleValueMinMax
USE DataGlobals, ONLY: ScheduleAlwaysOn
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: EnergySourceNum
INTEGER :: NumAlphas ! Number of elements in the alpha array
INTEGER :: NumNums ! Number of elements in the numeric array
INTEGER :: IOStat ! IO Status when calling get input subroutine
INTEGER :: NumDistrictUnitsHeat
INTEGER :: NumDistrictUnitsCool
INTEGER :: IndexCounter
LOGICAL :: ErrorsFound = .false. ! If errors detected in input
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
!GET NUMBER OF ALL EQUIPMENT TYPES
cCurrentModuleObject = 'DistrictHeating'
NumDistrictUnitsHeat = GetNumObjectsFound(cCurrentModuleObject)
cCurrentModuleObject = 'DistrictCooling'
NumDistrictUnitsCool = GetNumObjectsFound(cCurrentModuleObject)
NumDistrictUnits = NumDistrictUnitsHeat + NumDistrictUnitsCool
IF(ALLOCATED(EnergySource))RETURN
ALLOCATE(EnergySource(NumDistrictUnits))
ALLOCATE(EnergySourceReport(NumDistrictUnits))
cCurrentModuleObject = 'DistrictHeating'
EnergySourceNum = 0
DO IndexCounter = 1 , NumDistrictUnitsHeat
EnergySourceNum = EnergySourceNum + 1
CALL GetObjectItem(cCurrentModuleObject,EnergySourceNum,cAlphaArgs,NumAlphas, &
rNumericArgs,NumNums,IOSTAT, AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames= cAlphaFieldNames)
IF (EnergySourceNum > 1) THEN
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(cAlphaArgs(1),EnergySource%Name,EnergySourceNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
ENDIF
EnergySource(EnergySourceNum)%Name = cAlphaArgs(1)
EnergySource(EnergySourceNum)%PlantLoopID = ' '
EnergySource(EnergySourceNum)%SecndryLoopID = ' '
EnergySource(EnergySourceNum)%ScheduleID = ' '
EnergySource(EnergySourceNum)%InletNodeNum = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
EnergySource(EnergySourceNum)%OutletNodeNum = &
GetOnlySingleNode(cAlphaArgs(3),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
CALL TestCompSet(TRIM(cCurrentModuleObject),cAlphaArgs(1),cAlphaArgs(2),cAlphaArgs(3),'Hot Water Nodes')
EnergySource(EnergySourceNum)%NomCap = rNumericArgs(1)
EnergySource(EnergySourceNum)%EnergyTransfer = 0.0d0
EnergySource(EnergySourceNum)%EnergyRate = 0.0d0
EnergySource(EnergySourceNum)%EnergyType = EnergyType_DistrictHeating
IF (.not. lAlphaFieldBlanks(4)) THEN
EnergySource(EnergySourceNum)%CapFractionSchedNum = GetScheduleIndex(cAlphaArgs(4))
IF (EnergySource(EnergySourceNum)%CapFractionSchedNum == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(EnergySource(EnergySourceNum)%Name)// &
'", is not valid')
CALL ShowContinueError(TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'" was not found.')
ErrorsFound=.TRUE.
ENDIF
IF (.not. CheckScheduleValueMinMax(EnergySource(EnergySourceNum)%CapFractionSchedNum, '>=', 0.0d0) ) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(EnergySource(EnergySourceNum)%Name)// &
'", is not valid')
CALL ShowContinueError(TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'" should not have negative values.')
CALL ShowContinueError('Negative values will be treated as zero, and the simulation continues.')
ENDIF
ELSE
EnergySource(EnergySourceNum)%CapFractionSchedNum= ScheduleAlwaysOn
ENDIF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in processing input for '//TRIM(cCurrentModuleObject)// &
', Preceding condition caused termination.')
ENDIF
EnergySourceNum = 0
DO IndexCounter = 1 , NumDistrictUnitsHeat
EnergySourceNum = EnergySourceNum + 1
CALL SetupOutputVariable('District Heating Hot Water Energy [J]',EnergySource(EnergySourceNum)%EnergyTransfer, &
'System','Sum',EnergySource(EnergySourceNum)%Name, &
ResourceTypeKey='DistrictHeating',EndUseKey='Heating',GroupKey='Plant')
CALL SetupOutputVariable('District Heating Hot Water Rate [W]',EnergySource(EnergySourceNum)%EnergyRate, &
'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Heating Rate [W]', &
EnergySource(EnergySourceNum)%EnergyRate,'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Heating Inlet Temperature [C]', &
EnergySourceReport(EnergySourceNum)%InletTemp,'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Heating Outlet Temperature [C]', &
EnergySourceReport(EnergySourceNum)%OutletTemp,'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Heating Mass Flow Rate [kg/s]', &
EnergySourceReport(EnergySourceNum)%MassFlowRate,'System','Average',EnergySource(EnergySourceNum)%Name)
END DO
cCurrentModuleObject = 'DistrictCooling'
EnergySourceNum = NumDistrictUnitsHeat !To initialize counter
DO IndexCounter = 1 , NumDistrictUnitsCool
EnergySourceNum = EnergySourceNum + 1
CALL GetObjectItem(cCurrentModuleObject,IndexCounter,cAlphaArgs,NumAlphas, &
rNumericArgs,NumNums,IOSTAT, AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames= cAlphaFieldNames)
IF (EnergySourceNum > 1) THEN
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(cAlphaArgs(1),EnergySource%Name,EnergySourceNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
ENDIF
EnergySource(EnergySourceNum)%Name = cAlphaArgs(1)
EnergySource(EnergySourceNum)%PlantLoopID = ' '
EnergySource(EnergySourceNum)%SecndryLoopID = ' '
EnergySource(EnergySourceNum)%ScheduleID = ' '
EnergySource(EnergySourceNum)%InletNodeNum = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
EnergySource(EnergySourceNum)%OutletNodeNum = &
GetOnlySingleNode(cAlphaArgs(3),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
CALL TestCompSet(TRIM(cCurrentModuleObject),cAlphaArgs(1),cAlphaArgs(2),cAlphaArgs(3),'Chilled Water Nodes')
EnergySource(EnergySourceNum)%NomCap = rNumericArgs(1)
EnergySource(EnergySourceNum)%EnergyTransfer = 0.0d0
EnergySource(EnergySourceNum)%EnergyRate = 0.0d0
EnergySource(EnergySourceNum)%EnergyType = EnergyType_DistrictCooling
IF (.not. lAlphaFieldBlanks(4)) THEN
EnergySource(EnergySourceNum)%CapFractionSchedNum = GetScheduleIndex(cAlphaArgs(4))
IF (EnergySource(EnergySourceNum)%CapFractionSchedNum == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(EnergySource(EnergySourceNum)%Name)// &
'", is not valid')
CALL ShowContinueError(TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'" was not found.')
ErrorsFound=.TRUE.
ENDIF
IF (.not. CheckScheduleValueMinMax(EnergySource(EnergySourceNum)%CapFractionSchedNum, '>=', 0.0d0) ) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(EnergySource(EnergySourceNum)%Name)// &
'", is not valid')
CALL ShowContinueError(TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'" should not have negative values.')
CALL ShowContinueError('Negative values will be treated as zero, and the simulation continues.')
ENDIF
ELSE
EnergySource(EnergySourceNum)%CapFractionSchedNum= ScheduleAlwaysOn
ENDIF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in processing input for '//TRIM(cCurrentModuleObject)// &
', Preceding condition caused termination.')
ENDIF
EnergySourceNum = NumDistrictUnitsHeat !To initialize counter
DO IndexCounter = 1 , NumDistrictUnitsCool
EnergySourceNum = EnergySourceNum + 1
CALL SetupOutputVariable('District Cooling Chilled Water Energy [J]',EnergySource(EnergySourceNum)%EnergyTransfer, &
'System','Sum',EnergySource(EnergySourceNum)%Name, &
ResourceTypeKey='DistrictCooling',EndUseKey='Cooling',GroupKey='Plant')
CALL SetupOutputVariable('District Cooling Chilled Water Rate [W]',EnergySource(EnergySourceNum)%EnergyRate, &
'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Cooling Rate [W]', &
EnergySource(EnergySourceNum)%EnergyRate,'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Cooling Inlet Temperature [C]', &
EnergySourceReport(EnergySourceNum)%InletTemp,'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Cooling Outlet Temperature [C]', &
EnergySourceReport(EnergySourceNum)%OutletTemp,'System','Average',EnergySource(EnergySourceNum)%Name)
CALL SetupOutputVariable('District Cooling Mass Flow Rate [kg/s]', &
EnergySourceReport(EnergySourceNum)%MassFlowRate,'System','Average',EnergySource(EnergySourceNum)%Name)
END DO
RETURN
END SUBROUTINE GetOutsideEnergySourcesInput