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.43 by greg, Fri Jun 6 19:11:21 2025 UTC

# Line 83 | Line 83 | static const char RCSid[] = "$Id$";
83   #define _USE_MATH_DEFINES
84   #include <stdlib.h>
85   #include <ctype.h>
86 + #include "paths.h"
87   #include "platform.h"
88   #include "rtmath.h"
89   #include "rtio.h"
# Line 90 | Line 91 | static const char RCSid[] = "$Id$";
91   #include "sun.h"
92   #include "loadEPW.h"
93  
93 char *progname;                                 /* Program name */
94   const double DC_SolarConstantE = 1367.0;        /* Solar constant W/m^2 */
95   const double DC_SolarConstantL = 127.5;         /* Solar constant klux */
96  
# Line 332 | Line 332 | main(int argc, char *argv[])
332          int     i, j;
333          double  timeinterval = 0;
334  
335 <        progname = argv[0];
335 >        fixargv0(argv[0]);
336                                          /* get options */
337          for (i = 1; i < argc && argv[i][0] == '-'; i++)
338                  switch (argv[i][1]) {
# 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