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=MaxNameLength) | :: | CurrentModuleObject | ||||
integer, | intent(in) | :: | NumSchemes | |||
integer, | intent(in) | :: | LoopNum | |||
integer, | intent(in) | :: | SchemeNum | |||
logical, | intent(inout) | :: | ErrorsFound |
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 GetUserDefinedOpSchemeInput(CurrentModuleObject,NumSchemes,LoopNum,SchemeNum,ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR <author>
! DATE WRITTEN <date_written>
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE DataIPShortCuts
USE DataPlant
USE InputProcessor, ONLY: GetObjectItem, SameString, FindItemInList
USE DataRuntimeLanguage, ONLY: EMSProgramCallManager, NumProgramCallManagers
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! for ease in renaming
INTEGER, INTENT(IN) :: NumSchemes ! May be set here and passed on
INTEGER, INTENT(IN) :: LoopNum ! May be set here and passed on
INTEGER, INTENT(IN) :: SchemeNum ! May be set here and passed on
LOGICAL, INTENT(INOUT) :: ErrorsFound ! May be set here and passed on
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: Plant = 1 ! Used to identify whether the current loop is Plant
INTEGER, PARAMETER :: Condenser = 2 ! Used to identify whether the current loop is Condenser
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: NumAlphas
INTEGER :: NumNums
INTEGER :: Num
INTEGER :: Compnum
INTEGER :: IOSTAT
LOGICAL :: SchemeNameFound ! Set to FALSE if a match of OpScheme object and OpScheme name is not found
CHARACTER(len=MaxNameLength) :: LoopOpSchemeObj ! Used to identify the object name for loop equipment operation scheme
INTEGER :: StackMngrNum ! local temporary for Erl program calling manager index
LOGICAL :: lDummy
SchemeNameFound = .TRUE.
IF (PlantLoop(LoopNum)%TypeofLoop == Plant) THEN
LoopOpSchemeObj = 'PlantEquipmentOperationSchemes'
ELSEIF (PlantLoop(LoopNum)%TypeofLoop == Condenser) THEN
LoopOpSchemeObj = 'CondenserEquipmentOperationSchemes'
ENDIF
IF (NumSchemes .GT. 0) THEN
DO Num = 1, NumSchemes
CALL GetObjectItem(CurrentModuleObject,Num, &
cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, AlphaBlank=lAlphaFieldBlanks, &
NumBlank=lNumericFieldBlanks,AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IF(SameString(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name,cAlphaArgs(1))) EXIT !found the correct one
IF (Num == NumSchemes) THEN ! did not find it
CALL ShowSevereError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", could not find '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
ErrorsFound = .true.
SchemeNameFound = .FALSE.
ENDIF
ENDDO
IF (SchemeNameFound) THEN
PlantLoop(LoopNum)%OpScheme(SchemeNum)%NumEquipLists = 1
ALLOCATE (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1))
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%NumComps = (NumAlphas - 3)/2
IF (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%NumComps .GT. 0) THEN
ALLOCATE (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%Comp &
(PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%NumComps))
DO Compnum = 1, PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%NumComps
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%Comp(compnum)%Typeof = cAlphaArgs(Compnum*2+2)
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%Comp(compnum)%Name = cAlphaArgs(Compnum*2+3)
!Setup EMS actuators for machines' MyLoad.
CALL SetupEMSActuator('Plant Equipment Operation', &
TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//':'// &
TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%Comp(compnum)%Name), &
'Distributed Load Rate', '[W]', lDummy, &
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%Comp(compnum)%EMSActuatorDispatchedLoadValue)
CALL SetupEMSInternalVariable('Component Remaining Current Demand Rate', &
TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//':'// &
TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%Comp(compnum)%Name), '[W]', &
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(1)%Comp(compnum)%EMSIntVarRemainingLoadValue)
ENDDO
ENDIF
StackMngrNum = FindItemInList(cAlphaArgs(2), EMSProgramCallManager%Name, NumProgramCallManagers)
IF (StackMngrNum > 0) THEN ! found it
PlantLoop(LoopNum)%OpScheme(SchemeNum)%ErlSimProgramMngr = StackMngrNum
ELSE
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//'='//TRIM(cAlphaArgs(2)))
CALL ShowContinueError('Entered in '//TRIM(CurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('EMS Program Manager Name not found.')
ErrorsFound = .TRUE.
ENDIF
IF (.NOT. lAlphaFieldBlanks(3)) THEN
StackMngrNum = FindItemInList(cAlphaArgs(3), EMSProgramCallManager%Name, NumProgramCallManagers)
IF (StackMngrNum > 0) THEN ! found it
PlantLoop(LoopNum)%OpScheme(SchemeNum)%ErlInitProgramMngr = StackMngrNum
ELSE
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(3))//'='//TRIM(cAlphaArgs(3)))
CALL ShowContinueError('Entered in '//TRIM(CurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('EMS Program Manager Name not found.')
ErrorsFound = .TRUE.
ENDIF
ENDIF
! setup internal variable for Supply Side Current Demand Rate [W]
CALL SetupEMSInternalVariable('Supply Side Current Demand Rate',PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name, '[W]', &
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EMSIntVarLoopDemandRate )
ENDIF
ELSE
CALL ShowSevereError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", could not find '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
RETURN
END SUBROUTINE GetUserDefinedOpSchemeInput