libTheSky
Routines to compute sky positions of Sun, Moon, planets and more
All Namespaces Files Functions Variables Pages
thesky_daylight Module Reference

Daylight procedures. More...

Functions/Subroutines

real(double) function extinction_sun_airmass (airmass)
 Compute an approximation for the bolometric atmospheric extinction factor for the Sun with a given air mass.
 
real(double) function extinction_sun (alt)
 Compute an approximation for the bolometric atmospheric extinction factor for the Sun with a given altitude.
 
subroutine solar_radiation (alt, beam_norm, beam_horiz)
 Compute the normal and horizontal beam (direct) solar radiation for a given altitude of the Sun, assuming a cloudless sky (and sea level)
 
subroutine clearsky_bird (alt, io, rsun, press, uo, uw, ta5, ta3, ba, k1, rg, itot, idir, idif, igr)
 A simplified clear-sky model for direct and diffuse insolation on horizontal surfaces (a.k.a. as the Bird model)
 
subroutine diffuse_radiation_perez87 (doy, alt, surfincl, theta, gbeam_n, gdif_hor, gdif_inc, gdif_inc_is, gdif_inc_cs, gdif_inc_hz)
 Compute diffuse radiation on an inclined surface using the older (1987) Perez model.
 
real(double) function project_sunlight_on_surface (beta, gamma, sunaz, sunalt)
 Compute the projection factor of direct solar radiation (DNI) on a (sloped) surface.
 

Detailed Description

Daylight procedures.

Function/Subroutine Documentation

◆ clearsky_bird()

subroutine thesky_daylight::clearsky_bird ( real(double), intent(in) alt,
real(double), intent(in), optional io,
real(double), intent(in), optional rsun,
real(double), intent(in), optional press,
real(double), intent(in), optional uo,
real(double), intent(in), optional uw,
real(double), intent(in), optional ta5,
real(double), intent(in), optional ta3,
real(double), intent(in), optional ba,
real(double), intent(in), optional k1,
real(double), intent(in), optional rg,
real(double), intent(out), optional itot,
real(double), intent(out), optional idir,
real(double), intent(out), optional idif,
real(double), intent(out), optional igr )

A simplified clear-sky model for direct and diffuse insolation on horizontal surfaces (a.k.a. as the Bird model)

Parameters
altSun altitude above the horizon (rad)
IoSolar 'constant' (W/m^2 - optional, default: 1361.5)
RsunSun distance (AU - optional, default: 1)
PressAir pressure at the observer's site, corrected for altitude (hPa - optional, default: 1013)
UoOzone abundance in a vertical column (cm - optional, default: 0.34)
UwPercipitable water-vapor abundance in a vertical column (cm - optional, default: 1.42)
Ta5Aerosol optical depth from surface in vertical path at 500 nm (optional, default: 0.2661)
Ta3Aerosol optical depth from surface in vertical path at 380 nm (optional, default: 0.3538)
BaAerosol forward-scattering ratio (optional, 0.82-0.86, default: 0.84)
K1Aerosol-absorptance constant (optional, rural: 0.0933, urban: 0.385, default: 0.1)
RgGround albedo (optional, fraction - default: 0.2)
ItotTotal insolation on a horizontal surface (W/m^2 - optional) (output)
IdirDirect (beam) insolation on a horizontal surface (W/m^2 - optional) (output)
IdifDiffuse insolation on a horizontal surface (W/m^2 - optional) (output)
IgrGround-reflection insolation from a horizontal surface (W/m^2 - optional) (output)
See also
Bird & Hulstrom, A simplified clear-sky model for direct and diffuse insolation on horizontal surfaces, SERI/TR-642-761 (1981)
Note
The value of Taa does not agree with tabulated values from the paper, and hence neither do dependent values (except for AM~1). When I substitute their values for Taa, everything matches perfectly. Error in their formula, or (hopefully!) in their table?

Definition at line 165 of file daylight.f90.

◆ diffuse_radiation_perez87()

subroutine thesky_daylight::diffuse_radiation_perez87 ( integer, intent(in) doy,
real(double), intent(in) alt,
real(double), intent(in) surfincl,
real(double), intent(in) theta,
real(double), intent(in) gbeam_n,
real(double), intent(in) gdif_hor,
real(double), intent(out) gdif_inc,
real(double), intent(out), optional gdif_inc_is,
real(double), intent(out), optional gdif_inc_cs,
real(double), intent(out), optional gdif_inc_hz )

Compute diffuse radiation on an inclined surface using the older (1987) Perez model.

