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 | ||
---|---|---|---|---|---|---|
logical, | intent(inout) | :: | ErrFlag |
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 GetRoomAirModelParameters(ErrFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN August 2001
! MODIFIED na
! RE-ENGINEERED April 2003, Weixiu Kong
! December 2003, CC
! PURPOSE OF THIS SUBROUTINE:
! Get room air model parameters for all zones at once
! METHODOLOGY EMPLOYED:
! Use input processer to get input from idf file
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY : GetNumObjectsFound, GetObjectItem, FindItemInList
USE DataIPShortCuts
USE DataGlobals, ONLY : NumOfZones, MaxNameLength
USE DataInterfaces, ONLY : ShowWarningError
USE DataHeatBalance, ONLY : Zone
USE DataRoomAirModel, ONLY : AirModel, RoomAirModel_Mixing, RoomAirModel_Mundt, RoomAirModel_UCSDDV, &
RoomAirModel_UCSDCV, DirectCoupling, IndirectCoupling, MundtModelUsed, &
UCSDModelUsed, ChAirModel, UserDefinedUsed, RoomAirModel_UserDefined, &
RoomAirModel_UCSDUFI, RoomAirModel_UCSDUFE
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrFlag ! True if errors found during this input routine
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(Len=*), PARAMETER :: Blank = ' '
CHARACTER(len=*), PARAMETER :: RoomAirHeader= &
"('! <RoomAir Model>, Zone Name, Mixing/Mundt/UCSDDV/UCSDCV/UCSDUFI/UCSDUFE/User Defined')"
CHARACTER(len=*), PARAMETER :: RoomAirZoneFmt="('RoomAir Model,',A,',',A)"
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: NumAlphas ! States which alpha value to read from a
! "Number" line
INTEGER :: NumNumbers ! Number of numbers encountered
INTEGER :: Status ! Notes if there was an error in processing the input
INTEGER :: AirModelNum
INTEGER :: NumOfAirModels
INTEGER :: ZoneNum
LOGICAL :: ErrorsFound
LOGICAL :: IsNotOK
! FLOW:
! Initialize default values for air model parameters
ALLOCATE (AirModel(NumOfZones))
ErrorsFound=.FALSE.
cCurrentModuleObject = 'RoomAirModelType'
NumOfAirModels = GetNumObjectsFound(cCurrentModuleObject)
IF (NumOfAirModels.GT.NumOfZones) THEN
CALL ShowSevereError('Too many '//TRIM(cCurrentModuleObject)//'. Cannot exceed the number of Zones.')
ErrorsFound=.TRUE.
END IF
DO AirModelNum=1,NumOfAirModels
CALL GetObjectItem(cCurrentModuleObject,AirModelNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,Status, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
ZoneNum=FindItemInList(cAlphaArgs(2),Zone%Name,NumOfZones)
IF (ZoneNum /= 0) THEN
IF (AirModel(ZoneNum)%AirModelName /= Blank) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)) )
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) )
CALL ShowContinueError('Duplicate zone name, only one type of roomair model is allowed per zone' )
CALL ShowContinueError('Zone '//TRIM(cAlphaArgs(2))//' was already assigned a roomair model by '// &
TRIM(cCurrentModuleObject)//' = '//TRIM(AirModel(ZoneNum)%AirModelName))
CALL ShowContinueError('Air Model Type for zone already set to '//TRIM(ChAirModel(AirModel(ZoneNum)%AirModelType)))
CALL ShowContinueError('Trying to overwrite with model type = '//TRIM(cAlphaArgs(3)))
ErrorsFound=.TRUE.
ENDIF
AirModel(ZoneNum)%AirModelName = cAlphaArgs(1)
AirModel(ZoneNum)%ZoneName = cAlphaArgs(2)
SELECT CASE (cAlphaArgs(3))
CASE ('MIXING')
AirModel(ZoneNum)%AirModelType = RoomAirModel_Mixing
CASE ('ONENODEDISPLACEMENTVENTILATION')
AirModel(ZoneNum)%AirModelType = RoomAirModel_Mundt
AirModel(ZoneNum)%SimAirModel = .TRUE.
MundtModelUsed=.TRUE.
IsNotOK=.FALSE.
CALL ValidateComponent('RoomAirSettings:OneNodeDisplacementVentilation',cAlphaArgs(2),IsNotOK, &
'GetRoomAirModelParameters')
IF (IsNotOK) THEN
CALL ShowContinueError('In '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1))//'.')
ErrorsFound=.TRUE.
ENDIF
CASE ('THREENODEDISPLACEMENTVENTILATION')
AirModel(ZoneNum)%AirModelType = RoomAirModel_UCSDDV
AirModel(ZoneNum)%SimAirModel = .TRUE.
UCSDModelUsed=.TRUE.
IsNotOK=.FALSE.
CALL ValidateComponent('RoomAirSettings:ThreeNodeDisplacementVentilation',cAlphaArgs(2),IsNotOK, &
'GetRoomAirModelParameters')
IF (IsNotOK) THEN
CALL ShowContinueError('In '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1))//'.')
ErrorsFound=.TRUE.
ENDIF
CASE ('CROSSVENTILATION')
AirModel(ZoneNum)%AirModelType = RoomAirModel_UCSDCV
AirModel(ZoneNum)%SimAirModel = .TRUE.
UCSDModelUsed=.TRUE.
IsNotOK=.FALSE.
CALL ValidateComponent('RoomAirSettings:CrossVentilation',cAlphaArgs(2),IsNotOK,'GetRoomAirModelParameters')
IF (IsNotOK) THEN
CALL ShowContinueError('In '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1))//'.')
ErrorsFound=.TRUE.
ENDIF
CASE ('UNDERFLOORAIRDISTRIBUTIONINTERIOR')
AirModel(ZoneNum)%AirModelType = RoomAirModel_UCSDUFI
AirModel(ZoneNum)%SimAirModel = .TRUE.
UCSDModelUsed=.TRUE.
CALL ValidateComponent('RoomAirSettings:UnderFloorAirDistributionInterior',cAlphaArgs(2),IsNotOK, &
'GetRoomAirModelParameters')
IF (IsNotOK) THEN
CALL ShowContinueError('In '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1))//'.')
ErrorsFound=.TRUE.
ENDIF
CASE ('UNDERFLOORAIRDISTRIBUTIONEXTERIOR')
AirModel(ZoneNum)%AirModelType = RoomAirModel_UCSDUFE
AirModel(ZoneNum)%SimAirModel = .TRUE.
UCSDModelUsed=.TRUE.
CALL ValidateComponent('RoomAirSettings:UnderFloorAirDistributionExterior',cAlphaArgs(2),IsNotOK, &
'GetRoomAirModelParameters')
IF (IsNotOK) THEN
CALL ShowContinueError('In '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1))//'.')
ErrorsFound=.TRUE.
ENDIF
CASE ('USERDEFINED')
AirModel(ZoneNum)%AirModelType = RoomAirModel_UserDefined
AirModel(ZoneNum)%SimAirModel = .TRUE.
UserDefinedUsed = .TRUE.
! Need to make sure that Room Air controls are used for this one.
CASE DEFAULT
CALL ShowWarningError('Invalid '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)) )
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) )
CALL ShowContinueError('The mixing air model will be used for Zone ='//TRIM(cAlphaArgs(2)) )
AirModel(ZoneNum)%AirModelType = RoomAirModel_Mixing
END SELECT
SELECT CASE (cAlphaArgs(4))
CASE ('DIRECT')
AirModel(ZoneNum)%TempCoupleScheme = DirectCoupling
CASE ('INDIRECT')
AirModel(ZoneNum)%TempCoupleScheme = InDirectCoupling
CASE DEFAULT
CALL ShowWarningError('Invalid '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(cAlphaArgs(4)) )
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) )
CALL ShowContinueError('The direct coupling scheme will be used for Zone ='//TRIM(cAlphaArgs(2)) )
AirModel(ZoneNum)%TempCoupleScheme = DirectCoupling
END SELECT
ELSE ! Zone Not Found
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', Zone not found='//TRIM(cAlphaArgs(2)))
CALL ShowContinueError('occurs in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
ErrorsFound=.TRUE.
END IF
END DO ! AirModel_Param_Loop
DO ZoneNum = 1, NumOfZones
IF (NumOfAirModels .EQ. 0) THEN
AirModel(ZoneNum)%AirModelName = 'MIXING AIR MODEL FOR ' // TRIM(Zone(ZoneNum)%Name)
AirModel(ZoneNum)%ZoneName = Zone(ZoneNum)%Name
ELSEIF (AirModel(ZoneNum)%ZoneName == Blank) THEN
! no 'select air model' object for this zone so the mixing model is used for this zone
AirModel(ZoneNum)%AirModelName = 'MIXING AIR MODEL FOR ' // TRIM(Zone(ZoneNum)%Name)
AirModel(ZoneNum)%ZoneName = Zone(ZoneNum)%Name
END IF
END DO
! Write RoomAir Model details onto EIO file
WRITE(OutputFileInits,RoomAirHeader)
DO ZoneNum=1,NumOfZones
SELECT CASE(AirModel(ZoneNum)%AirModelType)
CASE(RoomAirModel_Mixing)
WRITE(OutputFileInits,RoomAirZoneFmt) TRIM(Zone(ZoneNum)%Name),'Mixing/Well-Stirred'
CASE(RoomAirModel_Mundt)
WRITE(OutputFileInits,RoomAirZoneFmt) TRIM(Zone(ZoneNum)%Name),'OneNodeDisplacementVentilation'
CASE(RoomAirModel_UCSDDV)
WRITE(OutputFileInits,RoomAirZoneFmt) TRIM(Zone(ZoneNum)%Name),'ThreeNodeDisplacementVentilation'
CASE(RoomAirModel_UCSDCV)
WRITE(OutputFileInits,RoomAirZoneFmt) TRIM(Zone(ZoneNum)%Name),'CrossVentilation'
CASE(RoomAirModel_UCSDUFI)
WRITE(OutputFileInits,RoomAirZoneFmt) TRIM(Zone(ZoneNum)%Name),'UnderFloorAirDistributionInterior'
CASE(RoomAirModel_UCSDUFE)
WRITE(OutputFileInits,RoomAirZoneFmt) TRIM(Zone(ZoneNum)%Name),'UnderFloorAirDistributionExterior'
CASE(RoomAirModel_UserDefined)
WRITE(OutputFileInits,RoomAirZoneFmt) TRIM(Zone(ZoneNum)%Name),'UserDefined'
END SELECT
ENDDO
IF (ErrorsFound) THEN
CALL ShowSevereError('Errors found in processing input for '//TRIM(cCurrentModuleObject) )
ErrFlag=.TRUE.
ENDIF
RETURN
END SUBROUTINE GetRoomAirModelParameters