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 */ |
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) */ |
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 |
> |
if (fixed_sun_sa <= 0) { |
399 |
> |
fprintf(stderr, "%s: missing solar disk size argument for '-5' option\n", |
400 |
> |
argv[0]); |
401 |
> |
exit(1); |
402 |
> |
} |
403 |
> |
fixed_sun_sa *= fixed_sun_sa*PI; |
404 |
|
break; |
405 |
|
default: |
406 |
|
goto userr; |
466 |
|
s_meridian = DegToRad(s_meridian); |
467 |
|
/* process each time step in tape */ |
468 |
|
while (scanf("%d %d %lf %lf %lf\n", &mo, &da, &hr, &dir, &dif) == 5) { |
460 |
– |
static int step_alloc = 0; |
469 |
|
double sda, sta; |
470 |
|
/* make space for next time step */ |
471 |
|
mtx_offset = 3*nskypatch*ntsteps++; |
472 |
|
if (ntsteps > step_alloc) { |
473 |
< |
step_alloc += step_alloc>>1 + 8; |
473 |
> |
step_alloc += (step_alloc>>1) + ntsteps + 7; |
474 |
|
mtx_data = resize_dmatrix(mtx_data, step_alloc, nskypatch); |
475 |
|
} |
476 |
|
if (dif <= 1e-4) { |
527 |
|
printf("NROWS=%d\n", nskypatch); |
528 |
|
printf("NCOLS=%d\n", ntsteps); |
529 |
|
printf("NCOMP=3\n"); |
530 |
< |
fputformat(getfmtname(outfmt), stdout); |
530 |
> |
fputformat((char *)getfmtname(outfmt), stdout); |
531 |
|
putchar('\n'); |
532 |
|
} |
533 |
|
/* patches are rows (outer sort) */ |