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.44 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 90 | Line 90 | static const char RCSid[] = "$Id$";
90   #include "sun.h"
91   #include "loadEPW.h"
92  
93 char *progname;                                 /* Program name */
93   const double DC_SolarConstantE = 1367.0;        /* Solar constant W/m^2 */
94   const double DC_SolarConstantL = 127.5;         /* Solar constant klux */
95  
# Line 332 | Line 331 | main(int argc, char *argv[])
331          int     i, j;
332          double  timeinterval = 0;
333  
334 <        progname = argv[0];
334 >        fixargv0(argv[0]);
335                                          /* get options */
336          for (i = 1; i < argc && argv[i][0] == '-'; i++)
337                  switch (argv[i][1]) {
# Line 501 | Line 500 | main(int argc, char *argv[])
500          dpthist[0] = -100;
501                                          /* process each time step in tape */
502          while ((j = EPWread(epw, &erec)) > 0) {
503 <                int             mo = erec.date.month+1;
504 <                int             da = erec.date.day;
505 <                double          hr = erec.date.hour;
503 >                const int       mo = erec.date.month+1;
504 >                const int       da = erec.date.day;
505 >                const double    hr = erec.date.hour;
506                  double          sda, sta, st;
507                  int             sun_in_sky;
508 +                                        /* 3-hour dew point temp */
509 +                if (EPWisset(&erec,dptemp)) {
510 +                        if (dpthist[0] < -99)
511 +                                dpthist[0] = dpthist[1] = erec.dptemp;
512 +                        dew_point = (1./3.)*(dpthist[0] + dpthist[1] + erec.dptemp);
513 +                        dpthist[0] = dpthist[1]; dpthist[1] = erec.dptemp;
514 +                } else
515 +                        dpthist[0] = -100;
516                                          /* compute solar position */
517                  if ((mo == 2) & (da == 29)) {
518                          julian_date = 60;
# Line 524 | Line 531 | main(int argc, char *argv[])
531                  }
532                  altitude = salt(sda, st);
533                  sun_in_sky = (altitude > -DegToRad(SUN_ANG_DEG/2.));
534 <                if (sun_hours_only && !sun_in_sky)
534 >                if (sun_hours_only & !sun_in_sky)
535                          continue;       /* skipping nighttime points */
536                  azimuth = sazi(sda, st) + PI - DegToRad(rotation);
537  
# Line 549 | Line 556 | main(int argc, char *argv[])
556                          dif = erec.diffillum;
557                          break;
558                  }
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                }
559                  mtx_offset = 3*nskypatch*nstored;
560                  nstored += !avgSky | !nstored;
561                                          /* make space for next row */
# Line 710 | Line 711 | ComputeSky(float *parr)
711          int index;                      /* Category index */
712          double norm_diff_illum;         /* Normalized diffuse illuimnance */
713          int i;
714 <        
714 >
715          /* Calculate atmospheric precipitable water content */
716          apwc = CalcPrecipWater(dew_point);
717  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines