521 |
|
/* Calculate atmospheric precipitable water content */ |
522 |
|
apwc = CalcPrecipWater(dew_point); |
523 |
|
|
524 |
< |
/* Limit solar altitude to keep circumsolar off zenith */ |
525 |
< |
if (altitude > DegToRad(87.0)) |
526 |
< |
altitude = DegToRad(87.0); |
527 |
< |
|
528 |
< |
/* Calculate sun zenith angle */ |
529 |
< |
sun_zenith = DegToRad(90.0) - altitude; |
524 |
> |
/* Calculate sun zenith angle (don't let it dip below horizon) */ |
525 |
> |
/* Also limit minimum angle to keep circumsolar off zenith */ |
526 |
> |
if (altitude <= 0.0) |
527 |
> |
sun_zenith = DegToRad(90.0); |
528 |
> |
else if (altitude >= DegToRad(87.0)) |
529 |
> |
sun_zenith = DegToRad(3.0); |
530 |
> |
else |
531 |
> |
sun_zenith = DegToRad(90.0) - altitude; |
532 |
|
|
533 |
|
/* Compute the inputs for the calculation of the sky distribution */ |
534 |
|
|