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 SetupZoneGeometry(ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR George Walton
! DATE WRITTEN September 1977
! MODIFIED April 2002 (FCW): add warning for Solar Distribution
! = FullInteriorExterior when window has reveal
! Add fatal error when triangular window has reveal
! May 2002(FCW): Allow triangular windows to have reveal (subr SHDRVL
! in SolarShading). Remove above warning and fatal error.
! RE-ENGINEERED November 1997 (RKS,LKL)
! PURPOSE OF THIS SUBROUTINE:
! This subroutine controls the processing of detached shadowing and
! zone surfaces for computing their vertices.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataVectorTypes
USE OutputReportPredefined
USE General, ONLY: RoundSigDigits
USE DataReportingFlags
USE InputProcessor, ONLY: GetNumSectionsFound
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: ValFmt="(F20.2)"
CHARACTER(len=*), PARAMETER :: fmtA="(A)"
CHARACTER(len=*), PARAMETER :: RoutineName='SetUpZoneGeometry: '
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: AverageHeight ! Used to keep track of average height of a surface/zone
INTEGER :: SurfNum ! Surface number (DO loop counter)
INTEGER :: ZoneNum ! Zone number for current surface and DO loop counter
REAL(r64) :: ZMax ! Maximum Z of a surface (detailed outside coefficient calculation)
REAL(r64) :: ZMin ! Minimum Z of a surface (detailed outside coefficient calculation)
REAL(r64) :: ZCeilAvg
REAL(r64) :: CeilCount
REAL(r64) :: ZFlrAvg
REAL(r64) :: FloorCount
REAL(r64) :: TotSurfArea
REAL(r64) :: Z1
REAL(r64) :: Z2
CHARACTER(len=32) String1
CHARACTER(len=32) String2
CHARACTER(len=3) String3
INTEGER Count ! To count wall surfaces for ceiling height calculation
LOGICAL, ALLOCATABLE, DIMENSION(:) :: ZoneCeilingHeightEntered
REAL(r64), ALLOCATABLE, DIMENSION(:) :: ZoneCeilingArea
INTEGER, SAVE :: ErrCount=0
REAL(r64) :: NominalUwithConvCoeffs
CHARACTER(len=32) :: cNominalU
CHARACTER(len=32) :: cNominalUwithConvCoeffs
LOGICAL :: isWithConvCoefValid
! INTEGER, ALLOCATABLE, DIMENSION(:) :: ZoneSurfacesCount
! INTEGER, ALLOCATABLE, DIMENSION(:) :: ZoneSubSurfacesCount
! INTEGER, ALLOCATABLE, DIMENSION(:) :: ZoneShadingSurfacesCount
LOGICAL :: nonInternalMassSurfacesPresent
LOGICAL :: DetailedWWR
! FLOW:
! Allocations and initializations...
! Zones must have been "gotten" before this call
! The RelNorth variables are used if "relative" coordinates are input as well
! as setting up DaylightingCoords
! these include building north axis and Building Rotation for Appendix G
CosBldgRelNorth = COS(-(BuildingAzimuth + BuildingRotationAppendixG)*DegToRadians)
SinBldgRelNorth = SIN(-(BuildingAzimuth + BuildingRotationAppendixG)*DegToRadians)
! these are only for Building Rotation for Appendix G when using world coordinate system
CosBldgRotAppGonly = COS(-BuildingRotationAppendixG*DegToRadians)
SinBldgRotAppGonly = SIN(-BuildingRotationAppendixG*DegToRadians)
ALLOCATE (CosZoneRelNorth(NumOfZones))
ALLOCATE (SinZoneRelNorth(NumOfZones))
ALLOCATE (ZoneCeilingHeightEntered(NumOfZones))
ZoneCeilingHeightEntered=.false.
ALLOCATE (ZoneCeilingArea(NumOfZones))
ZoneCeilingArea=0.0d0
DO ZoneNum = 1, NumOfZones
CosZoneRelNorth(ZoneNum) = COS(-Zone(ZoneNum)%RelNorth*DegToRadians)
SinZoneRelNorth(ZoneNum) = SIN(-Zone(ZoneNum)%RelNorth*DegToRadians)
END DO
CALL GetSurfaceData(ErrorsFound)
IF (ErrorsFound) THEN
DEALLOCATE (CosZoneRelNorth)
DEALLOCATE (SinZoneRelNorth)
RETURN
ENDIF
CALL GetWindowGapAirflowControlData(ErrorsFound)
CALL GetStormWindowData(ErrorsFound)
IF(.NOT.ErrorsFound .AND. TotStormWin > 0) CALL CreateStormWindowConstructions
DEALLOCATE (CosZoneRelNorth)
DEALLOCATE (SinZoneRelNorth)
CALL AllocateModuleArrays ! This needs to be moved to the main manager routine of SSG at a later date
ALLOCATE(AirSkyRadSplit(TotSurfaces))
AirSkyRadSplit=0.0d0
CalcWindowRevealReflection = .FALSE. ! Set to True in ProcessSurfaceVertices if beam solar reflection from window reveals
! is requested for one or more exterior windows.
BuildingShadingCount =0
FixedShadingCount =0
AttachedShadingCount =0
DO SurfNum = 1, TotSurfaces ! Loop through all surfaces...
AirSkyRadSplit(SurfNum) = SQRT(0.5d0*(1.0d0+Surface(SurfNum)%CosTilt))
! Set flag that determines whether a surface is a shadowing surface
Surface(SurfNum)%ShadowingSurf = .FALSE.
IF(Surface(SurfNum)%Class == SurfaceClass_Shading .OR. Surface(SurfNum)%Class == SurfaceClass_Detached_F .OR. &
Surface(SurfNum)%Class == SurfaceClass_Detached_B) Surface(SurfNum)%ShadowingSurf = .TRUE.
IF (Surface(SurfNum)%Class == SurfaceClass_Shading) AttachedShadingCount=AttachedShadingCount+1
IF (Surface(SurfNum)%Class == SurfaceClass_Detached_F) FixedShadingCount=FixedShadingCount+1
IF (Surface(SurfNum)%Class == SurfaceClass_Detached_B) BuildingShadingCount=BuildingShadingCount+1
IF (Surface(SurfNum)%Class /= SurfaceClass_IntMass) CALL ProcessSurfaceVertices(SurfNum,ErrorsFound)
END DO
Zone%ExtWindowArea=0.0d0
Zone%HasInterZoneWindow=.false.
Zone%HasWindow=.false.
Zone%ExtGrossWallArea=0.0d0
Zone%ExtNetWallArea=0.0d0
Zone%TotalSurfArea=0.0d0
DetailedWWR=(GetNumSectionsFound('DETAILEDWWR_DEBUG') > 0)
IF (DetailedWWR) THEN
WRITE(OutputFileDebug,'(A)') '=======User Entered Classification ================='
WRITE(OutputFileDebug,'(A)') 'Surface,Class,Area,Tilt'
ENDIF
DO SurfNum = 1, TotSurfaces ! Loop through all surfaces to find windows...
IF (.NOT.Surface(SurfNum)%HeatTransSurf) CYCLE ! Skip shadowing (sub)surfaces
ZoneNum=Surface(SurfNum)%Zone
Zone(ZoneNum)%TotalSurfArea = Zone(ZoneNum)%TotalSurfArea + Surface(SurfNum)%Area
IF(Construct(Surface(SurfNum)%Construction)%TypeIsWindow) THEN
Zone(ZoneNum)%TotalSurfArea = Zone(ZoneNum)%TotalSurfArea + SurfaceWindow(SurfNum)%FrameArea
Zone(ZoneNum)%HasWindow = .true.
ENDIF
IF (Surface(SurfNum)%Class == SurfaceClass_Roof) ZoneCeilingArea(ZoneNum)=ZoneCeilingArea(ZoneNum)+Surface(SurfNum)%Area
IF (.NOT. Construct(Surface(SurfNum)%Construction)%TypeIsWindow) THEN
IF (Surface(SurfNum)%ExtBoundCond == ExternalEnvironment .or. &
Surface(SurfNum)%ExtBoundCond == OtherSideCondModeledExt ) THEN
Zone(ZoneNum)%ExteriorTotalSurfArea=Zone(ZoneNum)%ExteriorTotalSurfArea + &
Surface(SurfNum)%GrossArea
IF (Surface(SurfNum)%Class == SurfaceClass_Wall) THEN
Zone(ZoneNum)%ExtNetWallArea = Zone(ZoneNum)%ExtNetWallArea + &
Surface(SurfNum)%Area
Zone(ZoneNum)%ExtGrossWallArea = Zone(ZoneNum)%ExtGrossWallArea + &
Surface(SurfNum)%GrossArea
Zone(ZoneNum)%ExtGrossWallArea_Multiplied = Zone(ZoneNum)%ExtGrossWallArea_Multiplied + &
Surface(SurfNum)%GrossArea * Zone(ZoneNum)%Multiplier * Zone(ZoneNum)%ListMultiplier
IF (DetailedWWR) THEN
WRITE(OutputFileDebug,'(A)') trim(Surface(SurfNum)%Name)//',Wall,'// &
trim(RoundSigDigits(Surface(SurfNum)%GrossArea*Zone(ZoneNum)%Multiplier*Zone(ZoneNum)%ListMultiplier,2))// &
','//trim(RoundSigDigits(Surface(SurfNum)%Tilt,1))
ENDIF
ENDIF
ELSEIF (Surface(SurfNum)%ExtBoundCond == Ground .or. Surface(SurfNum)%ExtBoundCond == GroundFCfactorMethod) THEN
Zone(ZoneNum)%ExteriorTotalGroundSurfArea=Zone(ZoneNum)%ExteriorTotalGroundSurfArea + &
Surface(SurfNum)%GrossArea
IF (Surface(SurfNum)%Class == SurfaceClass_Wall) THEN
Zone(ZoneNum)%ExtGrossGroundWallArea = Zone(ZoneNum)%ExtGrossGroundWallArea + &
Surface(SurfNum)%GrossArea
Zone(ZoneNum)%ExtGrossGroundWallArea_Multiplied = Zone(ZoneNum)%ExtGrossGroundWallArea_Multiplied + &
Surface(SurfNum)%GrossArea * Zone(ZoneNum)%Multiplier * Zone(ZoneNum)%ListMultiplier
IF (DetailedWWR) THEN
WRITE(OutputFileDebug,'(A)') trim(Surface(SurfNum)%Name)//',Wall-GroundContact,'// &
trim(RoundSigDigits(Surface(SurfNum)%GrossArea*Zone(ZoneNum)%Multiplier*Zone(ZoneNum)%ListMultiplier,2))// &
','//trim(RoundSigDigits(Surface(SurfNum)%Tilt,1))
ENDIF
ENDIF
ENDIF
ELSE ! For Windows
IF ((Surface(SurfNum)%ExtBoundCond > 0) .AND. (Surface(SurfNum)%BaseSurf /= SurfNum)) THEN ! Interzone window present
IF (.not. IgnoreInteriorWindowTransmission) THEN
Zone(Surface(SurfNum)%Zone)%HasInterZoneWindow=.TRUE.
ENDIF
ELSE
IF (( (Surface(SurfNum)%ExtBoundCond == ExternalEnvironment) .OR. &
(Surface(SurfNum)%ExtBoundCond == OtherSideCondModeledExt) )&
.AND. (Surface(SurfNum)%Class .NE. SurfaceClass_TDD_Dome)) THEN
Zone(Surface(SurfNum)%Zone)%ExtWindowArea = Zone(Surface(SurfNum)%Zone)%ExtWindowArea + Surface(SurfNum)%GrossArea
Zone(Surface(SurfNum)%Zone)%ExtWindowArea_Multiplied = Zone(Surface(SurfNum)%Zone)%ExtWindowArea + &
Surface(SurfNum)%GrossArea*Surface(SurfNum)%Multiplier*Zone(ZoneNum)%Multiplier*Zone(ZoneNum)%ListMultiplier
IF (DetailedWWR) THEN
WRITE(OutputFileDebug,'(A)') trim(Surface(SurfNum)%Name)//',Window,'// &
trim(RoundSigDigits(Surface(SurfNum)%GrossArea*Surface(SurfNum)%Multiplier* &
Zone(ZoneNum)%Multiplier*Zone(ZoneNum)%ListMultiplier,2))// &
','//trim(RoundSigDigits(Surface(SurfNum)%Tilt,1))
ENDIF
ENDIF
ENDIF
ENDIF
END DO ! ...end of surfaces windows DO loop
! DO SurfNum = 1, TotSurfaces ! Set areas for Sunlit area calculations for Windows
! IF (Surface(SurfNum)%Class /= SurfaceClass_Window) CYCLE
! SurfaceWindow(SurfNum)%AreaCalcForSunlitArea = (Surface(SurfNum)%Area + SurfaceWindow(SurfNum)%DividerArea) / &
! Surface(SurfNum)%Multiplier
! ENDDO
IF (DetailedWWR) THEN
WRITE(OutputFileDebug,'(A)') '========================'
WRITE(OutputFileDebug,'(A)') 'Zone,ExtWallArea,ExtWindowArea'
ENDIF
DO ZoneNum = 1, NumOfZones
CeilCount=0.0d0
FloorCount=0.0d0
Count=0
AverageHeight=0.0d0
ZCeilAvg=0.0d0
ZFlrAvg=0.0d0
ZMax=-99999.0d0
ZMin=99999.0d0
IF (DetailedWWR) THEN
WRITE(OutputFileDebug,'(A)') trim(Zone(ZoneNum)%Name)//','// &
trim(RoundSigDigits(Zone(ZoneNum)%ExtGrossWallArea,2))//','// &
trim(RoundSigDigits(Zone(ZoneNum)%ExtWindowArea,2))
ENDIF
DO SurfNum=Zone(ZoneNum)%SurfaceFirst,Zone(ZoneNum)%SurfaceLast
IF (Surface(SurfNum)%Class == SurfaceClass_Roof) THEN
! Use Average Z for surface, more important for roofs than floors...
CeilCount=CeilCount+1.0d0
Z1=MINVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%Z)
Z2=MAXVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%Z)
! ZCeilAvg=ZCeilAvg+(Z1+Z2)/2.d0
ZCeilAvg=ZCeilAvg+((Z1+Z2)/2.d0)*(Surface(SurfNum)%Area/ZoneCeilingArea(ZoneNum))
ENDIF
IF (Surface(SurfNum)%Class == SurfaceClass_Floor) THEN
! Use Average Z for surface, more important for roofs than floors...
FloorCount=FloorCount+1.0d0
Z1=MINVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%Z)
Z2=MAXVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%Z)
! ZFlrAvg=ZFlrAvg+(Z1+Z2)/2.d0
ZFlrAvg=ZFlrAvg+((Z1+Z2)/2.d0)*(Surface(SurfNum)%Area/Zone(ZoneNum)%FloorArea)
ENDIF
IF (Surface(SurfNum)%Class == SurfaceClass_Wall) THEN
! Use Wall calculation in case no roof & floor in zone
Count=Count+1
IF (Count == 1) THEN
ZMax=Surface(SurfNum)%Vertex(1)%Z
ZMin=ZMax
ENDIF
ZMax=MAX(ZMax,MAXVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%Z))
ZMin=MIN(ZMin,MINVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%Z))
ENDIF
ENDDO
IF (CeilCount > 0.0d0 .and. FloorCount > 0.0d0) THEN
! ZCeilAvg=ZCeilAvg/CeilCount
! ZFlrAvg=ZFlrAvg/FloorCount
AverageHeight=ZCeilAvg-ZFlrAvg
ELSE
AverageHeight=(ZMax-ZMin)
ENDIF
IF (AverageHeight <= 0.0d0) THEN
AverageHeight=(ZMax-ZMin)
ENDIF
IF (Zone(ZoneNum)%CeilingHeight > 0.0d0) THEN
ZoneCeilingHeightEntered(ZoneNum)=.true.
IF (AverageHeight > 0.0d0) THEN
IF (ABS(AverageHeight-Zone(ZoneNum)%CeilingHeight)/Zone(ZoneNum)%CeilingHeight > .05d0) THEN
IF (ErrCount == 1 .and. .not. DisplayExtraWarnings) THEN
CALL ShowWarningError(RoutineName//'Entered Ceiling Height for some zone(s) significantly '// &
'different from calculated Ceiling Height')
CALL ShowContinueError('...use Output:Diagnostics,DisplayExtraWarnings; '// &
'to show more details on each max iteration exceeded.')
ENDIF
IF (DisplayExtraWarnings) THEN
CALL ShowWarningError(RoutineName//'Entered Ceiling Height for Zone="'//TRIM(Zone(ZoneNum)%Name)// &
'" significantly different from calculated Ceiling Height')
WRITE(String1,ValFmt) Zone(ZoneNum)%CeilingHeight
String1=ADJUSTL(String1)
WRITE(String2,ValFmt) AverageHeight
String2=ADJUSTL(String2)
CALL ShowContinueError(RoutineName//'Entered Ceiling Height='//TRIM(String1)// &
', Calculated Ceiling Height='//TRIM(String2)// &
', entered height will be used in calculations.')
ENDIF
ENDIF
ENDIF
ENDIF
IF ((Zone(ZoneNum)%CeilingHeight <= 0.0d0).AND.(AverageHeight > 0.0d0)) &
Zone(ZoneNum)%CeilingHeight = AverageHeight
END DO
CALL CalculateZoneVolume(ErrorsFound,ZoneCeilingHeightEntered) ! Calculate Zone Volumes
! Calculate zone centroid (and min/max x,y,z for zone)
DO ZoneNum = 1, NumOfZones
nonInternalMassSurfacesPresent=.false.
TotSurfArea = 0.0d0
Zone(ZoneNum)%Centroid = Vector(0.0d0, 0.0d0, 0.0d0)
IF (Surface(Zone(ZoneNum)%SurfaceFirst)%Sides > 0) THEN
Zone(ZoneNum)%MinimumX=Surface(Zone(ZoneNum)%SurfaceFirst)%Vertex(1)%x
Zone(ZoneNum)%MaximumX=Surface(Zone(ZoneNum)%SurfaceFirst)%Vertex(1)%x
Zone(ZoneNum)%MinimumY=Surface(Zone(ZoneNum)%SurfaceFirst)%Vertex(1)%y
Zone(ZoneNum)%MaximumY=Surface(Zone(ZoneNum)%SurfaceFirst)%Vertex(1)%y
Zone(ZoneNum)%MinimumZ=Surface(Zone(ZoneNum)%SurfaceFirst)%Vertex(1)%z
Zone(ZoneNum)%MaximumZ=Surface(Zone(ZoneNum)%SurfaceFirst)%Vertex(1)%z
ENDIF
DO SurfNum = Zone(ZoneNum)%SurfaceFirst, Zone(ZoneNum)%SurfaceLast
IF (Surface(SurfNum)%Class == SurfaceClass_IntMass) CYCLE
nonInternalMassSurfacesPresent=.true.
IF (Surface(SurfNum)%Class == SurfaceClass_Wall &
.OR. (Surface(SurfNum)%Class == SurfaceClass_Roof) &
.OR. (Surface(SurfNum)%Class == SurfaceClass_Floor)) THEN
Zone(ZoneNum)%Centroid%x = Zone(ZoneNum)%Centroid%x + Surface(SurfNum)%Centroid%x * Surface(SurfNum)%GrossArea
Zone(ZoneNum)%Centroid%y = Zone(ZoneNum)%Centroid%y + Surface(SurfNum)%Centroid%y * Surface(SurfNum)%GrossArea
Zone(ZoneNum)%Centroid%z = Zone(ZoneNum)%Centroid%z + Surface(SurfNum)%Centroid%z * Surface(SurfNum)%GrossArea
TotSurfArea = TotSurfArea + Surface(SurfNum)%GrossArea
END IF
Zone(ZoneNum)%MinimumX=MIN(Zone(ZoneNum)%MinimumX,MINVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%x))
Zone(ZoneNum)%MaximumX=MAX(Zone(ZoneNum)%MaximumX,MAXVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%x))
Zone(ZoneNum)%MinimumY=MIN(Zone(ZoneNum)%MinimumY,MINVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%y))
Zone(ZoneNum)%MaximumY=MAX(Zone(ZoneNum)%MaximumY,MAXVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%y))
Zone(ZoneNum)%MinimumZ=MIN(Zone(ZoneNum)%MinimumZ,MINVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%z))
Zone(ZoneNum)%MaximumZ=MAX(Zone(ZoneNum)%MaximumZ,MAXVAL(Surface(SurfNum)%Vertex(1:Surface(SurfNum)%Sides)%z))
END DO
IF (TotSurfArea > 0.0d0) THEN
Zone(ZoneNum)%Centroid%x = Zone(ZoneNum)%Centroid%x / TotSurfArea
Zone(ZoneNum)%Centroid%y = Zone(ZoneNum)%Centroid%y / TotSurfArea
Zone(ZoneNum)%Centroid%z = Zone(ZoneNum)%Centroid%z / TotSurfArea
ENDIF
IF (.not. nonInternalMassSurfacesPresent) THEN
CALL ShowSevereError(RoutineName//'Zone="'//trim(Zone(ZoneNum)%Name)// &
'" has only internal mass surfaces. Need at least one other surface.')
ErrorsFound=.true.
ENDIF
END DO
DEALLOCATE(ZoneCeilingHeightEntered)
DEALLOCATE(ZoneCeilingArea)
ALLOCATE(AdjacentZoneToSurface(TotSurfaces))
AdjacentZoneToSurface=0
! note -- adiabatic surfaces will show same zone as surface
do surfnum=1,totsurfaces
if (Surface(surfnum)%ExtBoundCond <= 0) CYCLE
AdjacentZoneToSurface(surfnum)=Surface(Surface(surfNum)%ExtBoundCond)%Zone
enddo
do zonenum=1,NumOfZones
do surfnum=1,totsurfaces
if (.not. Surface(surfnum)%HeatTransSurf .and. Surface(surfnum)%ZoneName == Zone(zonenum)%Name) &
Zone(zonenum)%NumShadingSurfaces=Zone(zonenum)%NumShadingSurfaces+1
if (Surface(surfnum)%Zone /= zonenum) CYCLE
if (Surface(surfnum)%HeatTransSurf .and. (Surface(surfnum)%class == SurfaceClass_Wall .or. &
Surface(surfnum)%class == SurfaceClass_Roof .or. Surface(surfnum)%class == SurfaceClass_Floor)) &
Zone(zonenum)%NumSurfaces=Zone(zonenum)%NumSurfaces+1
if (Surface(surfnum)%HeatTransSurf .and. (Surface(surfnum)%class == SurfaceClass_Window .or. &
Surface(surfnum)%class == SurfaceClass_GlassDoor .or. Surface(surfnum)%class == SurfaceClass_Door .or. &
Surface(surfnum)%class == SurfaceClass_TDD_Dome .or. Surface(surfnum)%class == SurfaceClass_TDD_Diffuser)) &
Zone(zonenum)%NumSubSurfaces=Zone(zonenum)%NumSubSurfaces+1
enddo ! surfaces
enddo ! zones
do surfnum=1,totsurfaces
if (Surface(surfnum)%Construction > 0 .and. Surface(surfnum)%Construction <= TotConstructs) THEN
NominalUwithConvCoeffs = ComputeNominalUwithConvCoeffs(surfnum,isWithConvCoefValid)
IF (isWithConvCoefValid) THEN
cNominalUwithConvCoeffs=RoundSigDigits(NominalUwithConvCoeffs,3)
ELSE
cNominalUwithConvCoeffs = '[invalid]'
END IF
IF ((Surface(surfnum)%class == SurfaceClass_Window) .OR. (Surface(surfnum)%class == SurfaceClass_TDD_Dome)) THEN
! SurfaceClass_Window also covers glass doors and TDD:Diffusers
cNominalU='N/A'
ELSE
cNominalU=RoundSigDigits(NominalU(Surface(surfnum)%Construction),3)
END IF
else
CNominalUwithConvCoeffs = '**'
CNominalU = '**'
endif
! save the U-value nominal for use later in tabular report
Surface(surfnum)%UNomWOFilm = cNominalU
Surface(surfnum)%UNomFilm = cNominalUwithConvCoeffs
!populate the predefined report related to u-values with films
!only exterior surfaces including underground
IF ((Surface(surfnum)%ExtBoundCond .EQ. ExternalEnvironment) .OR. (Surface(surfnum)%ExtBoundCond .EQ. Ground)) THEN
SELECT CASE (Surface(surfnum)%Class)
CASE (SurfaceClass_Wall,SurfaceClass_Floor,SurfaceClass_Roof)
CALL PreDefTableEntry(pdchOpUfactFilm,Surface(surfnum)%Name,NominalUwithConvCoeffs,3)
CASE (SurfaceClass_Door)
CALL PreDefTableEntry(pdchDrUfactFilm,Surface(surfnum)%Name,NominalUwithConvCoeffs,3)
END SELECT
END IF
enddo ! surfaces
! Write number of shadings to initialization output file
WRITE(OutputFileInits,fmtA) '! <Shading Summary>, Number of Fixed Detached Shades, Number of Building Detached Shades, '// &
'Number of Attached Shades'
WRITE(OutputFileInits,fmtA) ' Shading Summary,'//TRIM(RoundSigDigits(FixedShadingCount))//','// &
trim(RoundSigDigits(BuildingShadingCount))//','// &
trim(RoundSigDigits(AttachedShadingCount))
! Write number of zones header to initialization output file
WRITE(OutputFileInits,fmtA) '! <Zone Summary>, Number of Zones, Number of Zone Surfaces, Number of SubSurfaces'
WRITE(OutputFileInits,fmtA) ' Zone Summary,'//TRIM(RoundSigDigits(NumOfZones))//','// &
trim(RoundSigDigits(TotSurfaces-FixedShadingCount-BuildingShadingCount-AttachedShadingCount))//','// &
trim(RoundSigDigits(SUM(Zone%NumSubSurfaces)))
! Write Zone Information header to the initialization output file
WRITE(OutputFileInits,721)
DO ZoneNum=1,NumOfZones
! Write Zone Information to the initialization output file
SELECT CASE (Zone(ZoneNum)%InsideConvectionAlgo)
CASE (ASHRAESimple)
String1='Simple'
CASE (ASHRAETARP)
String1='TARP'
CASE (CeilingDiffuser)
String1='CeilingDiffuser'
CASE (TrombeWall)
String1='TrombeWall'
CASE (AdaptiveConvectionAlgorithm)
String1='AdaptiveConvectionAlgorithm'
END SELECT
SELECT CASE (Zone(ZoneNum)%OutsideConvectionAlgo)
CASE (ASHRAESimple)
String2='Simple'
CASE (ASHRAETARP)
String2='TARP'
CASE (TarpHcOutside)
String2='TARP'
CASE (MoWittHcOutside)
String2='MoWitt'
CASE (DOE2HcOutside)
String2='DOE-2'
! CASE (BLASTHcOutside)
! String2='BLAST'
CASE (AdaptiveConvectionAlgorithm)
String2='AdaptiveConvectionAlgorithm'
END SELECT
IF (Zone(ZoneNum)%isPartOfTotalArea) THEN
String3='Yes'
ELSE
String3='No'
ENDIF
WRITE(OutputFileInits,720) TRIM(Zone(ZoneNum)%Name),TRIM(RoundSigDigits(Zone(ZoneNum)%RelNorth,1)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%OriginX,2)),TRIM(RoundSigDigits(Zone(ZoneNum)%OriginY,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%OriginZ,2)),TRIM(RoundSigDigits(Zone(ZoneNum)%Centroid%X,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%Centroid%Y,2)),TRIM(RoundSigDigits(Zone(ZoneNum)%Centroid%Z,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%OfType)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%Multiplier)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%ListMultiplier)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%MinimumX,2)),TRIM(RoundSigDigits(Zone(ZoneNum)%MaximumX,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%MinimumY,2)),TRIM(RoundSigDigits(Zone(ZoneNum)%MaximumY,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%MinimumZ,2)),TRIM(RoundSigDigits(Zone(ZoneNum)%MaximumZ,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%CeilingHeight,2)),TRIM(RoundSigDigits(Zone(ZoneNum)%Volume,2)), &
TRIM(String1),TRIM(String2),TRIM(RoundSigDigits(Zone(ZoneNum)%FloorArea,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%ExtGrossWallArea,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%ExtNetWallArea,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%ExtWindowArea,2)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%NumSurfaces)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%NumSubSurfaces)), &
TRIM(RoundSigDigits(Zone(ZoneNum)%NumShadingSurfaces)), &
TRIM(String3)
END DO ! ZoneNum
! Do the Stratosphere check
CALL SetOutBulbTempAt(NumOfZones, Zone(1:NumOfZones)%Centroid%Z, &
Zone(1:NumOfZones)%OutDryBulbTemp, Zone(1:NumOfZones)%OutWetBulbTemp, 'Zone')
! IF (ALLOCATED(ZoneSurfacesCount)) DEALLOCATE(ZoneSurfacesCount)
! IF (ALLOCATED(ZoneSubSurfacesCount)) DEALLOCATE(ZoneSubSurfacesCount)
! IF (ALLOCATED(ZoneShadingSurfacesCount)) DEALLOCATE(ZoneShadingSurfacesCount)
720 FORMAT(' Zone Information, ',A,28(',',A))
721 FORMAT('! <Zone Information>,Zone Name,North Axis {deg},', &
'Origin X-Coordinate {m},Origin Y-Coordinate {m},Origin Z-Coordinate {m},', &
'Centroid X-Coordinate {m},Centroid Y-Coordinate {m},Centroid Z-Coordinate {m},', &
'Type,Zone Multiplier,Zone List Multiplier,Minimum X {m},Maximum X {m},', &
'Minimum Y {m},Maximum Y {m},Minimum Z {m},Maximum Z {m},Ceiling Height {m},Volume {m3},', &
'Zone Inside Convection Algorithm {Simple-Detailed-CeilingDiffuser-TrombeWall},', &
'Zone Outside Convection Algorithm {Simple-Detailed-Tarp-MoWitt-DOE-2-BLAST},', &
' Floor Area {m2},Exterior Gross Wall Area {m2},Exterior Net Wall Area {m2},Exterior Window Area {m2},', &
' Number of Surfaces, Number of SubSurfaces, Number of Shading SubSurfaces, ', &
' Part of Total Building Area')
RETURN
END SUBROUTINE SetUpZoneGeometry