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 GetWaterSource
! SUBROUTINE INFORMATION:
! AUTHOR: Edwin Lee
! DATE WRITTEN: October 2012
! PURPOSE OF THIS SUBROUTINE:
! This routine gets the inputs and processes them into local data structures
! METHODOLOGY EMPLOYED:
! Standard E+ input processor interaction
! REFERENCES:
!WaterSource,
! A1 , \field Name
! A2 , \field Inlet Node
! A3 , \field Outlet Node
! N1 , \field Design Volume Flow Rate
! A4 , \field Temperature Specification Type
! N2 , \field Boundary Temperature
! A5 ; \field Source Temperature Schedule Name
! USE STATEMENTS:
USE InputProcessor, ONLY : GetNumObjectsFound, GetObjectItem, VerifyName
USE DataIPShortCuts ! Data for field names, blank numerics
USE BranchNodeConnections, ONLY: TestCompSet
USE NodeInputManager, ONLY: GetOnlySingleNode
USE ScheduleManager, ONLY: GetScheduleIndex
USE DataInterfaces, ONLY: SetupOutputVariable, SetupEMSActuator
USE DataGLobals, ONLY: AnyEnergyManagementSystemInModel
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: SourceNum
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
LOGICAL, SAVE :: ErrorsFound=.false.
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
!GET NUMBER OF ALL EQUIPMENT TYPES
cCurrentModuleObject = 'PlantComponent:TemperatureSource'
NumSources = GetNumObjectsFound(cCurrentModuleObject)
IF (NumSources <= 0) THEN
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' equipment specified in input file')
ErrorsFound=.true.
ENDIF
!See if load distribution manager has already gotten the input
IF (ALLOCATED(WaterSource)) RETURN ! probably not possible, and probably should throw error
ALLOCATE (WaterSource(NumSources))
! fill arrays
DO SourceNum = 1 , NumSources
CALL GetObjectItem(cCurrentModuleObject,SourceNum,cAlphaArgs,NumAlphas, &
rNumericArgs,NumNums,IOSTAT,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(cAlphaArgs(1),WaterSource%Name,SourceNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
WaterSource(SourceNum)%Name = cAlphaArgs(1)
WaterSource(SourceNum)%InletNodeNum = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
WaterSource(SourceNum)%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')
WaterSource(SourceNum)%DesVolFlowRate = rNumericArgs(1)
IF (cAlphaArgs(4) .EQ. 'CONSTANT') THEN
WaterSource(SourceNum)%TempSpecType = TempSpecType_Constant
WaterSource(SourceNum)%BoundaryTemp = rNumericArgs(2)
ELSE IF (cAlphaArgs(4) .EQ. 'SCHEDULED') THEN
WaterSource(SourceNum)%TempSpecType = TempSpecType_Schedule
WaterSource(SourceNum)%TempSpecScheduleName = cAlphaArgs(5)
WaterSource(SourceNum)%TempSpecScheduleNum = GetScheduleIndex(cAlphaArgs(5))
IF (WaterSource(SourceNum)%TempSpecScheduleNum == 0) THEN
CALL ShowSevereError('Input error for '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Invalid schedule name in field '//TRIM(cAlphaFieldNames(5))//'='//cAlphaArgs(5))
ErrorsFound = .TRUE.
END IF
ELSE
CALL ShowSevereError('Input error for '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Invalid temperature specification type. Expected either "Constant" or "Scheduled". Encountered "' &
//TRIM(cAlphaArgs(4))//'"')
ErrorsFound = .TRUE.
END IF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in processing input for '//TRIM(cCurrentModuleObject))
ENDIF
DO SourceNum = 1, NumSources
CALL SetupOutputVariable('Plant Temperature Source Component Mass Flow Rate [kg/s]', &
WaterSource(SourceNum)%MassFlowRate,'System','Average',WaterSource(SourceNum)%Name)
CALL SetupOutputVariable('Plant Temperature Source Component Inlet Temperature [C]', &
WaterSource(SourceNum)%InletTemp,'System','Average',WaterSource(SourceNum)%Name)
CALL SetupOutputVariable('Plant Temperature Source Component Outlet Temperature [C]', &
WaterSource(SourceNum)%OutletTemp,'System','Average',WaterSource(SourceNum)%Name)
CALL SetupOutputVariable('Plant Temperature Source Component Source Temperature [C]', &
WaterSource(SourceNum)%BoundaryTemp,'System','Average',WaterSource(SourceNum)%Name)
CALL SetupOutputVariable('Plant Temperature Source Component Heat Transfer Rate [W]', &
WaterSource(SourceNum)%HeatRate,'System','Average',WaterSource(SourceNum)%Name)
CALL SetupOutputVariable('Plant Temperature Source Component Heat Transfer Energy [J]', &
WaterSource(SourceNum)%HeatEnergy,'System','Sum',WaterSource(SourceNum)%Name)
IF ( AnyEnergyManagementSystemInModel ) THEN
CALL SetupEMSActuator('PlantComponent:TemperatureSource', WaterSource(SourceNum)%Name, &
'Maximum Mass Flow Rate', '[kg/s]', &
WaterSource(SourceNum)%EMSOverrideOnMassFlowRateMax, &
WaterSource(SourceNum)%EMSOverrideValueMassFlowRateMax)
ENDIF
END DO
RETURN
END SUBROUTINE GetWaterSource