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 FindRangeBasedOrUncontrolledInput(CurrentModuleObject,NumSchemes,LoopNum,SchemeNum,ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher
! DATE WRITTEN July 2010
! MODIFIED Chandan Sharma, August 2010
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Load range based or uncontrolled input into PLANTLOOP data structure
! METHODOLOGY EMPLOYED:
! calls the Input Processor to retrieve data from input file.
! The format of the Energy+.idd (the EnergyPlus input data dictionary) for the
! following keywords is reflected exactly in this subroutine:
! PlantEquipmentOperation:CoolingLoad
! PlantEquipmentOperation:HeatingLoad
! PlantEquipmentOperation:OutdoorDryBulb
! PlantEquipmentOperation:OutdoorWetBulb
! PlantEquipmentOperation:OutdoorDewPoint
! PlantEquipmentOperation:OutdoorRelativeHumidity
! PlantEquipmentOperation:Uncontrolled
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: GetObjectItem, SameString, GetObjectDefMaxArgs
USE General, ONLY: RoundSigDigits
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound ! 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
INTEGER, INTENT(IN) :: NumSchemes ! May be set here and passed on
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! for ease in renaming
! 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 :: IOSTAT
CHARACTER(Len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: AlphArray ! 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(:) :: NumArray ! 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.
INTEGER :: TotalArgs=0 ! Total number of alpha and numeric arguments (max) for a
! certain object in the input file
INTEGER :: Num
INTEGER :: NumEquipLists
INTEGER :: ListNum
CHARACTER(len=MaxNameLength) :: LoopOpSchemeObj ! Used to identify the object name for loop equipment operation scheme
LOGICAL :: SchemeNameFound ! Set to FALSE if a match of OpScheme object and OpScheme name is not found
INTEGER :: InnerListNum !inner loop list number
REAL(r64) :: OuterListNumLowerLimit
REAL(r64) :: OuterListNumUpperLimit
REAL(r64) :: InnerListNumLowerLimit
REAL(r64) :: InnerListNumUpperLimit
SchemeNameFound = .TRUE.
! Determine max number of alpha and numeric arguments for all objects being read, in order to allocate local arrays
CALL GetObjectDefMaxArgs(CurrentModuleObject,TotalArgs,NumAlphas,NumNums)
ALLOCATE(AlphArray(NumAlphas))
AlphArray=' '
ALLOCATE(cAlphaFields(NumAlphas))
cAlphaFields=' '
ALLOCATE(cNumericFields(NumNums))
cNumericFields=' '
ALLOCATE(NumArray(NumNums))
NumArray=0.0d0
ALLOCATE(lAlphaBlanks(NumAlphas))
lAlphaBlanks=.TRUE.
ALLOCATE(lNumericBlanks(NumNums))
lNumericBlanks=.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, &
AlphArray,NumAlphas,NumArray,NumNums,IOSTAT)
IF(SameString(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name,AlphArray(1))) EXIT
IF (Num == NumSchemes) THEN
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 = (NumAlphas-1)
IF (PlantLoop(LoopNum)%OpScheme(SchemeNum)%NumEquipLists <= 0) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(AlphArray(1))// &
'", specified without equipment list.')
ErrorsFound = .true.
ELSE
ALLOCATE (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList &
(PlantLoop(LoopNum)%OpScheme(SchemeNum)%NumEquipLists))
NumEquipLists = PlantLoop(LoopNum)%OpScheme(SchemeNum)%NumEquipLists
IF (NumNums .LE. 0) THEN ! Uncontrolled OpScheme type
ListNum = NumEquipLists ! NumEquipLists is always 1 for Uncontrolled OpScheme type
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%name = AlphArray(2)
CALL LoadEquipList(LoopNum,SchemeNum,ListNum,ErrorsFound)
ELSE ! Range based OpScheme type
DO ListNum = 1, NumEquipLists
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeLowerLimit = NumArray(ListNum*2-1)
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeUpperLimit = NumArray(ListNum*2)
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%name = AlphArray(ListNum+1)
IF (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeUpperLimit < 0.d0) THEN
CALL ShowSevereError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", found a negative value for an upper limit in '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
SELECT CASE (TRIM(CurrentModuleObject)) ! different op schemes have different lower limit check values
CASE ('PlantEquipmentOperation:CoolingLoad','PlantEquipmentOperation:HeatingLoad', &
'PlantEquipmentOperation:OutdoorrelativeHumidity')
! these should not be less than zero
IF (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeLowerLimit < 0.d0) THEN
CALL ShowSevereError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", found a negative value for a lower limit in '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
CASE DEFAULT
! others should not be less than -70
IF (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeLowerLimit < -70.d0) THEN
CALL ShowSevereError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", found too low of a value for a lower limit in '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
END SELECT
IF (PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeLowerLimit > &
PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeUpperLimit ) THEN
CALL ShowSevereError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", found a lower limit that is higher than an upper limit in '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
CALL LoadEquipList(LoopNum,SchemeNum,ListNum,ErrorsFound)
END DO
! now run through lists again and check that range limits do not overlap each other
DO ListNum = 1, NumEquipLists
OuterListNumLowerLimit = PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeLowerLimit
OuterListNumUpperLimit = PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(ListNum)%RangeUpperLimit
DO InnerListNum = 1, NumEquipLists
IF (InnerListNum == ListNum) CYCLE ! don't check against self.
InnerListNumLowerLimit = PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(InnerListNum)%RangeLowerLimit
InnerListNumUpperLimit = PlantLoop(LoopNum)%OpScheme(SchemeNum)%EquipList(InnerListNum)%RangeUpperLimit
! Check if inner list has a lower limit that is between an outer's lower and upper limit
IF ( InnerListNumLowerLimit > OuterListNumLowerLimit .AND. InnerListNumLowerLimit < OuterListNumUpperLimit ) THEN
CALL ShowWarningError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", detected overlapping ranges in '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
CALL ShowContinueError('Range # '//Trim(RoundSigDigits(InnerListNum,0))//' Lower limit = ' &
//TRIM(RoundSigDigits(InnerListNumLowerLimit,1)) // &
' lies within the Range # '//TRIM(RoundSigDigits(ListNum,1)) &
//' ('//TRIM(RoundSigDigits(OuterListNumLowerLimit,1))//' to ' &
//TRIM(RoundSigDigits(OuterListNumUpperLimit ,1)) // &
').')
CALL ShowContinueError('Check that input for load range limit values do not overlap, ' &
// 'and the simulation continues...')
ENDIF
! Check if inner list has an upper limit that is between an outer's lower and upper limit
IF ( InnerListNumUpperLimit > OuterListNumLowerLimit .AND. InnerListNumUpperLimit < OuterListNumUpperLimit ) THEN
CALL ShowWarningError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", detected overlapping ranges in '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
CALL ShowContinueError('Range # '//Trim(RoundSigDigits(InnerListNum,0))//' Upper limit = '&
//TRIM(RoundSigDigits(InnerListNumUpperLimit,1)) // &
' lies within Range # '//TRIM(RoundSigDigits(ListNum,1)) &
// ' ('//TRIM(RoundSigDigits(OuterListNumLowerLimit,1))//' to ' &
//TRIM(RoundSigDigits(OuterListNumUpperLimit ,1)) // &
').')
CALL ShowContinueError('Check that input for load range limit values do not overlap, ' &
// 'and the simulation continues...')
ENDIF
ENDDO
ENDDO
ENDIF
ENDIF
ENDIF
ELSE
CALL ShowSevereError(TRIM(LoopOpSchemeObj)//' = "'//TRIM(PlantLoop(LoopNum)%OperationScheme)// &
'", could not find '// &
TRIM(CurrentModuleObject)//' = "'//TRIM(PlantLoop(LoopNum)%OpScheme(SchemeNum)%Name)//'".')
ErrorsFound=.true.
ENDIF
DEALLOCATE(AlphArray)
DEALLOCATE(cAlphaFields)
DEALLOCATE(cNumericFields)
DEALLOCATE(NumArray)
DEALLOCATE(lAlphaBlanks)
DEALLOCATE(lNumericBlanks)
RETURN
END SUBROUTINE FindRangeBasedOrUncontrolledInput