1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
19 |
|
|
20 |
|
#include "color.h" |
21 |
|
|
22 |
– |
#ifndef atof |
23 |
– |
extern double atof(); |
24 |
– |
#endif |
22 |
|
extern char *strcpy(), *strcat(), *malloc(); |
23 |
|
extern double stadj(), sdec(), sazi(), salt(); |
24 |
|
|
147 |
|
st = hour + stadj(jd); |
148 |
|
altitude = salt(sd, st); |
149 |
|
azimuth = sazi(sd, st); |
150 |
+ |
} |
151 |
+ |
if (!cloudy && altitude > 87.*PI/180.) { |
152 |
+ |
fprintf(stderr, |
153 |
+ |
"%s: warning - sun too close to zenith, reducing altitude to 87 degrees\n", |
154 |
+ |
progname); |
155 |
+ |
printf( |
156 |
+ |
"# warning - sun too close to zenith, reducing altitude to 87 degrees\n"); |
157 |
+ |
altitude = 87.*PI/180.; |
158 |
|
} |
159 |
|
sundir[0] = -sin(azimuth)*cos(altitude); |
160 |
|
sundir[1] = -cos(azimuth)*cos(altitude); |