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 GetOARequirements
! SUBROUTINE INFORMATION:
! AUTHOR R. Raustad - FSEC
! DATE WRITTEN February 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Obtains input data for the OA Requirements object and stores it in
! appropriate data structure.
! METHODOLOGY EMPLOYED:
! Uses InputProcessor "Get" routines to obtain data.
! This object requires only a name where the default values are assumed
! if subsequent fields are not entered.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectDefMaxArgs, GetObjectItem, VerifyName, SameString
USE ScheduleManager, ONLY: GetScheduleIndex, CheckScheduleValueMinMax, GetScheduleMaxValue
USE DataIPShortCuts
USE General, ONLY: RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='GetOARequirements: ' ! include trailing blank space
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: NumAlphas ! Number of Alphas for each GetObjectItem call
INTEGER :: NumNumbers ! Number of Numbers for each GetObjectItem call
INTEGER :: TotalArgs ! Total number of alpha and numeric arguments (max) for a
INTEGER :: IOStatus ! Used in GetObjectItem
INTEGER :: OAIndex
LOGICAL :: ErrorsFound = .false. ! If errors detected in input
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
! REAL(r64) :: CalcAmt
CHARACTER(Len=MaxNameLength) :: CurrentModuleObject ! for ease in getting objects
CHARACTER(Len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: Alphas ! Alpha input items for object
CHARACTER(Len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: cAlphaFields ! Alpha field names
CHARACTER(Len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: cNumericFields ! Numeric field names
REAL(r64), ALLOCATABLE, DIMENSION(:) :: Numbers ! Numeric input items for object
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lAlphaBlanks ! Logical array, alpha field input BLANK = .true.
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lNumericBlanks ! Logical array, numeric field input BLANK = .true.
CurrentModuleObject='DesignSpecification:OutdoorAir'
NumOARequirements = GetNumObjectsFound(CurrentModuleObject)
CALL GetObjectDefMaxArgs(CurrentModuleObject,TotalArgs,NumAlphas,NumNumbers)
ALLOCATE(Alphas(NumAlphas))
Alphas=' '
ALLOCATE(cAlphaFields(NumAlphas))
cAlphaFields=' '
ALLOCATE(cNumericFields(NumNumbers))
cNumericFields=' '
ALLOCATE(Numbers(NumNumbers))
Numbers=0.0d0
ALLOCATE(lAlphaBlanks(NumAlphas))
lAlphaBlanks=.true.
ALLOCATE(lNumericBlanks(NumNumbers))
lNumericBlanks=.true.
IF (NumOARequirements .GT. 0) THEN
ALLOCATE(OARequirements(NumOARequirements))
!Start Loading the System Input
DO OAIndex = 1, NumOARequirements
CALL GetObjectItem(CurrentModuleObject,OAIndex,Alphas,NumAlphas,Numbers,NumNumbers,IOStatus, &
AlphaBlank=lAlphaBlanks,NumBlank=lNumericBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
CALL VerifyName(Alphas(1),OARequirements%Name,OAIndex-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
OARequirements(OAIndex)%Name = Alphas(1)
IF(NumAlphas .GT. 1)THEN
IF (SameString(Alphas(2) , 'Flow/Person')) THEN
OARequirements(OAIndex)%OAFlowMethod = OAFlowPPer
ELSEIF (SameString(Alphas(2), 'Flow/Zone')) THEN
OARequirements(OAIndex)%OAFlowMethod = OAFlow
ELSEIF (SameString(Alphas(2), 'Flow/Area')) THEN
OARequirements(OAIndex)%OAFlowMethod = OAFlowPerArea
ELSEIF (SameString(Alphas(2), 'AirChanges/Hour')) THEN
OARequirements(OAIndex)%OAFlowMethod = OAFlowACH
ELSEIF (SameString(Alphas(2), 'Sum')) THEN
OARequirements(OAIndex)%OAFlowMethod = OAFlowSum
ELSEIF (SameString(Alphas(2), 'Maximum')) THEN
OARequirements(OAIndex)%OAFlowMethod = OAFlowMax
ELSE
CAll ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//'="'//TRIM(OARequirements(OAIndex)%Name)//'",')
CALL ShowContinueError('...Invalid '//TRIM(cAlphaFields(2))//'="'//TRIM(Alphas(2))//'",')
CALL ShowContinueError('...Valid choices are Flow/Person, Flow/Zone, Flow/Area, AirChanges/Hour, Sum, Maximum.')
ErrorsFound=.true.
ENDIF
ELSE
! default value for Outdoor Air Method
OARequirements(OAIndex)%OAFlowMethod = OAFlowPPer
END IF
IF(NumNumbers .GT. 0)THEN
OARequirements(OAIndex)%OAFlowPerPerson = Numbers(1)
ELSE
! default value for Outdoor Air Flow per Person
OARequirements(OAIndex)%OAFlowPerPerson = 0.00944D0
END IF
! remaining fields default to 0
IF(NumNumbers .GT. 1)THEN
OARequirements(OAIndex)%OAFlowPerArea = Numbers(2)
END IF
IF(NumNumbers .GT. 2)THEN
OARequirements(OAIndex)%OAFlowPerZone = Numbers(3)
END IF
IF(NumNumbers .GT. 3)THEN
OARequirements(OAIndex)%OAFlowACH = Numbers(4)
END IF
IF(NumAlphas .GT. 2)THEN
IF(.NOT. lAlphaBlanks(3))THEN
OARequirements(OAIndex)%OAFlowFracSchPtr = GetScheduleIndex(Alphas(3))
IF(OARequirements(OAIndex)%OAFlowFracSchPtr .GT. 0) THEN
IF (.NOT.CheckScheduleValueMinMax(OARequirements(OAIndex)%OAFlowFracSchPtr,'>=',0.0D0,'<=',1.0D0)) THEN
CAll ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//'="'//TRIM(OARequirements(OAIndex)%Name)//'",')
CALL ShowContinueError('Error found in '//TRIM(cAlphaFields(3))//' = '//TRIM(Alphas(3)) )
CALL ShowContinueError('Schedule values must be (>=0., <=1.)')
ErrorsFound=.true.
ELSE
OARequirements(OAIndex)%MaxOAFractionSchValue = GetScheduleMaxValue(OARequirements(OAIndex)%OAFlowFracSchPtr)
END IF
ELSE
CAll ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//'="'//TRIM(OARequirements(OAIndex)%Name)//'",')
CALL ShowContinueError('...Not Found '//TRIM(cAlphaFields(3))//'="'//TRIM(Alphas(3))//'".')
ErrorsFound=.TRUE.
END IF
END IF
END IF
END DO
DEALLOCATE(Alphas)
DEALLOCATE(cAlphaFields)
DEALLOCATE(cNumericFields)
DEALLOCATE(Numbers)
DEALLOCATE(lAlphaBlanks)
DEALLOCATE(lNumericBlanks)
IF (ErrorsFound) THEN
CALL ShowFatalError(RoutineName//'Errors found in input. Preceding condition(s) cause termination.')
ENDIF
ENDIF
RETURN
END SUBROUTINE GetOARequirements