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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | LoopNum | |||
integer, | intent(in) | :: | LoopSideNum | |||
character(len=*), | intent(in) | :: | EquipType | |||
character(len=*), | intent(in) | :: | EquipName | |||
integer, | intent(inout) | :: | CompIndex | |||
logical, | intent(inout) | :: | InitLoopEquip | |||
real(kind=r64), | intent(in) | :: | MyLoad | |||
real(kind=r64), | intent(out) | :: | MaxCap | |||
real(kind=r64), | intent(out) | :: | MinCap | |||
real(kind=r64), | intent(out) | :: | OptCap |
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 SimUserDefinedPlantComponent(LoopNum, LoopSideNum, EquipType,EquipName, &
CompIndex,InitLoopEquip,MyLoad,MaxCap,MinCap,OptCap)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN Jan 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! User Defined plant generic component
! METHODOLOGY EMPLOYED:
! This routine to be called from PlantLoopEquipment.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
USE EMSManager, ONLY: ManageEMS
USE PlantUtilities, ONLY: InitComponentNodes, RegisterPlantCompDesignFlow
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: LoopNum ! plant loop sim call originated from
INTEGER, INTENT(IN) :: LoopSideNum ! plant loop side sim call originated from
CHARACTER(len=*), INTENT(IN) :: EquipType ! type of equipment, 'PlantComponent:UserDefined'
CHARACTER(len=*), INTENT(IN) :: EquipName ! user name for component
INTEGER, INTENT(INOUT) :: CompIndex
LOGICAL, INTENT(INOUT) :: InitLoopEquip
REAL(r64), INTENT(IN) :: MyLoad
REAL(r64), INTENT(OUT) :: MinCap
REAL(r64), INTENT(OUT) :: MaxCap
REAL(r64), INTENT(OUT) :: OptCap
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CompNum
INTEGER :: ThisLoop
INTEGER :: Loop
IF (GetInput) THEN
CALL GetUserDefinedComponents
GetInput=.FALSE.
END IF
! Find the correct Equipment
IF (CompIndex == 0) THEN
CompNum = FindItemInList(EquipName, UserPlantComp%Name, NumUserPlantComps)
IF (CompNum == 0) THEN
CALL ShowFatalError('SimUserDefinedPlantComponent: User Defined Plant Component not found')
ENDIF
CompIndex = CompNum
ELSE
CompNum = CompIndex
IF (CompNum < 1 .OR. CompNum > NumUserPlantComps) THEN
CALL ShowFatalError('SimUserDefinedPlantComponent: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(CompNum))// &
', Number of units ='//TRIM(TrimSigDigits(NumUserPlantComps))// &
', Entered Unit name = '//TRIM(EquipName) )
ENDIF
IF(CheckUserPlantCompName(CompNum)) THEN
IF (EquipName /= UserPlantComp(CompNum)%Name) THEN
CALL ShowFatalError('SimUserDefinedPlantComponent: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(CompNum))// &
', Unit name='//TRIM(EquipName)//', stored unit name for that index='// &
TRIM(UserPlantComp(CompNum)%Name) )
ENDIF
CheckUserPlantCompName(CompNum) = .FALSE.
ENDIF
ENDIF
IF (InitLoopEquip .OR. BeginEnvrnFlag) THEN
CALL InitPlantUserComponent(CompNum, LoopNum, MyLoad)
! find loop connection number from LoopNum and LoopSide
ThisLoop = 0
DO Loop = 1, UserPlantComp(CompNum)%NumPlantConnections
IF (LoopNum /= UserPlantComp(CompNum)%Loop(Loop)%LoopNum) CYCLE
IF (LoopSideNum /= UserPlantComp(CompNum)%Loop(Loop)%LoopSideNum) CYCLE
ThisLoop = loop
ENDDO
IF (ThisLoop > 0) THEN
IF (UserPlantComp(CompNum)%Loop(ThisLoop)%ErlInitProgramMngr > 0) THEN
CALL ManageEMS(emsCallFromUserDefinedComponentModel, &
ProgramManagerToRun = UserPlantComp(CompNum)%Loop(ThisLoop)%ErlInitProgramMngr )
ENDIF
! now interface sizing related values with rest of E+
MinCap = UserPlantComp(CompNum)%Loop(ThisLoop)%MinLoad
MaxCap = UserPlantComp(CompNum)%Loop(ThisLoop)%MaxLoad
OptCap = UserPlantComp(CompNum)%Loop(ThisLoop)%OptLoad
CALL InitComponentNodes(UserPlantComp(CompNum)%Loop(ThisLoop)%MassFlowRateMin, &
UserPlantComp(CompNum)%Loop(ThisLoop)%MassFlowRateMax, &
UserPlantComp(CompNum)%Loop(ThisLoop)%InletNodeNum, &
UserPlantComp(CompNum)%Loop(ThisLoop)%OutletNodeNum, &
UserPlantComp(CompNum)%Loop(ThisLoop)%LoopNum, &
UserPlantComp(CompNum)%Loop(ThisLoop)%LoopSideNum, &
UserPlantComp(CompNum)%Loop(ThisLoop)%BranchNum, &
UserPlantComp(CompNum)%Loop(ThisLoop)%CompNum )
CALL RegisterPlantCompDesignFlow(UserPlantComp(CompNum)%Loop(ThisLoop)%InletNodeNum, &
UserPlantComp(CompNum)%Loop(ThisLoop)%DesignVolumeFlowRate)
ELSE
! throw warning
CALL ShowFatalError('SimUserDefinedPlantComponent: did not find where called from' // &
' loop number called from =' //TRIM(TrimSigDigits(LoopNum)) // &
' , loop side called from =' //TRIM(TrimSigDigits(LoopSideNum)) )
ENDIF
RETURN
ENDIF
ThisLoop = 0
DO Loop = 1, UserPlantComp(CompNum)%NumPlantConnections
IF (LoopNum /= UserPlantComp(CompNum)%Loop(Loop)%LoopNum) CYCLE
IF (LoopSideNum /= UserPlantComp(CompNum)%Loop(Loop)%LoopSideNum) CYCLE
ThisLoop = loop
ENDDO
CALL InitPlantUserComponent(CompNum, ThisLoop, MyLoad)
IF (ThisLoop > 0) THEN
IF (UserPlantComp(CompNum)%Loop(ThisLoop)%ErlSimProgramMngr > 0) THEN
CALL ManageEMS(emsCallFromUserDefinedComponentModel, &
ProgramManagerToRun = UserPlantComp(CompNum)%Loop(ThisLoop)%ErlSimProgramMngr)
ENDIF
ENDIF
IF (UserPlantComp(CompNum)%ErlSimProgramMngr > 0) THEN
CALL ManageEMS(emsCallFromUserDefinedComponentModel, &
ProgramManagerToRun = UserPlantComp(CompNum)%ErlSimProgramMngr )
ENDIF
CALL ReportPlantUserComponent(CompNum, ThisLoop)
RETURN
END SUBROUTINE SimUserDefinedPlantComponent