Soil Water Balance (SWB2)
Loading...
Searching...
No Matches
solar_calculations Module Reference

Functions/Subroutines

real(c_double) function daylight_hours (domega_s)
 Calculate the number of daylight hours at a location.
elemental real(c_double) function extraterrestrial_radiation__ra (dlatitude, ddelta, domega_s, ddsubr)
 Calculate extraterrestrial radiation given latitude and time of year.
real(c_double) function net_shortwave_radiation__rns (drs, dalbedo)
 Calculate net shortwave radiation.
elemental real(c_double) function solar_declination_simple__delta (idayofyear, inumdaysinyear)
 Calculate the solar declination for a given day of the year.
elemental real(c_double) function solar_declination__delta (idayofyear, inumdaysinyear)
 Calculate the solar declination for a given day of the year.
elemental real(c_double) function relative_earth_sun_distance__d_r (idayofyear, inumdaysinyear)
 Calculate the inverse relative Earth-Sun distance for a given day of the year.
elemental real(c_double) function sunrise_sunset_angle__omega_s (dlatitude, ddelta)
 Calculate sunrise/sunset angle, in RADIANS.
real(c_double) function solar_radiation_hargreaves__rs (dra, ftmin, ftmax)
 Calculate shortwave solar radiation.
elemental real(c_float) function estimate_percent_of_possible_sunshine__psun (ftmax, ftmin)
 Estimate percent of possible sunshine.
real(c_double) function clear_sky_solar_radiation__rso (dra, das, dbs)
 Calculate clear sky solar radiation.
real(c_double) function clear_sky_solar_radiation_noab__rso (dra, felevation)
 Calculate the clear sky solar radiation.
elemental real(c_double) function solar_radiation__rs (dra, das, dbs, fpctsun)
 Calculate solar radiation by means of the Angstrom formula.
elemental real(c_double) function net_longwave_radiation__rnl (ftmin, ftmax, drs, drso)
 Calculate net longwave radiation flux.
elemental real(c_double) function day_angle__gamma (idayofyear, inumdaysinyear)
 Calculate the day angle in RADIANS.
real(c_double) function solar_altitude__alpha (dtheta_z)
 Calculate the solar altitude given the zenith angle.
real(c_double) function zenith_angle__theta_z (dlatitude, ddelta, domega)
 Calculate solar zenith angle given latitude, declination, and (optionally) hour angle.
real(c_double) function azimuth_angle__psi (ralpha, rlatitude, rdelta)
 Calculate solar azimuth angle.

Variables

real(c_float) earth_sun_dist_dr
real(c_float) solar_declination_delta

Function/Subroutine Documentation

◆ azimuth_angle__psi()

real (c_double) function solar_calculations::azimuth_angle__psi ( real (c_double), intent(in) ralpha,
real (c_double), intent(in) rlatitude,
real (c_double), intent(in) rdelta )

Calculate solar azimuth angle.

Parameters
[in]rAlphaSolar altitude angle, in RADIANS.
[in]rLatitudeLatitude of location for which estimate is being made, in RADIANS.
[in]rDeltaSolar declination angle, in RADIANS.
Return values
rPsiSolar azimuth angle, in RADIANS.
Note
Implementation follows equation 1.5.2a in Iqbal (1983).
Reference: Iqbal, Muhammad (1983-09-28). An Introduction To Solar Radiation (p. 15). Elsevier Science. Kindle Edition.

Definition at line 597 of file solar_calculations.F90.

◆ clear_sky_solar_radiation__rso()

real (c_double) function solar_calculations::clear_sky_solar_radiation__rso ( real (c_double), intent(in) dra,
real (c_double), intent(in), optional das,
real (c_double), intent(in), optional dbs )

Calculate clear sky solar radiation.

Calculate the clear sky solar radiation (i.e. when rPctSun = 100, n/N=1. Required for computing net longwave radiation.

Parameters
[in]dRaExtraterrestrial radiation, in MJ / m**2 / day
[in]dAsSolar radiation regression constant, expressing the fraction of extraterrestrial radiation that reaches earth on OVERCAST days.
[in]sBsSolar radiation regression constant. As + Bs express the fraction of extraterrestrial radiation that reaches earth on CLEAR days.
Return values
dRsoClear sky solar radiation, in MJ / m**2 / day
Note
Implementation follows equation 36, Allen and others (1998).
Reference: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 349 of file solar_calculations.F90.

◆ clear_sky_solar_radiation_noab__rso()

real (c_double) function solar_calculations::clear_sky_solar_radiation_noab__rso ( real (c_double), intent(in) dra,
real (c_float), intent(in) felevation )

Calculate the clear sky solar radiation.

Calculate the clear sky solar radiation (i.e. when rPctSun = 100, n/N=1. Required for computing net longwave radiation. For use when no regression coefficients (A, B) are known.

Parameters
[in]dRaExtraterrestrial radiation, in MJ / m**2 / day
[in]fElevationElevation, in METERS above sea level
Return values
dRsoClear sky solar radiation, in MJ / m**2 / day
Note
Implementation follows equation 37, Allen and others (1998).
Reference: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 397 of file solar_calculations.F90.

◆ day_angle__gamma()

elemental real (c_double) function solar_calculations::day_angle__gamma ( integer (c_int), intent(in) idayofyear,
integer (c_int), intent(in) inumdaysinyear )

Calculate the day angle in RADIANS.

This function expresses the integer day number as an angle (in radians). Output values range from 0 (on January 1st) to just less than \( 2\pi \) on December 31st.

Parameters
[in]iDayOfYearCurrent day of the year.
[in]iNumDaysInYearNumber of days in the current year.
Return values
dGammaDay angle in RADIANS.
Note
Implementation follows equation 1.2.2 in Iqbal (1983)
Reference: Iqbal, Muhammad (1983-09-28). An Introduction To Solar Radiation (p. 3). Elsevier Science. Kindle Edition.

Definition at line 503 of file solar_calculations.F90.

◆ daylight_hours()

real (c_double) function solar_calculations::daylight_hours ( real (c_double), intent(in) domega_s)

Calculate the number of daylight hours at a location.

Parameters
[in]dOmega_sSunset hour angle in Radians.
Return values
rNNumber of daylight hours.
Note
Implementation follows equation 34, Allen and others (1998).
Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 24 of file solar_calculations.F90.

◆ estimate_percent_of_possible_sunshine__psun()

elemental real (c_float) function solar_calculations::estimate_percent_of_possible_sunshine__psun ( real (c_float), intent(in) ftmax,
real (c_float), intent(in) ftmin )

Estimate percent of possible sunshine.

This function follows from equation 5 in "The Rational Use of the FAO Blaney-Criddle substituting the rearranged Hargreaves solar radiation formula into equation 5 results in the formulation below

Parameters
[in]fTMaxMaximum daily air temperature, in °K
[in]fTMinMinimum daily air temperature, in °K
Return values
fPsunPercentage of possible sunshine, dimensionless percentage
Todo
[Need to add reference here...]

Definition at line 307 of file solar_calculations.F90.

◆ extraterrestrial_radiation__ra()

elemental real (c_double) function solar_calculations::extraterrestrial_radiation__ra ( real (c_double), intent(in) dlatitude,
real (c_double), intent(in) ddelta,
real (c_double), intent(in) domega_s,
real (c_double), intent(in) ddsubr )

Calculate extraterrestrial radiation given latitude and time of year.

Parameters
[in]dLatitudeLatitude of grid cell in RADIANS.
[in]dDeltaSolar declination in RADIANS.
[in]dOmega_sSunset hour angle in RADIANS.
[in]dDsubRInverse relative distance Earth-Sun.
Return values
rRaExtraterrestrial radiation in MJ / m**2 / day.
Note
1 MJ = 1e6 Joules; 1 Joule = 1 Watt / sec.
Therefore, multiply by 1e6 and divide by 86400 to get W/m*2-day.
Source Equation 21, Allen and others (1998).
Reference Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.
See also
http://www.fao.org/docrep/x0490e/x0490e07.htm#solar%20radiation

Definition at line 76 of file solar_calculations.F90.

◆ net_longwave_radiation__rnl()

elemental real(c_double) function solar_calculations::net_longwave_radiation__rnl ( real(c_float), intent(in) ftmin,
real(c_float), intent(in) ftmax,
real(c_double), intent(in) drs,
real(c_double), intent(in) drso )

Calculate net longwave radiation flux.

Parameters
[in]fTMinMinimum daily air temperature, in °C
[in]fTMaxMaximum daily air temperature, in °C
[in]dRsMeasured or calculated shortwave solar radiation, in MJ / m**2 / day
[in]dRsoCalculated clear-sky radiation, in MJ / m**2 / day
Return values
dRnlNet longwave solar radiation flux (incoming minus outgoing), in MJ / m**2 / day
Note
Implementation follows equation 39, Allen and others (1998).
Reference: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 459 of file solar_calculations.F90.

Here is the call graph for this function:

◆ net_shortwave_radiation__rns()

real(c_double) function solar_calculations::net_shortwave_radiation__rns ( real(c_double), intent(in) drs,
real(c_double), intent(in) dalbedo )

Calculate net shortwave radiation.

Parameters
[in]dRsIncoming shortwave solar radiation, in MJ / m**2 / day
[in]dAlbedoAlbedo or canopy reflection coefficient; 0.23 for grass reference crop
Return values
dRnsNet shortwave radiation, in MJ / m**2 / day
Note
Implementation follows equation 38, Allen and others (1998).
Reference: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 112 of file solar_calculations.F90.

◆ relative_earth_sun_distance__d_r()

elemental real (c_double) function solar_calculations::relative_earth_sun_distance__d_r ( integer (c_int), intent(in) idayofyear,
integer (c_int), intent(in) inumdaysinyear )

Calculate the inverse relative Earth-Sun distance for a given day of the year.

Parameters
[in]iDayOfYearInteger day of the year (January 1 = 1)
[in]iNumDaysInYearNumber of days in the current year
Return values
dDsubRRelative Earth-Sun distance
Note
Implementation follows equation 23, Allen and others (1998):
\( d_r = 1 + 0.033 \cos \left( \frac{ 2 \pi }{365} J \right) \)

where:
\( d_r \) is the inverse relative distance between Earth and the Sun
\( J \) is the current day of the year
References: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.
Duffie, J.A., Beckman, W.A. Solar Engineering of Thermal Processes. New York: Wiley, 1980.
Equation 1.2.3 in Iqbal, Muhammad (1983-09-28). An Introduction To Solar Radiation (p. 28). Elsevier Science. Kindle Edition.

Definition at line 214 of file solar_calculations.F90.

◆ solar_altitude__alpha()

real (c_double) function solar_calculations::solar_altitude__alpha ( real (c_double), intent(in) dtheta_z)

Calculate the solar altitude given the zenith angle.

Parameters
[in]rTheta_zSolar zenith angle for given location and time, in RADIANS
Return values
rAlphaSolar altitude angle for given location and time, in RADIANS

Definition at line 522 of file solar_calculations.F90.

◆ solar_declination__delta()

elemental real (c_double) function solar_calculations::solar_declination__delta ( integer (c_int), intent(in) idayofyear,
integer (c_int), intent(in) inumdaysinyear )

Calculate the solar declination for a given day of the year.

Parameters
[in]iDayOfYearInteger day of the year (January 1 = 1)
[in]iNumDaysInYearNumber of days in the current year
Return values
dDeltaSolar declination, in RADIANS
Note
Implementation follows equation 1.3.1 in Iqbal (1983).
Iqbal (1983) reports maximum error of 0.0006 radians; if the last two terms are omitted, the reported accuracy drops to 0.0035 radians.
Reference: Iqbal, Muhammad (1983-09-28). An Introduction To Solar Radiation (p. 10). Elsevier Science. Kindle Edition.

Definition at line 167 of file solar_calculations.F90.

Here is the call graph for this function:

◆ solar_declination_simple__delta()

elemental real (c_double) function solar_calculations::solar_declination_simple__delta ( integer (c_int), intent(in) idayofyear,
integer (c_int), intent(in) inumdaysinyear )

Calculate the solar declination for a given day of the year.

Parameters
[in]iDayOfYearInteger day of the year (January 1 = 1)
[in]iNumDaysInYearNumber of days in the current year
Return values
dDeltaSolar declination, in RADIANS
Note
Implementation follows equation XXX? in:
Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 138 of file solar_calculations.F90.

◆ solar_radiation__rs()

elemental real (c_double) function solar_calculations::solar_radiation__rs ( real (c_double), intent(in) dra,
real (c_double), intent(in) das,
real (c_double), intent(in) dbs,
real (c_double), intent(in) fpctsun )

Calculate solar radiation by means of the Angstrom formula.

Parameters
[in]dRaExtraterrestrial radiation in MJ / m**2 / day
[in]dAsSolar radiation regression constant, expressing the fraction of extraterrestrial radiation that reaches earth on OVERCAST days.
[in]dBsSolar radiation regression constant. As + Bs express the fraction of extraterrestrial radiation that reaches earth on CLEAR days.
[in]fPctSunPercent of TOTAL number of sunshine hours during which the sun actually shown.
Return values
fRsSolar radiation in MJ / m**2 / day

@notes Implementation follows equation 35, Allen and others (1998).

Reference: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 428 of file solar_calculations.F90.

◆ solar_radiation_hargreaves__rs()

real (c_double) function solar_calculations::solar_radiation_hargreaves__rs ( real (c_double), intent(in) dra,
real (c_float), intent(in) ftmin,
real (c_float), intent(in) ftmax )

Calculate shortwave solar radiation.

Calculates the solar radiation using Hargreave's radiation formula. For use when percent possible daily sunshine value is not available.

Parameters
[in]dRaExtraterrestrial radiation, in MJ / m**2 / day
[in]rTMinMinimum daily air temperature, in °C
[in]rTMaxMaximum daily air temperature, in °C
Return values
dRaSolar radiation, in MJ / m**2 / day
Note
Implementation follows equation 50, Allen and others (1998).
Reference: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 274 of file solar_calculations.F90.

◆ sunrise_sunset_angle__omega_s()

elemental real (c_double) function solar_calculations::sunrise_sunset_angle__omega_s ( real (c_double), intent(in) dlatitude,
real (c_double), intent(in) ddelta )

Calculate sunrise/sunset angle, in RADIANS.

Parameters
[in]dLatitudeLatitude, in RADIANS
[in]dDeltaSolar declination, in RADIANS
Return values
dOmega_sSunset angle, in RADIANS
Note
Implementation follows equation 25, Allen and others (1998).
Hour angle is zero at solar noon. Definition in Iqbal (1983) yields positive values before solar noon, and negative values following solar noon.
Reference: Allen, R.G., and others, 1998, FAO Irrigation and Drainage Paper No. 56, "Crop Evapotranspiration (Guidelines for computing crop water requirements)", Food and Agriculture Organization, Rome, Italy.

Definition at line 245 of file solar_calculations.F90.

◆ zenith_angle__theta_z()

real (c_double) function solar_calculations::zenith_angle__theta_z ( real (c_double), intent(in) dlatitude,
real (c_double), intent(in) ddelta,
real (c_double), intent(in), optional domega )

Calculate solar zenith angle given latitude, declination, and (optionally) hour angle.

Calculate solar zenith. Solar zenith angle is the angle between a point directly overhead and the center of the sun's disk.

Parameters
[in]rLatitudeLatitude of location for which estimate is being made, in RADIANS
[in]rDeltaSolar declination angle, in RADIANS
[in]rOmega[OPTIONAL] Hour angle, measured at the celestial pole between the observer's meridian and the solar meridian, in RADIANS.
Return values
rTheta_zSolar zenith angle for given location and time, in RADIANS
Note
Implementation follows equation 9.67, Jacobson, 2005
Reference: Jacobson, M.Z., 2005, Fundamentals of atmospheric modeling, Second Edition: Cambridge University Press.

Definition at line 557 of file solar_calculations.F90.

Variable Documentation

◆ earth_sun_dist_dr

real (c_float) solar_calculations::earth_sun_dist_dr

Definition at line 9 of file solar_calculations.F90.

◆ solar_declination_delta

real (c_float) solar_calculations::solar_declination_delta

Definition at line 10 of file solar_calculations.F90.