Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | ISky | ||||
real(kind=r64) | :: | THSKY | ||||
real(kind=r64) | :: | PHSKY |
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 DayltgSkyLuminance(ISky, THSKY, PHSKY)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Winkelmann
! DATE WRITTEN July 1997
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Called by CalcDayltgCoefficients, DayltgExtHorizIllum AND DayltgInterReflectedIllum. gives
! luminance in cd/m2 for four different sky types, as described in R.Perez, P.Ineichen,
! R.Seals, J.Michalsky and R.Stewart, "Modeling daylight availability and irradiance
! components from direct and global irradiance," Solar Energy 44, 1990, 271-289.
! The luminance distributions in this routine are normalized such that
! the zenith luminance is 1.0, i.e., DayltgSkyLuminance =
! (sky luminance at THSKY, PHSKY)/(zenith luminance), which is dimensionless.
! The sky types are:
! 1. Standard CIE clear sky
! 2. Standard CIE high-turbidity clear sky
! 3. CIE intermediate sky
! 4. CIE overcast sky
! METHODOLOGY EMPLOYED:
! REFERENCES:
! Based on DOE-2.1E subroutine DSKYLU, which did only clear and overcast skies.
! OTHER NOTES:
! THSKY ranges from 0 to 2Pi starting with 0 directly East and rotating clockwise.
! PHSKY ranges from 0 to Pi starting with 0 at the horizon and Pi/2 at the zenith.
! USE STATEMENTS: na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER :: ISky ! Sky type: 1=clear, 2=clear turbid, 3=intermediate, 4=overcast
REAL(r64) :: THSKY,PHSKY ! Azimuth and altitude of sky element (radians)
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: SPHSKY ! Sine of PHSKY
REAL(r64) :: G ! Angle between sun and element of sky (radians)
REAL(r64) :: COSG ! Cosine of G
REAL(r64) :: Z ! Solar zenith angle (radians)
REAL(r64) :: Z1,Z2,Z3,Z4 ! Luminance factors (intermediate variables)
REAL(r64) :: DayltgSkyLuminance ! Luminance of sky element divided by zenith luminance
! FLOW:
SPHSKY = MAX(SIN(PHSKY),0.01d0) ! Prevent floating point underflows
Z = PIOVR2 - PHSUN
IF (ISky >= 1 .AND. ISky <= 3) THEN ! Following not needed for overcast sky
COSG = SPHSKY * SPHSUN + COS(PHSKY) * CPHSUN * COS(THSKY - THSUN)
COSG = MAX(constant_minusone,MIN(COSG,1.0d0)) ! Prevent out of range due to roundoff
G = ACOS(COSG)
END IF
SELECT CASE(ISky)
CASE(1) ! Clear Sky
Z1 = 0.910d0 + 10.d0 * EXP(-3.d0 * G) + 0.45d0 * COSG * COSG
Z2 = 1.d0 - EXP(-0.32d0 / SPHSKY)
Z3 = 0.27385d0 * (0.91d0 + 10.d0 * EXP(-3.d0 * Z) + 0.45d0 * SPHSUN * SPHSUN)
DayltgSkyLuminance = Z1 * Z2 / Z3
CASE(2) ! Clear turbid sky
Z1 = 0.856d0 + 16.d0 * EXP(-3.d0 * G) + 0.3d0 * COSG * COSG
Z2 = 1.d0 - EXP(-0.32d0 / SPHSKY)
Z3 = 0.27385d0 * (0.856d0 + 16.d0 * EXP(-3.d0 * Z) + 0.3d0 * SPHSUN * SPHSUN)
DayltgSkyLuminance = Z1 * Z2 / Z3
CASE(3) ! Intermediate sky
Z1 = (1.35d0 * (SIN(3.59d0 * PHSKY - 0.009d0) + 2.31d0) * SIN(2.6d0 * PHSUN + 0.316d0) + PHSKY + 4.799d0) / 2.326d0
Z2 = EXP(-G * 0.563d0 * ((PHSUN - 0.008d0) * (PHSKY + 1.059d0) + 0.812d0))
Z3 = 0.99224d0 * SIN(2.6d0 * PHSUN + 0.316d0) + 2.73852d0
Z4 = EXP(-Z * 0.563d0 * ((PHSUN - 0.008d0) * 2.6298d0 + 0.812d0))
DayltgSkyLuminance = Z1 * Z2 / (Z3 * Z4)
CASE(4) ! Overcast sky
DayltgSkyLuminance = (1.0d0 + 2.0d0 * SPHSKY) / 3.0d0
END SELECT
RETURN
END FUNCTION DayltgSkyLuminance