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 | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | SurfNum | |||
| real(kind=r64), | intent(in) | :: | SurfTemp | |||
| real(kind=r64), | intent(in) | :: | AirTemp | |||
| real(kind=r64), | intent(in) | :: | WindAtZ | |||
| real(kind=r64), | intent(in) | :: | WindDirect | |||
| real(kind=R64), | intent(in) | :: | RoofArea | |||
| real(kind=r64), | intent(in) | :: | RoofPerimeter | 
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.
FUNCTION CalcClearRoof(SurfNum, SurfTemp, AirTemp, WindAtZ, WindDirect, RoofArea, RoofPerimeter) RESULT (Hc)
          ! FUNCTION INFORMATION:
          !       AUTHOR         <author>
          !       DATE WRITTEN   <date_written>
          !       MODIFIED       na
          !       RE-ENGINEERED  na
          ! PURPOSE OF THIS FUNCTION:
          ! <description>
          ! METHODOLOGY EMPLOYED:
          ! <description>
          ! REFERENCES:
          ! na
          ! USE STATEMENTS:
  USE DataEnvironment, ONLY: OutBaroPress, OutHumRat
  USE psychrometrics,  ONLY: PsyRhoAirFnPbTdbW
  IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
          ! FUNCTION ARGUMENT DEFINITIONS:
  INTEGER,    INTENT(IN) :: SurfNum
  REAL(r64) , INTENT(IN) :: SurfTemp
  REAL(r64) , INTENT(IN) :: AirTemp
  REAL(r64) , INTENT(IN) :: WindAtZ
  REAL(r64) , INTENT(IN) :: WindDirect ! Wind direction measured clockwise from geographhic North
  REAL(R64) , INTENT(IN) :: RoofArea
  REAL(r64) , INTENT(IN) :: RoofPerimeter
  REAL(r64)              :: Hc
          ! FUNCTION PARAMETER DEFINITIONS:
  REAL(r64), PARAMETER :: g  = 9.81d0       ! gravity constant (m/s**2)
  REAL(r64), PARAMETER :: v  = 15.89d-6   ! kinematic viscosity (m**2/s) for air at 300 K
  REAL(r64), PARAMETER :: k  = 0.0263d0     ! thermal conductivity (W/m K) for air at 300 K
  REAL(r64), PARAMETER :: Pr = 0.71d0      ! Prandtl number for air at ?
          ! INTERFACE BLOCK SPECIFICATIONS:
          ! na
          ! DERIVED TYPE DEFINITIONS:
          ! na
          ! FUNCTION LOCAL VARIABLE DECLARATIONS:
  REAL(r64) :: DeltaTemp
  REAL(r64) :: Ln
  REAL(r64) :: RaLn ! Rayleigh number
  REAL(r64) :: GrLn ! Grashof number
  REAL(r64) :: AirDensity
  REAL(r64) :: Rex ! Reynolds number
  REAL(r64) :: x  ! distance to roof edge toward wind direction
  REAL(r64) :: eta
  REAL(r64), DIMENSION(6) :: RfARR
  REAL(r64) :: Rf
  REAL(r64) :: BetaFilm
  INTEGER, SAVE :: ErrorIndex = 0
  RfARR = (/2.10d0, 1.67d0, 1.52d0, 1.13d0,1.11d0, 1.0d0/)
  Rf = RfARR(Material(Construct(Surface(SurfNum)%Construction)%LayerPoint(1))%Roughness)
  !find x, don't know x. avoid time consuming geometry algorithm
  x = SQRT(RoofArea)/2.d0 ! quick simplification, geometry routines to develop
  IF (RoofPerimeter >0.d0 ) THEN
    Ln = RoofArea / RoofPerimeter
  ELSE
    Ln = SQRT(RoofArea)
  ENDIF
  DeltaTemp = SurfTemp - AirTemp
  BetaFilm = 1.d0 / (KelvinConv + SurfTemp + 0.5d0 * DeltaTemp)
  AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress,AirTemp,OutHumRat)
  GrLn = g * (AirDensity**2) * (Ln**3 ) * ABS(DeltaTemp) * BetaFilm / v**2
  RaLn = GrLn * Pr
  Rex = WindAtZ * AirDensity * x / v
  IF (Rex > 0.1d0) THEN !avoid zero and crazy small denominators
    eta = (log(1.0d0+GrLn/Rex**2))/(1.0d0 + Log(1.0d0 + GrLn/(Rex**2)))
  ELSE
    eta = 1.d0 ! forced convection gone because no wind
  ENDIF
  IF ( x > 0.d0) THEN
    Hc = eta *(k/Ln)*0.15d0*(RaLn**OneThird) + (k/x)*Rf*0.0296d0*(Rex**FourFifths)*(Pr**OneThird)
  ELSE
    IF (ErrorIndex == 0) THEN
      CALL ShowSevereMessage('CalcClearRoof: Convection model not evaluated (bad value for distance to roof edge)')
      CALL ShowContinueError('Value for distance to roof edge ='//TRIM(RoundSigDigits(x,3)))
      CALL ShowContinueError('Occurs for surface named = ' //TRIM(Surface(SurfNum)%Name) )
      CALL ShowContinueError('Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues')
    ENDIF
    CALL ShowRecurringSevereErrorAtEnd('CalcClearRoof: Convection model not evaluated because ' &
                                       //'bad value for distance to roof edge and set to 9.999 [W/m2-k]' , ErrorIndex)
    Hc = 9.9999d0 ! safe but noticeable
  ENDIf
  RETURN
END FUNCTION CalcClearRoof