|
@@ -6,7 +6,7 @@ a new version of r.sun was prepared using ESRA solar radiation formulas.
|
|
|
See manual pages for details.
|
|
|
(C) 2002 Copyright Jaro Hofierka, Gresaka 22, 085 01 Bardejov, Slovakia,
|
|
|
and GeoModel, s.r.o., Bratislava, Slovakia
|
|
|
-email: hofierka@geomodel.sk,marcel.suri@jrc.it,suri@geomodel.sk
|
|
|
+email: hofierka@geomodel.sk, marcel.suri@jrc.it, suri@geomodel.sk
|
|
|
*******************************************************************************/
|
|
|
/*
|
|
|
* This program is free software; you can redistribute it and/or
|
|
@@ -102,7 +102,7 @@ void setHorizonInterval(double val)
|
|
|
}
|
|
|
|
|
|
|
|
|
-/* com_sol_const(): compute the solar constant corrected for the day of the
|
|
|
+/* com_sol_const(): compute the Solar Constant corrected for the day of the
|
|
|
year. The Earth is closest to the Sun (Perigee) on about January 3rd,
|
|
|
it is furthest from the sun (Apogee) about July 6th. The 1367 W/m^2 solar
|
|
|
constant is at the average 1AU distance, but on Jan 3 it gets up to
|
|
@@ -163,12 +163,12 @@ void com_par_const(double longitTime, struct SunGeometryConstDay *sungeom,
|
|
|
}
|
|
|
else {
|
|
|
if (pom < 0) {
|
|
|
- /* G_debug(3,"\n Sun is ABOVE the surface during the whole day"); */
|
|
|
+ /* G_debug(3,"\n Sun is ABOVE the surface during the whole day"); */
|
|
|
sungeom->sunrise_time = 0;
|
|
|
sungeom->sunset_time = 24;
|
|
|
}
|
|
|
else {
|
|
|
- /* G_debug(3,"\n The sun is BELOW the surface during the whole day"); */
|
|
|
+ /* G_debug(3,"\n The sun is BELOW the surface during the whole day"); */
|
|
|
if (fabs(pom) - 1 <= EPS) {
|
|
|
sungeom->sunrise_time = 12;
|
|
|
sungeom->sunset_time = 12;
|
|
@@ -210,7 +210,7 @@ void com_par(struct SunGeometryConstDay *sungeom,
|
|
|
if (fabs(sungeom->lum_C31) < EPS) {
|
|
|
if (fabs(sunVarGeom->sinSolarAltitude) >= EPS) {
|
|
|
if (sunVarGeom->sinSolarAltitude > 0) {
|
|
|
- /* G_debug(3,"\tSun is ABOVE area during the whole day"); */
|
|
|
+ /* G_debug(3,"\tSun is ABOVE area during the whole day"); */
|
|
|
sungeom->sunrise_time = 0;
|
|
|
sungeom->sunset_time = 24;
|
|
|
}
|
|
@@ -238,7 +238,7 @@ void com_par(struct SunGeometryConstDay *sungeom,
|
|
|
if (fabs(pom) > EPS) {
|
|
|
sunVarGeom->solarAzimuth = lum_Ly / pom;
|
|
|
sunVarGeom->solarAzimuth = acos(sunVarGeom->solarAzimuth); /* horiz. angle of the Sun */
|
|
|
- /* solarAzimuth *= RAD; */
|
|
|
+ /* solarAzimuth *= RAD; */
|
|
|
if (lum_Lx < 0)
|
|
|
sunVarGeom->solarAzimuth = pi2 - sunVarGeom->solarAzimuth;
|
|
|
}
|
|
@@ -464,7 +464,7 @@ double brad(double sh, double *bh, struct SunGeometryVarDay *sunVarGeom,
|
|
|
|
|
|
locSolarAltitude = sunVarGeom->solarAltitude;
|
|
|
|
|
|
-
|
|
|
+/* FIXME: please document all coefficients */
|
|
|
elevationCorr = exp(-sunVarGeom->z_orig / 8434.5);
|
|
|
temp1 = 0.1594 + locSolarAltitude * (1.123 + 0.065656 * locSolarAltitude);
|
|
|
temp2 = 1. + locSolarAltitude * (28.9344 + 277.3971 * locSolarAltitude);
|
|
@@ -510,7 +510,7 @@ double brad_angle_loss(double sh, double *bh,
|
|
|
|
|
|
locSolarAltitude = sunVarGeom->solarAltitude;
|
|
|
|
|
|
-
|
|
|
+/* FIXME: please document all coefficients */
|
|
|
p = exp(-sunVarGeom->z_orig / 8434.5);
|
|
|
temp1 = 0.1594 + locSolarAltitude * (1.123 + 0.065656 * locSolarAltitude);
|
|
|
temp2 = 1. + locSolarAltitude * (28.9344 + 277.3971 * locSolarAltitude);
|
|
@@ -563,6 +563,7 @@ double drad(double sh, double bh, double *rr,
|
|
|
cosslope = cos(sunSlopeGeom->slope);
|
|
|
sinslope = sin(sunSlopeGeom->slope);
|
|
|
|
|
|
+/* FIXME: please document all coefficients */
|
|
|
tn = -0.015843 + locLinke * (0.030543 + 0.0003797 * locLinke);
|
|
|
A1b = 0.26463 + locLinke * (-0.061581 + 0.0031408 * locLinke);
|
|
|
if (A1b * tn < 0.0022)
|
|
@@ -635,7 +636,7 @@ double drad_angle_loss(double sh, double bh, double *rr,
|
|
|
cosslope = cos(sunSlopeGeom->slope);
|
|
|
sinslope = sin(sunSlopeGeom->slope);
|
|
|
|
|
|
-
|
|
|
+/* FIXME: please document all coefficients */
|
|
|
tn = -0.015843 + locLinke * (0.030543 + 0.0003797 * locLinke);
|
|
|
A1b = 0.26463 + locLinke * (-0.061581 + 0.0031408 * locLinke);
|
|
|
|
|
@@ -682,7 +683,7 @@ double drad_angle_loss(double sh, double bh, double *rr,
|
|
|
/* refl. rad */
|
|
|
*rr = sunRadVar->alb * gh * (1 - cosslope) / 2.;
|
|
|
}
|
|
|
- else { /* plane */
|
|
|
+ else { /* plane */
|
|
|
dr = dh;
|
|
|
*rr = 0.;
|
|
|
}
|