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) | :: | 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 GetAirNodeData(ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN August 2001
! RE-ENGINEERED April 2003, Weixiu Kong
! MODIFIED July 2003, CC
! Jan 2004, CC
! PURPOSE OF THIS SUBROUTINE:
! Get AirNode data 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,GetObjectItemNum,FindIteminList,VerifyName
USE DataIPShortCuts
USE DataHeatBalance, ONLY : Zone
USE DataSurfaces, ONLY : Surface
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound ! True if errors found during this get input routine
! SUBROUTINE PARAMETER DEFINITIONS
! na
! 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 :: AirNodeNum ! Index number for air nodes
INTEGER :: ZoneNum ! Index number for zones
INTEGER :: NumSurfsInvolved ! Number of surfaces involved with air nodes
INTEGER :: SurfCount ! Number of surfaces involved with air nodes
! (used for checking error)
INTEGER :: SurfNum ! Index number for surfaces
INTEGER :: SurfFirst ! Index number for first surface of zones
INTEGER :: NumOfSurfs ! Index number for last surface of zones
INTEGER :: ListSurfNum ! Index number of surfaces listed in the air node object
LOGICAL :: SurfNeeded
LOGICAL :: IsNotOK
LOGICAL :: IsBlank
! FLOW:
IF (.not. MundtModelUsed) RETURN
! Initialize default values for air nodes
ALLOCATE (TotNumOfZoneAirNodes(NumOfZones))
TotNumOfAirNodes = 0
TotNumOfZoneAirNodes = 0
cCurrentModuleObject = 'RoomAir:Node'
TotNumOfAirNodes = GetNumObjectsFound(cCurrentModuleObject)
IF (TotNumOfAirNodes.LE.0) THEN
! no air node object is found, terminate the program
CALL ShowSevereError('No '//TRIM(cCurrentModuleObject)//' objects found in input.')
CALL ShowContinueError('The OneNodeDisplacementVentilation model requires '//TRIM(cCurrentModuleObject)//' objects')
ErrorsFound=.true.
RETURN
ELSE
! air node objects are found so allocate airnode variable
ALLOCATE (AirNode(TotNumOfAirNodes))
END IF
DO AirNodeNum = 1, TotNumOfAirNodes
! get air node objects
CALL GetObjectItem(cCurrentModuleObject,AirNodeNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,Status, &
AlphaFieldnames=cAlphaFieldNames, NumericFieldNames=cNumericFieldNames)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(cAlphaArgs(1),AirNode%Name,AirNodeNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) cAlphaArgs(1)='xxxxx'
ENDIF
AirNode(AirNodeNum)%Name = cAlphaArgs(1)
AirNode(AirNodeNum)%ZoneName = cAlphaArgs(3) ! Zone name
AirNode(AirNodeNum)%ZonePtr=FindItemInList(AirNode(AirNodeNum)%ZoneName,Zone%Name,NumOfZones)
IF (AirNode(AirNodeNum)%ZonePtr == 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)) )
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) )
ErrorsFound=.true.
ELSE
ZoneNum=AirNode(AirNodeNum)%ZonePtr
NumOfSurfs = Zone(ZoneNum)%SurfaceLast - Zone(ZoneNum)%SurfaceFirst + 1
ALLOCATE (AirNode(AirNodeNum)%SurfMask(NumOfSurfs))
ENDIF
SELECT CASE (cAlphaArgs(2))
CASE ('INLET')
AirNode(AirNodeNum)%ClassType = InletAirNode
CASE ('FLOOR')
AirNode(AirNodeNum)%ClassType = FloorAirNode
CASE ('CONTROL')
AirNode(AirNodeNum)%ClassType = ControlAirNode
CASE ('CEILING')
AirNode(AirNodeNum)%ClassType = CeilingAirNode
CASE ('MUNDTROOM')
AirNode(AirNodeNum)%ClassType = MundtRoomAirNode
CASE ('RETURN')
AirNode(AirNodeNum)%ClassType = ReturnAirNode
! CASE ('PLUME1')
! AirNode(AirNodeNum)%ClassType = PlumeAirNode1
! CASE ('PLUME2')
! AirNode(AirNodeNum)%ClassType = PlumeAirNode2
! CASE ('PLUME3')
! AirNode(AirNodeNum)%ClassType = PlumeAirNode3
! CASE ('PLUME4')
! AirNode(AirNodeNum)%ClassType = PlumeAirNode4
! CASE ('REESROOM1')
! AirNode(AirNodeNum)%ClassType = RoomAirNode1
! CASE ('REESROOM2')
! AirNode(AirNodeNum)%ClassType = RoomAirNode2
! CASE ('REESROOM3')
! AirNode(AirNodeNum)%ClassType = RoomAirNode3
! CASE ('REESROOM4')
! AirNode(AirNodeNum)%ClassType = RoomAirNode4
CASE DEFAULT
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)) )
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)) )
ErrorsFound=.true.
END SELECT
AirNode(AirNodeNum)%Height = rNumericArgs(1) ! Air node height
NumSurfsInvolved = NumAlphas - 3 ! Number of surfaces involved with air nodes
! Initialize
AirNode(AirNodeNum)%SurfMask = .FALSE.
IF (NumSurfsInvolved.LE.0) THEN
! report severe error since the following air nodes require surfaces associated with them
SELECT CASE (cAlphaArgs(2))
CASE ('FLOOR','CEILING','MUNDTROOM','PLUME4','REESROOM1','REESROOM2','REESROOM3','REESROOM4')
! terminate the program due to a severe error in the specified input
CALL ShowSevereError('GetAirNodeData: '//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
'" invalid air node specification.')
CALL ShowContinueError('Mundt Room Air Model: No surface names specified. '// &
'Air node="' //TRIM(AirNode(AirNodeNum)%Name) // &
' requires name of surfaces associated with it.')
ErrorsFound=.true.
CASE DEFAULT
END SELECT
ELSE
! initialize
SurfNeeded = .TRUE.
! report warning error since the following air nodes do not require surfaces associated with them
! and assign .FALSE. to 'SurfNeeded'
SELECT CASE (cAlphaArgs(2))
CASE ('INLET','CONTROL','RETURN','PLUME1','PLUME2','PLUME3')
CALL ShowWarningError('GetAirNodeData: '//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
'" invalid linkage' )
CALL ShowContinueError('Mundt Room Air Model: No surface names needed. '// &
'Air node="' //TRIM(AirNode(AirNodeNum)%Name) // &
' does not relate to any surfaces.')
SurfNeeded = .FALSE.
CASE DEFAULT
END SELECT
IF (SurfNeeded) THEN
! this air node is in this zone; hence, first get name of all surfaces in this zone
ZoneNum=AirNode(AirNodeNum)%ZonePtr
SurfFirst=Zone(ZoneNum)%SurfaceFirst
NumOfSurfs = Zone(ZoneNum)%SurfaceLast - Zone(ZoneNum)%SurfaceFirst + 1
! terminate the program due to a severe error in the specified input
IF ((NumSurfsInvolved).GT.NumOfSurfs) THEN
CALL ShowFatalError('GetAirNodeData: Mundt Room Air Model: Number of surfaces connected to ' // &
TRIM(AirNode(AirNodeNum)%Name) // &
' is greater than number of surfaces in ' // TRIM(Zone(ZoneNum)%Name))
RETURN
END IF
! relate surfaces to this air node and check to see whether surface names are specified correctly or not
SurfCount = 0
SurfFirst=SurfFirst-1
DO ListSurfNum = 4, NumAlphas
DO SurfNum = 1, NumOfSurfs
IF (cAlphaArgs(ListSurfNum) == Surface(SurfFirst+SurfNum)%Name) THEN
AirNode(AirNodeNum)%SurfMask(SurfNum)=.TRUE.
SurfCount = SurfCount + 1
END IF
END DO
END DO
! report warning error since surface names are specified correctly
IF ((NumSurfsInvolved).NE.SurfCount) THEN
CALL ShowWarningError('GetAirNodeData: Mundt Room Air Model: Some surface names specified for ' // &
TRIM(AirNode(AirNodeNum)%Name) // &
' are not in ' // TRIM(Zone(ZoneNum)%Name))
END IF
END IF
END IF
END DO
! get number of air nodes in each zone
DO ZoneNum = 1, NumOfZones
! this zone uses other air model so skip the rest
IF (AirModel(ZoneNum)%AirModelType.NE.RoomAirModel_Mundt) CYCLE
! this zone uses a nodal air model so get number of air nodes in each zone
DO AirNodeNum = 1, TotNumOfAirNodes
IF (SameString(AirNode(AirNodeNum)%ZoneName,Zone(ZoneNum)%Name)) THEN
TotNumOfZoneAirNodes(ZoneNum) = TotNumOfZoneAirNodes(ZoneNum) + 1
END IF
END DO
END DO
RETURN
END SUBROUTINE GetAirNodeData