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) | :: | AvailabilityListName | |||
integer, | intent(in) | :: | Loop | |||
integer, | intent(in) | :: | NumPlantLoops | |||
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.
SUBROUTINE GetPlantAvailabilityManager(AvailabilityListName,Loop,NumPlantLoops,ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN August 2007
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine gets the plant availability manager data for the indicated
! loop. If the PlantAvailMgr structure has not been allocated, it will be allocated
! to "number of plant loops".
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE DataPlant
USE InputProcessor, ONLY: FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: AvailabilityListName ! name that should be an Availability Manager List Name
INTEGER, INTENT(IN) :: Loop ! which loop this is
INTEGER, INTENT(IN) :: NumPlantLoops ! Total number of plant loops
LOGICAL, INTENT(INOUT) :: ErrorsFound ! true if certain errors are detected here
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER Found
INTEGER Num
IF (GetAvailListsInput) THEN
CALL GetSysAvailManagerListInputs
GetAvailListsInput=.FALSE.
ENDIF
IF (.not. ALLOCATED(PlantAvailMgr)) THEN
ALLOCATE(PlantAvailMgr(NumPlantLoops))
ENDIF
Found=0
IF (NumAvailManagerLists > 0) &
Found=FindItemInList(AvailabilityListName,SysAvailMgrListData%Name,NumAvailManagerLists)
IF (Found /= 0) THEN
PlantAvailMgr(Loop)%NumAvailManagers = SysAvailMgrListData(Found)%NumItems
PlantAvailMgr(Loop)%AvailStatus = NoAction
PlantAvailMgr(Loop)%StartTime = 0
PlantAvailMgr(Loop)%StopTime = 0
ALLOCATE(PlantAvailMgr(Loop)%AvailManagerName(PlantAvailMgr(Loop)%NumAvailManagers))
ALLOCATE(PlantAvailMgr(Loop)%AvailManagerType(PlantAvailMgr(Loop)%NumAvailManagers))
ALLOCATE(PlantAvailMgr(Loop)%AvailManagerNum(PlantAvailMgr(Loop)%NumAvailManagers))
DO Num=1,PlantAvailMgr(Loop)%NumAvailManagers
PlantAvailMgr(Loop)%AvailManagerName(Num) = SysAvailMgrListData(Found)%AvailManagerName(Num)
PlantAvailMgr(Loop)%AvailManagerNum(Num) = 0
PlantAvailMgr(Loop)%AvailManagerType(Num) = SysAvailMgrListData(Found)%AvailManagerType(Num)
IF (PlantAvailMgr(Loop)%AvailManagerType(Num) == 0) THEN
CALL ShowSevereError('GetPlantLoopData/GetPlantAvailabilityManager: '// &
'Invalid System Availability Manager Type entered="'// &
TRIM(SysAvailMgrListData(Found)%cAvailManagerType(Num))//'".')
CALL ShowContinueError('Occurs in AvailabilityManagerAssignmentList="'// &
TRIM(AvailabilityListName)//'".')
ErrorsFound=.TRUE.
ENDIF
IF (SysAvailMgrListData(Found)%AvailManagerType(Num) == SysAvailMgr_DiffThermo .and. &
Num /= PlantAvailMgr(Loop)%NumAvailManagers) THEN
CALL ShowWarningError('GetPlantLoopData/GetPlantAvailabilityManager: '// &
'AvailabilityManager:DifferentialThermostat="'// &
TRIM(SysAvailMgrListData(Found)%AvailManagerName(Num))//'".')
CALL ShowContinueError('...is not the last manager on the AvailabilityManagerAssignmentList. '// &
'Any remaining managers will not be used.')
CALL ShowContinueError('Occurs in AvailabilityManagerAssignmentList ="'// &
TRIM(AvailabilityListName)//'".')
ENDIF
IF (SysAvailMgrListData(Found)%AvailManagerType(Num) == SysAvailMgr_NightVent .OR. &
SysAvailMgrListData(Found)%AvailManagerType(Num) == SysAvailMgr_NightCycle) THEN
CALL ShowSevereError('GetPlantLoopData/GetPlantAvailabilityManager: '// &
'Invalid System Availability Manager Type entered="'// &
TRIM(SysAvailMgrListData(Found)%cAvailManagerType(Num))//'".')
CALL ShowContinueError('...this manager is not used in a Plant Loop.')
CALL ShowContinueError('Occurs in AvailabilityManagerAssignmentList="'// &
TRIM(AvailabilityListName)//'".')
ErrorsFound=.TRUE.
ENDIF
END DO !End of Num Loop
ELSE
IF (AvailabilityListName /= ' ') THEN
CALL ShowWarningError('GetPlantLoopData/GetPlantAvailabilityManager: AvailabilityManagerAssignmentList='// &
TRIM(AvailabilityListName)//' not found in lists. No availability will be used.')
ENDIF
PlantAvailMgr(Loop)%NumAvailManagers = 0
PlantAvailMgr(Loop)%AvailStatus = NoAction
ALLOCATE(PlantAvailMgr(Loop)%AvailManagerName(PlantAvailMgr(Loop)%NumAvailManagers))
ALLOCATE(PlantAvailMgr(Loop)%AvailManagerType(PlantAvailMgr(Loop)%NumAvailManagers))
ALLOCATE(PlantAvailMgr(Loop)%AvailManagerNum(PlantAvailMgr(Loop)%NumAvailManagers))
END IF
RETURN
END SUBROUTINE GetPlantAvailabilityManager