Parameters
DoYDay of year (Nday)
altAltitude of the Sun (radians)
surfInclSurface inclination wrt horizontal (radians) - 0 = horizontal, pi/2 = vertical
thetaAngle between surface normal vector and Sun position vector (radians)
Gbeam_nBeam (direct) normal radiation (W/m2; in the direction of the Sun)
Gdif_horDiffuse radiation on a horizontal surface (W/m2)
Gdif_incDiffuse irradiation on the inclined surface (W/m2) (output)
Gdif_inc_isDiffuse irradiation on the inclined surface - isotropic part (optional; W/m2) (output)
Gdif_inc_csDiffuse irradiation on the inclined surface - circumsolar part (optional; W/m2) (output)
Gdif_inc_hzDiffuse irradiation on the inclined surface - horizon-band part (optional; W/m2) (output)
See also
Perez et al. Solar Energy Vol. 39, Nr. 3, p. 221 (1987) - references to equations and tables are to this paper. Most equations can be found in the Nomenclature section at the end of the paper (p.230). I use a and c here, not b and d.
Todo
Implement Perez et al. Solar Energy Vol. 44, Nr. 5, p. 271 (1990)

Definition at line 284 of file daylight.f90.

◆ extinction_sun()

real(double) function thesky_daylight::extinction_sun ( real(double), intent(in) alt)

Compute an approximation for the bolometric atmospheric extinction factor for the Sun with a given altitude.

Parameters
altTRUE altitude of the Sun (radians)
Return values
extinction_sunThe approximated bolometric atmospheric extinction factor for the Sun
Note
- extinction_fac = 1: no extinction, extinction_fac > 1 extinction.
  • Hence, the flux, corrected for extinction, should be f' = f / extinction_fac(alt,ele)

Definition at line 91 of file daylight.f90.

References thesky_visibility::airmass(), extinction_sun(), and extinction_sun_airmass().

Referenced by extinction_sun(), and solar_radiation().

Here is the call graph for this function:

◆ extinction_sun_airmass()

real(double) function thesky_daylight::extinction_sun_airmass ( real(double), intent(in) airmass)

Compute an approximation for the bolometric atmospheric extinction factor for the Sun with a given air mass.

Parameters
airmassAirmass for the position of the Sun
Return values
extinction_sun_airmassThe approximated bolometric atmospheric extinction factor for the Sun
Note
- extinction_fac = 1: no extinction, extinction_fac > 1 extinction.
  • Hence, the flux, corrected for extinction, should be f' = f / extinction_fac(alt,ele)
  • Fit of the power extinction computed by the NREL SMARTS code (valid for airmass <= 38.2):
    • Gueymard, C, Professional Paper FSEC-PF-270-95, 1995
    • Gueymard, C, Solar Energy, Vol. 71, No. 5, pp. 325-346, 2001

Definition at line 48 of file daylight.f90.

References extinction_sun_airmass().

Referenced by extinction_sun(), and extinction_sun_airmass().

Here is the call graph for this function:

◆ project_sunlight_on_surface()

real(double) function thesky_daylight::project_sunlight_on_surface ( real(double), intent(in) beta,
real(double), intent(in) gamma,
real(double), intent(in) sunaz,
real(double), intent(in) sunalt )

Compute the projection factor of direct solar radiation (DNI) on a (sloped) surface.

This function returns the projection factor of direct sunlight on a surface with given orientation, useful for e.g. insolation on solar panels, solar collectors or windows. The projection factor equals the cosine of the angle between the normal vector of the surface and the position vector of the Sun.

Parameters
betaInclination angle of the surface (w.r.t. the horizontal) (radians)
gammaAzimuth angle of the surface (0=south, pi/2=west, ±pi=north, -pi/2=east) (radians)
sunAzAzimuth of the Sun (0=south, pi/2=west, ±pi=north, -pi/2=east) (radians)
sunAltApparent altitude of the Sun (radians)
Return values
project_sunlight_on_surfaceThe projection factor for direct solar radiation (DNI) on a (sloped) surface (0-1).
Note
Note that different definitions for gamma and sunAz are possible, as long as they correspond.
See also
Celestial mechanics in a nutshell, Sect. 4.3: Insolation on an inclined surface (https://CMiaNS.sf.net).

Definition at line 433 of file daylight.f90.

References project_sunlight_on_surface().

Referenced by project_sunlight_on_surface().

Here is the call graph for this function:

◆ solar_radiation()

subroutine thesky_daylight::solar_radiation ( real(double), intent(in) alt,
real(double), intent(out) beam_norm,
real(double), intent(out), optional beam_horiz )

Compute the normal and horizontal beam (direct) solar radiation for a given altitude of the Sun, assuming a cloudless sky (and sea level)

Parameters
altTRUE altitude of the Sun (radians)
beam_normNormal beam radiation, perpendicular to the position vector of the Sun (W/m2) (output)
beam_horizBeam radiation on a horizontal surface (W/m2) (output)
See also
function extinction_sun()

Definition at line 117 of file daylight.f90.

References extinction_sun().

Here is the call graph for this function: