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) | :: | SurfaceNum | |||
real(kind=r64), | intent(in) | :: | FluxTop | |||
real(kind=r64), | intent(out) | :: | TempTop | |||
real(kind=r64), | intent(in) | :: | ThisDrybulb | |||
real(kind=r64), | intent(in) | :: | ThisWetbulb | |||
real(kind=r64), | intent(in) | :: | ThisSkyTemp | |||
real(kind=r64), | intent(in) | :: | ThisBeamSolarRad | |||
real(kind=r64), | intent(in) | :: | ThisDifSolarRad | |||
real(kind=r64), | intent(in) | :: | ThisSolarDirCosVert | |||
real(kind=r64), | intent(in) | :: | ThisWindSpeed | |||
logical, | intent(in) | :: | ThisIsRain | |||
logical, | intent(in) | :: | ThisIsSnow |
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 CalcTopSurfTemp (SurfaceNum, FluxTop, TempTop, ThisDrybulb, ThisWetBulb, &
ThisSkyTemp, ThisBeamSolarRad, ThisDifSolarRad, &
ThisSolarDirCosVert, ThisWindSpeed, ThisIsRain, ThisIsSnow)
! AUTHOR Simon Rees
! DATE WRITTEN August 2002
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is used to calculate the top surface
! temperature for the given surface flux.
! METHODOLOGY EMPLOYED:
! calc surface heat balance
! REFERENCES:
! USE STATEMENTS:
USE ConvectionCoefficients, ONLY : CalcASHRAESimpExtConvectCoeff
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: SurfaceNum ! surface index number
REAL(r64), INTENT(IN) :: FluxTop ! top surface flux
REAL(r64), INTENT(OUT) :: TempTop ! top surface temperature
REAL(r64), INTENT(IN) :: ThisDrybulb ! dry bulb temperature
REAL(r64), INTENT(IN) :: ThisWetbulb ! wet bulb temperature
REAL(r64), INTENT(IN) :: ThisSkyTemp ! sky temperature
REAL(r64), INTENT(IN) :: ThisBeamSolarRad ! beam solar radiation
REAL(r64), INTENT(IN) :: ThisDifSolarRad ! diffuse solar radiation
REAL(r64), INTENT(IN) :: ThisSolarDirCosVert ! vertical component of solar normal
REAL(r64), INTENT(IN) :: ThisWindSpeed ! wind speed
LOGICAL, INTENT(IN) :: ThisIsRain ! rain flag
LOGICAL, INTENT(IN) :: ThisIsSnow ! snow flag
! SUBROUTINE PARAMETER DEFINITIONS:
! n/a
! INTERFACE BLOCK SPECIFICATIONS
! n/a
! DERIVED TYPE DEFINITIONS
! n/a
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: ConvCoef ! convection coefficient
REAL(r64) :: RadCoef ! radiation coefficient
REAL(r64) :: ExternalTemp ! external environmental temp - drybulb or wetbulb
REAL(r64) :: OldSurfTemp ! previous surface temperature
REAL(r64) :: QSolAbsorbed ! absorbed solar flux
REAL(r64) :: SurfTempAbs ! absolute value of surface temp
REAL(r64) :: SkyTempAbs ! absolute value of sky temp
! make a surface heat balance and solve for temperature
! set appropriate external temp
IF(ThisIsSnow)THEN
ExternalTemp = ThisWetBulb
ELSE IF(ThisIsRain)THEN
ExternalTemp = ThisWetBulb
ELSE ! normal dry conditions
ExternalTemp = ThisDrybulb
END IF
! set previous surface temp
OldSurfTemp = SurfaceGHEQTF(SurfaceNum)%TtopHistory(1)
! absolute temperatures
SurfTempAbs = OldSurfTemp + KelvinConv
SkyTempAbs = ThisSkyTemp + KelvinConv
! ASHRAE simple convection coefficient model for external surfaces.
ConvCoef = CalcASHRAESimpExtConvectCoeff(TopRoughness,ThisWindSpeed)
! radiation coefficient using surf temp from past time step
IF (ABS(SurfTempAbs-SkyTempAbs) > SmallNum) THEN
RadCoef = StefBoltzmann*TopThermAbs*((SurfTempAbs**4)-(SkyTempAbs**4))/ &
(SurfTempAbs-SkyTempAbs)
ELSE
RadCoef = 0.0d0
ENDIF
! total absorbed solar - no ground solar
QSolAbsorbed = TopSolarAbs*(MAX(ThisSolarDirCosVert,0.0d0)*ThisBeamSolarRad + ThisDifSolarRad)
! solve for temperature
TempTop = (FluxTop + ConvCoef*ExternalTemp + RadCoef*ThisSkyTemp + QSolAbsorbed)/ &
(ConvCoef + RadCoef)
END SUBROUTINE CalcTopSurfTemp