ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/gendaymtx.c
(Generate patch)

Comparing ray/src/gen/gendaymtx.c (file contents):
Revision 2.41 by greg, Wed Feb 26 20:39:28 2025 UTC vs.
Revision 2.42 by greg, Thu Feb 27 19:00:00 2025 UTC

# Line 501 | Line 501 | main(int argc, char *argv[])
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;
# Line 524 | Line 532 | main(int argc, char *argv[])
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  
# Line 549 | Line 557 | main(int argc, char *argv[])
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 */
# Line 710 | Line 712 | ComputeSky(float *parr)
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines