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.14 by greg, Fri May 30 00:00:54 2014 UTC vs.
Revision 2.20 by greg, Sat Aug 1 23:27:04 2015 UTC

# Line 86 | Line 86 | static const char RCSid[] = "$Id$";
86   #include <string.h>
87   #include <ctype.h>
88   #include "rtmath.h"
89 + #include "resolu.h"
90   #include "platform.h"
91   #include "color.h"
92 + #include "resolu.h"
93  
94   char *progname;                                                         /* Program name */
95   char errmsg[128];                                                       /* Error message buffer */
# Line 319 | Line 321 | main(int argc, char *argv[])
321          int     dir_is_horiz;           /* direct is meas. on horizontal? */
322          float   *mtx_data = NULL;       /* our matrix data */
323          int     ntsteps = 0;            /* number of rows in matrix */
324 +        int     step_alloc = 0;
325          int     last_monthly = 0;       /* month of last report */
326          int     mo, da;                 /* month (1-12) and day (1-31) */
327          double  hr;                     /* hour (local standard time) */
# Line 391 | Line 394 | main(int argc, char *argv[])
394                          break;
395                  case '5':                       /* 5-phase calculation */
396                          nsuns = 1;
397 <                        fixed_sun_sa = 6.797e-05;
397 >                        fixed_sun_sa = PI/360.*atof(argv[++i]);
398 >                        fixed_sun_sa *= fixed_sun_sa*PI;
399                          break;
400                  default:
401                          goto userr;
# Line 460 | Line 464 | main(int argc, char *argv[])
464                  double          sda, sta;
465                                          /* make space for next time step */
466                  mtx_offset = 3*nskypatch*ntsteps++;
467 <                mtx_data = resize_dmatrix(mtx_data, ntsteps, nskypatch);
467 >                if (ntsteps > step_alloc) {
468 >                        step_alloc += (step_alloc>>1) + ntsteps + 7;
469 >                        mtx_data = resize_dmatrix(mtx_data, step_alloc, nskypatch);
470 >                }
471                  if (dif <= 1e-4) {
472                          memset(mtx_data+mtx_offset, 0, sizeof(float)*3*nskypatch);
473                          continue;
# Line 515 | Line 522 | main(int argc, char *argv[])
522                  printf("NROWS=%d\n", nskypatch);
523                  printf("NCOLS=%d\n", ntsteps);
524                  printf("NCOMP=3\n");
525 <                fputformat(getfmtname(outfmt), stdout);
525 >                fputformat((char *)getfmtname(outfmt), stdout);
526                  putchar('\n');
527          }
528                                          /* patches are rows (outer sort) */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines