Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | optional | :: | ZoneToResimulate |
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 CalculateZoneMRT(ZoneToResimulate)
! SUBROUTINE INFORMATION:
! AUTHOR Rick Strand
! DATE WRITTEN November 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculates the current zone MRT for thermal comfort and radiation
! calculation purposes.
! METHODOLOGY EMPLOYED:
! If you have to ask...
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN), OPTIONAL :: ZoneToResimulate ! if passed in, then only calculate surfaces that have this zone
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL, SAVE :: FirstTime = .TRUE. ! Flag for first time calculations
REAL(r64) :: SumAET ! Intermediate calculational variable (area*emissivity*T) sum
REAL(r64), SAVE, ALLOCATABLE, DIMENSION(:) :: SurfaceAE ! Product of area and emissivity for each surface
INTEGER :: SurfNum ! Surface number
REAL(r64), SAVE, ALLOCATABLE, DIMENSION(:) :: ZoneAESum ! Sum of area times emissivity for all zone surfaces
INTEGER :: ZoneNum ! Zone number
! FLOW:
IF (FirstTime) THEN
ALLOCATE(SurfaceAE(TotSurfaces))
ALLOCATE(ZoneAESum(NumOfZones))
SurfaceAE = 0.0d0
ZoneAESum = 0.0d0
DO SurfNum = 1, TotSurfaces
IF (Surface(SurfNum)%HeatTransSurf) THEN
SurfaceAE(SurfNum) = Surface(SurfNum)%Area*Construct(Surface(SurfNum)%Construction)%InsideAbsorpThermal
ZoneNum = Surface(SurfNum)%Zone
IF (ZoneNum > 0) ZoneAESum(ZoneNum) = ZoneAESum(ZoneNum) + SurfaceAE(SurfNum)
END IF
END DO
END IF
DO ZoneNum = 1, NumOfZones
IF ( PRESENT(ZoneToResimulate) .AND. (ZoneNum /= ZoneToResimulate)) CYCLE
SumAET = 0.0d0
DO SurfNum = Zone(ZoneNum)%SurfaceFirst, Zone(ZoneNum)%SurfaceLast
IF (Surface(SurfNum)%HeatTransSurf) THEN
SumAET = SumAET + SurfaceAE(SurfNum)*TempSurfIn(SurfNum)
END IF
END DO
IF (ZoneAESum(ZoneNum) > 0.01d0) THEN
MRT(ZoneNum) = SumAET/ZoneAESum(ZoneNum)
ELSE
IF (FirstTime) THEN
CALL ShowWarningError('Zone areas*inside surface emissivities are summing to zero, for Zone="'// &
TRIM(Zone(ZoneNum)%Name)//'"')
CALL ShowContinueError('As a result, MRT will be set to MAT for that zone')
END IF
MRT(ZoneNum) = MAT(ZoneNum)
END IF
END DO
FirstTime = .FALSE.
RETURN
END SUBROUTINE CalculateZoneMRT