501 |
|
dpthist[0] = -100; |
502 |
|
/* process each time step in tape */ |
503 |
|
while ((j = EPWread(epw, &erec)) > 0) { |
504 |
< |
int mo = erec.date.month+1; |
505 |
< |
int da = erec.date.day; |
506 |
< |
double hr = erec.date.hour; |
504 |
> |
const int mo = erec.date.month+1; |
505 |
> |
const int da = erec.date.day; |
506 |
> |
const double hr = erec.date.hour; |
507 |
|
double sda, sta, st; |
508 |
|
int sun_in_sky; |
509 |
+ |
/* 3-hour dew point temp */ |
510 |
+ |
if (EPWisset(&erec,dptemp)) { |
511 |
+ |
if (dpthist[0] < -99) |
512 |
+ |
dpthist[0] = dpthist[1] = erec.dptemp; |
513 |
+ |
dew_point = (1./3.)*(dpthist[0] + dpthist[1] + erec.dptemp); |
514 |
+ |
dpthist[0] = dpthist[1]; dpthist[1] = erec.dptemp; |
515 |
+ |
} else |
516 |
+ |
dpthist[0] = -100; |
517 |
|
/* compute solar position */ |
518 |
|
if ((mo == 2) & (da == 29)) { |
519 |
|
julian_date = 60; |
532 |
|
} |
533 |
|
altitude = salt(sda, st); |
534 |
|
sun_in_sky = (altitude > -DegToRad(SUN_ANG_DEG/2.)); |
535 |
< |
if (sun_hours_only && !sun_in_sky) |
535 |
> |
if (sun_hours_only & !sun_in_sky) |
536 |
|
continue; /* skipping nighttime points */ |
537 |
|
azimuth = sazi(sda, st) + PI - DegToRad(rotation); |
538 |
|
|
557 |
|
dif = erec.diffillum; |
558 |
|
break; |
559 |
|
} |
552 |
– |
if (EPWisset(&erec,dptemp)) { /* 3-hour dew point temp */ |
553 |
– |
if (dpthist[0] < -99) |
554 |
– |
dpthist[0] = dpthist[1] = erec.dptemp; |
555 |
– |
dew_point = (1./3.)*(dpthist[0] + dpthist[1] + erec.dptemp); |
556 |
– |
dpthist[0] = dpthist[1]; dpthist[1] = erec.dptemp; |
557 |
– |
} |
560 |
|
mtx_offset = 3*nskypatch*nstored; |
561 |
|
nstored += !avgSky | !nstored; |
562 |
|
/* make space for next row */ |
712 |
|
int index; /* Category index */ |
713 |
|
double norm_diff_illum; /* Normalized diffuse illuimnance */ |
714 |
|
int i; |
715 |
< |
|
715 |
> |
|
716 |
|
/* Calculate atmospheric precipitable water content */ |
717 |
|
apwc = CalcPrecipWater(dew_point); |
718 |
|
|