SUBROUTINE GetSysAvailManagerInputs
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN August 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Obtains input data for System Availability Managers and stores it in
! appropriate data structures.
! METHODOLOGY EMPLOYED:
! Uses InputProcessor "Get" routines to obtain data.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, FindIteminList, SameString, &
MakeUPPERCase, GetObjectDefMaxArgs
USE NodeInputManager, ONLY: GetOnlySingleNode, MarkNode
USE DataHeatBalance, ONLY: Zone, ZoneList, NumOfZoneLists
USE DataLoopNode
USE DataZoneEquipment, ONLY: NumValidSysAvailZoneComponents, cValidSysAvailManagerCompTypes
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='GetSysAvailManagerInputs: ' ! include trailing blank
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength+40),ALLOCATABLE, DIMENSION(:) :: cAlphaFieldNames
CHARACTER(len=MaxNameLength+40),ALLOCATABLE, DIMENSION(:) :: cNumericFieldNames
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lNumericFieldBlanks
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lAlphaFieldBlanks
CHARACTER(len=MaxNameLength),ALLOCATABLE, DIMENSION(:) :: cAlphaArgs
REAL(r64),ALLOCATABLE, DIMENSION(:) :: rNumericArgs
CHARACTER(len=MaxNameLength) :: cCurrentModuleObject
INTEGER :: NumAlphas ! Number of Alphas for each GetObjectItem call
INTEGER :: NumNumbers ! Number of Numbers for each GetObjectItem call
INTEGER :: maxAlphas ! maximum number of alphas for this set of objects
INTEGER :: maxNumbers ! maximum number of numbers for this set of objects
INTEGER :: numArgs ! maximum number of arguments for this set of objects
INTEGER :: IOStatus ! Used in GetObjectItem
LOGICAL :: ErrorsFound=.FALSE. ! Set to true if errors in input, fatal at end of routine
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
INTEGER :: SysAvailNum ! DO loop index for all System Availability Managers
INTEGER :: CyclingTimeSteps
INTEGER :: ZoneEquipType
INTEGER :: TotalNumComp
INTEGER :: ZoneListNum
INTEGER :: ZoneNumInList
! Get the number of occurences of each type of manager and read in data
cCurrentModuleObject = 'AvailabilityManager:Scheduled'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=NumNumbers
maxAlphas=NumAlphas
cCurrentModuleObject = 'AvailabilityManager:ScheduledOn'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:ScheduledOff'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:NightCycle'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:DifferentialThermostat'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:HighTemperatureTurnOff'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:HighTemperatureTurnOn'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:LowTemperatureTurnOff'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:LowTemperatureTurnOn'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:NightVentilation'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
cCurrentModuleObject = 'AvailabilityManager:OptimumStart'
CALL GetObjectDefMaxArgs(cCurrentModuleObject,numArgs,NumAlphas,NumNumbers)
maxNumbers=MAX(maxNumbers,NumNumbers)
maxAlphas=MAX(maxAlphas,NumAlphas)
ALLOCATE(cAlphaFieldNames(maxAlphas))
cAlphaFieldNames=' '
ALLOCATE(cAlphaArgs(maxAlphas))
cAlphaArgs=' '
ALLOCATE(lAlphaFieldBlanks(maxAlphas))
lAlphaFieldBlanks=.false.
ALLOCATE(cNumericFieldNames(maxNumbers))
cNumericFieldNames=' '
ALLOCATE(rNumericArgs(maxNumbers))
rNumericArgs=0.0d0
ALLOCATE(lNumericFieldBlanks(maxNumbers))
lNumericFieldBlanks=.false.
IF (.not. ALLOCATED(ZoneComp)) THEN
ALLOCATE(ZoneComp(NumValidSysAvailZoneComponents))
ENDIF
DO ZoneEquipType = 1, NumValidSysAvailZoneComponents
IF (.not. ALLOCATED(ZoneComp(ZoneEquipType)%ZoneCompAvailMgrs)) THEN
TotalNumComp = GetNumObjectsFound(cValidSysAvailManagerCompTypes(ZoneEquipType))
ZoneComp(ZoneEquipType)%TotalNumComp = TotalNumComp
IF (TotalNumComp .GT. 0) THEN
ALLOCATE(ZoneComp(ZoneEquipType)%ZoneCompAvailMgrs(TotalNumComp))
ENDIF
ENDIF
ENDDO
cCurrentModuleObject = 'AvailabilityManager:Scheduled'
NumSchedSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumSchedSysAvailMgrs > 0)THEN
ALLOCATE(SchedSysAvailMgrData(NumSchedSysAvailMgrs))
DO SysAvailNum = 1,NumSchedSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),SchedSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
SchedSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
SchedSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_Scheduled
SchedSysAvailMgrData(SysAvailNum)%SchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (SchedSysAvailMgrData(SysAvailNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
ErrorsFound = .TRUE.
END IF
CALL SetupOutputVariable('Availability Manager Scheduled Control Status []', &
SchedSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',SchedSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:ScheduledOn'
NumSchedOnSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumSchedOnSysAvailMgrs > 0)THEN
ALLOCATE(SchedOnSysAvailMgrData(NumSchedOnSysAvailMgrs))
DO SysAvailNum = 1,NumSchedOnSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),SchedOnSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
SchedOnSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
SchedOnSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_ScheduledOn
SchedOnSysAvailMgrData(SysAvailNum)%SchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (SchedOnSysAvailMgrData(SysAvailNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//' = "'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
ErrorsFound = .TRUE.
END IF
CALL SetupOutputVariable('Availability Manager Scheduled On Control Status []', &
SchedOnSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',SchedOnSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:ScheduledOff'
NumSchedOffSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumSchedOffSysAvailMgrs > 0)THEN
ALLOCATE(SchedOffSysAvailMgrData(NumSchedOffSysAvailMgrs))
DO SysAvailNum = 1,NumSchedOffSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),SchedOffSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
SchedOffSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
SchedOffSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_ScheduledOff
SchedOffSysAvailMgrData(SysAvailNum)%SchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (SchedOffSysAvailMgrData(SysAvailNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//' = "'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
ErrorsFound = .TRUE.
END IF
CALL SetupOutputVariable('Availability Manager Scheduled Off Control Status []', &
SchedOffSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',SchedOffSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:NightCycle'
NumNCycSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
CyclingTimeSteps = 0
IF(NumNCycSysAvailMgrs > 0)THEN
ALLOCATE(NCycSysAvailMgrData(NumNCycSysAvailMgrs))
DO SysAvailNum = 1,NumNCycSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),NCycSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
NCycSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
NCycSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_NightCycle
NCycSysAvailMgrData(SysAvailNum)%TempTolRange = rNumericArgs(1)
CyclingTimeSteps = NINT( (rNumericArgs(2)/SecInHour)*REAL(NumOfTimeStepInHour,r64) )
CyclingTimeSteps = MAX(1, CyclingTimeSteps)
NCycSysAvailMgrData(SysAvailNum)%CyclingTimeSteps = CyclingTimeSteps
NCycSysAvailMgrData(SysAvailNum)%SchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (NCycSysAvailMgrData(SysAvailNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//' = "'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
ErrorsFound = .TRUE.
END IF
NCycSysAvailMgrData(SysAvailNum)%FanSched = cAlphaArgs(3)
NCycSysAvailMgrData(SysAvailNum)%FanSchedPtr = GetScheduleIndex(cAlphaArgs(3))
IF (NCycSysAvailMgrData(SysAvailNum)%FanSchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//' = "'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(3))//'="'//TRIM(cAlphaArgs(3))//'".')
ErrorsFound = .TRUE.
END IF
SELECT CASE(MakeUPPERCase(cAlphaArgs(4)))
CASE('STAYOFF')
NCycSysAvailMgrData(SysAvailNum)%CtrlType = StayOff
CASE('CYCLEONANY')
NCycSysAvailMgrData(SysAvailNum)%CtrlType = CycleOnAny
CASE('CYCLEONCONTROLZONE')
NCycSysAvailMgrData(SysAvailNum)%CtrlType = CycleOnControlZone
CASE('CYCLEONANYZONEFANSONLY')
NCycSysAvailMgrData(SysAvailNum)%CtrlType = ZoneFansOnly
CASE DEFAULT
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowSevereError(RoutineName//'incorrect value: '//TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'".')
ErrorsFound=.TRUE.
END SELECT
IF (NCycSysAvailMgrData(SysAvailNum)%CtrlType .EQ. CycleOnControlZone) THEN
NCycSysAvailMgrData(SysAvailNum)%CtrlZoneName = cAlphaArgs(5)
NCycSysAvailMgrData(SysAvailNum)%ZoneNum = FindItemInList(cAlphaArgs(5),Zone%Name,NumOfZones)
IF (NCycSysAvailMgrData(SysAvailNum)%ZoneNum .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowSevereError('not found: '//TRIM(cAlphaFieldNames(5))//'="'//TRIM(cAlphaArgs(5))//'".')
ErrorsFound = .TRUE.
END IF
END IF
CALL SetupOutputVariable('Availability Manager Night Cycle Control Status []', &
NCycSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',NCycSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:OptimumStart'
NumOptStartSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
CyclingTimeSteps = 0
IF(NumOptStartSysAvailMgrs > 0)THEN
! Array size of variable type OptStartSysAvailMgrData is updated
ALLOCATE(OptStartSysAvailMgrData(NumOptStartSysAvailMgrs))
DO SysAvailNum = 1,NumOptStartSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),OptStartSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
OptStartSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
OptStartSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_OptimumStart
OptStartSysAvailMgrData(SysAvailNum)%SchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (OptStartSysAvailMgrData(SysAvailNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//' = "'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
ErrorsFound = .TRUE.
END IF
OptStartSysAvailMgrData(SysAvailNum)%FanSched = cAlphaArgs(3)
OptStartSysAvailMgrData(SysAvailNum)%FanSchedPtr = GetScheduleIndex(cAlphaArgs(3))
IF (OptStartSysAvailMgrData(SysAvailNum)%FanSchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//' = "'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(3))//'="'//TRIM(cAlphaArgs(3))//'".')
ErrorsFound = .TRUE.
END IF
OptStartSysAvailMgrData(SysAvailNum)%MaxOptStartTime = rNumericArgs(1)
SELECT CASE(MakeUPPERCase(TRIM(cAlphaArgs(4))))
CASE('STAYOFF')
OptStartSysAvailMgrData(SysAvailNum)%CtrlType = StayOff
CASE('CONTROLZONE')
OptStartSysAvailMgrData(SysAvailNum)%CtrlType = ControlZone
CASE('MAXIMUMOFZONELIST')
OptStartSysAvailMgrData(SysAvailNum)%CtrlType = MaximumOfZoneList
CASE DEFAULT
OptStartSysAvailMgrData(SysAvailNum)%CtrlType = ControlZone
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowSevereError(RoutineName//'incorrect value: '//TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'".')
ErrorsFound=.TRUE.
END SELECT
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlType .EQ. ControlZone) THEN
OptStartSysAvailMgrData(SysAvailNum)%CtrlZoneName = cAlphaArgs(5)
OptStartSysAvailMgrData(SysAvailNum)%ZoneNum = FindItemInList(cAlphaArgs(5),Zone%Name,NumOfZones)
IF (OptStartSysAvailMgrData(SysAvailNum)%ZoneNum .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowSevereError('not found: '//TRIM(cAlphaFieldNames(5))//'="'//TRIM(cAlphaArgs(5))//'".')
ErrorsFound = .TRUE.
END IF
END IF
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlType .EQ. MaximumOfZoneList) THEN
OptStartSysAvailMgrData(SysAvailNum)%ZoneListName = cAlphaArgs(6)
Do ZoneListNum=1, NumOfZoneLists
IF (ZoneList(ZoneListNum)%Name == cAlphaArgs(6)) THEN
OptStartSysAvailMgrData(SysAvailNum)%NumOfZones=ZoneList(ZoneListNum)%NumOfZones
ALLOCATE(OptStartSysAvailMgrData(SysAvailNum)%ZonePtrs(ZoneList(ZoneListNum)%NumOfZones))
DO ZoneNumInList=1, ZoneList(ZoneListNum)%NumOfZones
OptStartSysAvailMgrData(SysAvailNum)%ZonePtrs(ZoneNumInList)= &
ZoneList(ZoneListNum)%Zone(ZoneNumInList)
END DO
END IF
END DO
OptStartSysAvailMgrData(SysAvailNum)%NumOfZones = FindItemInList(cAlphaArgs(6),ZoneList%Name,NumOfZoneLists)
IF (OptStartSysAvailMgrData(SysAvailNum)%NumOfZones .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowSevereError('not found: '//TRIM(cAlphaFieldNames(6))//'="'//TRIM(cAlphaArgs(6))//'".')
ErrorsFound = .TRUE.
END IF
END IF
SELECT CASE(MakeUPPERCase(TRIM(cAlphaArgs(7))))
CASE('CONSTANTTEMPERATUREGRADIENT')
OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType = ConstantTemperatureGradient
CASE('ADAPTIVETEMPERATUREGRADIENT')
OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType = AdaptiveTemperatureGradient
CASE('ADAPTIVEASHRAE')
OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType = AdaptiveASHRAE
CASE('CONSTANTSTARTTIME')
OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType = ConstantStartTime
CASE DEFAULT
OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType = AdaptiveASHRAE
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowSevereError(RoutineName//'incorrect value: '//TRIM(cAlphaFieldNames(7))//'="'//TRIM(cAlphaArgs(7))//'".')
ErrorsFound=.TRUE.
END SELECT
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType .EQ. ConstantTemperatureGradient) THEN
OptStartSysAvailMgrData(SysAvailNum)%ConstTGradCool = rNumericArgs(2)
END IF
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType .EQ. ConstantTemperatureGradient) THEN
OptStartSysAvailMgrData(SysAvailNum)%ConstTGradHeat = rNumericArgs(3)
END IF
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType .EQ. AdaptiveTemperatureGradient) THEN
OptStartSysAvailMgrData(SysAvailNum)%InitTGradCool = rNumericArgs(4)
END IF
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType .EQ. AdaptiveTemperatureGradient) THEN
OptStartSysAvailMgrData(SysAvailNum)%InitTGradHeat = rNumericArgs(5)
END IF
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType .EQ. ConstantStartTime) THEN
OptStartSysAvailMgrData(SysAvailNum)%ConstStartTime = rNumericArgs(6)
END IF
IF (OptStartSysAvailMgrData(SysAvailNum)%CtrlAlgType .EQ. AdaptiveTemperatureGradient) THEN
OptStartSysAvailMgrData(SysAvailNum)%NumPreDays = rNumericArgs(7)
END IF
CALL SetupOutputVariable('Availability Manager Optimum Start Control Status []', &
OptStartSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',OptStartSysAvailMgrData(SysAvailNum)%Name)
! add
CALL SetupOutputVariable('Availability Manager Optimum Start Hours Before Occupancy []', &
OptStartSysAvailMgrData(SysAvailNum)%NumHoursBeforeOccupancy, &
'System','Average',OptStartSysAvailMgrData(SysAvailNum)%Name, 'Daily')
END DO
END IF
cCurrentModuleObject = 'AvailabilityManager:DifferentialThermostat'
NumDiffTSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumDiffTSysAvailMgrs > 0)THEN
ALLOCATE(DiffTSysAvailMgrData(NumDiffTSysAvailMgrs))
DO SysAvailNum = 1,NumDiffTSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),DiffTSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
DiffTSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
DiffTSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_DiffThermo
DiffTSysAvailMgrData(SysAvailNum)%HotNode = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Unknown,NodeConnectionType_Sensor,1,ObjectIsNotParent)
CALL MarkNode(DiffTSysAvailMgrData(SysAvailNum)%HotNode,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
'Hot Node')
DiffTSysAvailMgrData(SysAvailNum)%ColdNode = &
GetOnlySingleNode(cAlphaArgs(3),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Unknown,NodeConnectionType_Sensor,1,ObjectIsNotParent)
CALL MarkNode(DiffTSysAvailMgrData(SysAvailNum)%ColdNode,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
'Cold Node')
DiffTSysAvailMgrData(SysAvailNum)%TempDiffOn = rNumericArgs(1)
IF (NumNumbers > 1) THEN
DiffTSysAvailMgrData(SysAvailNum)%TempDiffOff = rNumericArgs(2)
ELSE
DiffTSysAvailMgrData(SysAvailNum)%TempDiffOff = DiffTSysAvailMgrData(SysAvailNum)%TempDiffOn
END IF
IF (DiffTSysAvailMgrData(SysAvailNum)%TempDiffOff > DiffTSysAvailMgrData(SysAvailNum)%TempDiffOn) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//' = "'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('The '//TRIM(cNumericFieldNames(2))//' is greater than the '//TRIM(cNumericFieldNames(1))//'.')
ErrorsFound = .TRUE.
END IF
CALL SetupOutputVariable('Availability Manager Differential Thermostat Control Status []', &
DiffTSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',DiffTSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:HighTemperatureTurnOff'
NumHiTurnOffSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumHiTurnOffSysAvailMgrs > 0)THEN
ALLOCATE(HiTurnOffSysAvailMgrData(NumHiTurnOffSysAvailMgrs))
DO SysAvailNum = 1,NumHiTurnOffSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),HiTurnOffSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
HiTurnOffSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
HiTurnOffSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_HiTempTOff
HiTurnOffSysAvailMgrData(SysAvailNum)%Node = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Unknown,NodeConnectionType_Sensor,1,ObjectIsNotParent)
CALL MarkNode(HiTurnOffSysAvailMgrData(SysAvailNum)%Node,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
'Sensor Node')
HiTurnOffSysAvailMgrData(SysAvailNum)%Temp = rNumericArgs(1)
CALL SetupOutputVariable('Availability Manager High Temperature Turn Off Control Status []', &
HiTurnOffSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',HiTurnOffSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:HighTemperatureTurnOn'
NumHiTurnOnSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumHiTurnOnSysAvailMgrs > 0)THEN
ALLOCATE(HiTurnOnSysAvailMgrData(NumHiTurnOnSysAvailMgrs))
DO SysAvailNum = 1,NumHiTurnOnSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),HiTurnOnSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
HiTurnOnSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
HiTurnOnSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_HiTempTOn
HiTurnOnSysAvailMgrData(SysAvailNum)%Node = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Unknown,NodeConnectionType_Sensor,1,ObjectIsNotParent)
CALL MarkNode(HiTurnOnSysAvailMgrData(SysAvailNum)%Node,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
'Sensor Node')
HiTurnOnSysAvailMgrData(SysAvailNum)%Temp = rNumericArgs(1)
CALL SetupOutputVariable('Availability Manager High Temperature Turn On Control Status []', &
HiTurnOnSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',HiTurnOnSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:LowTemperatureTurnOff'
NumLoTurnOffSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumLoTurnOffSysAvailMgrs > 0)THEN
ALLOCATE(LoTurnOffSysAvailMgrData(NumLoTurnOffSysAvailMgrs))
DO SysAvailNum = 1,NumLoTurnOffSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),LoTurnOffSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
LoTurnOffSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
LoTurnOffSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_LoTempTOff
LoTurnOffSysAvailMgrData(SysAvailNum)%Node = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Unknown,NodeConnectionType_Sensor,1,ObjectIsNotParent)
CALL MarkNode(LoTurnOffSysAvailMgrData(SysAvailNum)%Node,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
'Sensor Node')
LoTurnOffSysAvailMgrData(SysAvailNum)%Temp = rNumericArgs(1)
IF (.NOT. lAlphaFieldBlanks(3)) THEN
LoTurnOffSysAvailMgrData(SysAvailNum)%SchedPtr = GetScheduleIndex(cAlphaArgs(3))
IF (LoTurnOffSysAvailMgrData(SysAvailNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cAlphaFieldNames(3))//'="'//TRIM(cAlphaArgs(3))//'" not found.')
CALL ShowContinueError('Occurs in '//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'".')
ErrorsFound = .TRUE.
END IF
ELSE
LoTurnOffSysAvailMgrData(SysAvailNum)%SchedPtr = 0
END IF
CALL SetupOutputVariable('Availability Manager Low Temperature Turn Off Control Status []', &
LoTurnOffSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',LoTurnOffSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:LowTemperatureTurnOn'
NumLoTurnOnSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumLoTurnOnSysAvailMgrs > 0)THEN
ALLOCATE(LoTurnOnSysAvailMgrData(NumLoTurnOnSysAvailMgrs))
DO SysAvailNum = 1,NumLoTurnOnSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),LoTurnOnSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
LoTurnOnSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
LoTurnOnSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_LoTempTOn
LoTurnOnSysAvailMgrData(SysAvailNum)%Node = &
GetOnlySingleNode(cAlphaArgs(2),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Unknown,NodeConnectionType_Sensor,1,ObjectIsNotParent)
CALL MarkNode(LoTurnOnSysAvailMgrData(SysAvailNum)%Node,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
'Sensor Node')
LoTurnOnSysAvailMgrData(SysAvailNum)%Temp = rNumericArgs(1)
CALL SetupOutputVariable('Availability Manager Low Temperature Turn On Control Status []', &
LoTurnOnSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',LoTurnOnSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
cCurrentModuleObject = 'AvailabilityManager:NightVentilation'
NumNVentSysAvailMgrs = GetNumObjectsFound(cCurrentModuleObject)
IF(NumNVentSysAvailMgrs > 0)THEN
ALLOCATE(NVentSysAvailMgrData(NumNVentSysAvailMgrs))
DO SysAvailNum = 1,NumNVentSysAvailMgrs
CALL GetObjectItem(cCurrentModuleObject,SysAvailNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK=.FALSE.
IsBlank=.FALSE.
CALL VerifyName(cAlphaArgs(1),NVentSysAvailMgrData%Name,SysAvailNum-1,IsNotOK,IsBlank,&
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.TRUE.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
NVentSysAvailMgrData(SysAvailNum)%Name = cAlphaArgs(1)
NVentSysAvailMgrData(SysAvailNum)%MgrType = SysAvailMgr_NightVent
NVentSysAvailMgrData(SysAvailNum)%SchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (NVentSysAvailMgrData(SysAvailNum)%SchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
ErrorsFound = .TRUE.
END IF
NVentSysAvailMgrData(SysAvailNum)%FanSched = cAlphaArgs(3)
NVentSysAvailMgrData(SysAvailNum)%FanSchedPtr = GetScheduleIndex(cAlphaArgs(3))
IF (NVentSysAvailMgrData(SysAvailNum)%FanSchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(3))//'="'//TRIM(cAlphaArgs(3))//'".')
ErrorsFound = .TRUE.
END IF
NVentSysAvailMgrData(SysAvailNum)%VentTempSched = cAlphaArgs(4)
NVentSysAvailMgrData(SysAvailNum)%VentTempSchedPtr = GetScheduleIndex(cAlphaArgs(4))
IF (NVentSysAvailMgrData(SysAvailNum)%VentTempSchedPtr .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(4))//'="'//TRIM(cAlphaArgs(4))//'".')
ErrorsFound = .TRUE.
END IF
NVentSysAvailMgrData(SysAvailNum)%VentDelT = rNumericArgs(1)
NVentSysAvailMgrData(SysAvailNum)%VentTempLowLim = rNumericArgs(2)
NVentSysAvailMgrData(SysAvailNum)%VentFlowFrac = rNumericArgs(3)
NVentSysAvailMgrData(SysAvailNum)%CtrlZoneName = cAlphaArgs(5)
NVentSysAvailMgrData(SysAvailNum)%ZoneNum = FindItemInList(cAlphaArgs(5),Zone%Name,NumOfZones)
IF (NVentSysAvailMgrData(SysAvailNum)%ZoneNum .EQ. 0) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", invalid')
CALL ShowContinueError('not found: '//TRIM(cAlphaFieldNames(5))//'="'//TRIM(cAlphaArgs(5))//'".')
ErrorsFound = .TRUE.
END IF
CALL SetupOutputVariable('Availability Manager Night Ventilation Control Status []', &
NVentSysAvailMgrData(SysAvailNum)%AvailStatus, &
'System','Average',NVentSysAvailMgrData(SysAvailNum)%Name)
END DO ! SysAvailNum
END IF
DEALLOCATE(cAlphaFieldNames)
DEALLOCATE(cAlphaArgs)
DEALLOCATE(lAlphaFieldBlanks)
DEALLOCATE(cNumericFieldNames)
DEALLOCATE(rNumericArgs)
DEALLOCATE(lNumericFieldBlanks)
IF (ErrorsFound) THEN
CALL ShowFatalError(RoutineName//'Errors found in input. Preceding condition(s) cause termination.')
END IF
RETURN
END SUBROUTINE GetSysAvailManagerInputs