5 |
|
* *BOUYGUES |
6 |
|
* 1 Avenue Eugene Freyssinet, Saint-Quentin-Yvelines, France |
7 |
|
* print colored output if activated in command line (-C). Based on model from A. Diakite, TU-Berlin. Implemented by J. Wienold, August 26 2018 |
8 |
+ |
* version 2.6 (2021/01/29): dew point dependency added according to Perez publication 1990 (W -> atm_preci_water=exp(0.07*Td-0.075) ). by J. Wienold, EPFL |
9 |
|
*/ |
10 |
|
|
11 |
|
#define _USE_MATH_DEFINES |
134 |
|
double skybrightness = 0; |
135 |
|
double solarradiance; |
136 |
|
double diffuseilluminance, directilluminance, diffuseirradiance, directirradiance, globalirradiance; |
137 |
< |
double sunzenith, daynumber, atm_preci_water=2; |
137 |
> |
double sunzenith, daynumber, atm_preci_water, Td=10.97353115; |
138 |
|
|
139 |
|
/*double sunaltitude_border = 0;*/ |
140 |
|
double diffnormalization = 0; |
200 |
|
for (i = 4; i < argc; i++) |
201 |
|
if (argv[i][0] == '-' || argv[i][0] == '+') |
202 |
|
switch (argv[i][1]) { |
203 |
+ |
case 'd': |
204 |
+ |
Td = atof(argv[++i]); |
205 |
+ |
if (Td < -40 || Td > 40) { |
206 |
+ |
Td=10.97353115; } |
207 |
+ |
break; |
208 |
|
case 's': |
209 |
|
cloudy = 0; |
210 |
|
dosun = argv[i][0] == '+'; |
329 |
|
{ fprintf(stderr,"Out of memory error in function main"); return 1; } |
330 |
|
|
331 |
|
|
332 |
+ |
atm_preci_water=exp(0.07*Td-0.075); |
333 |
|
printhead(argc, argv); |
334 |
|
computesky(); |
335 |
|
printsky(); |
707 |
|
|
708 |
|
printf("# Local solar time: %.2f\n", st); |
709 |
|
printf("# Solar altitude and azimuth: %.1f %.1f\n", altitude*180/M_PI, azimuth*180/M_PI); |
710 |
+ |
printf("# epsilon, delta, atmospheric precipitable water content : %.4f %.4f %.4f \n", skyclearness, skybrightness,atm_preci_water ); |
711 |
|
|
712 |
|
|
713 |
|
if (dosun&&(skyclearness>1)) |