Skip to content

Commit

Permalink
feat(gendaymtx): added warning when solar direct is unexpectedly high…
Browse files Browse the repository at this point in the history
… at night
  • Loading branch information
Gregungory committed Sep 11, 2020
1 parent c3fc668 commit 3a1e000
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/gen/gendaymtx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: gendaymtx.c,v 2.37 2020/08/15 03:28:56 greg Exp $";
static const char RCSid[] = "$Id: gendaymtx.c,v 2.38 2020/09/11 16:50:50 greg Exp $";
#endif
/*
* gendaymtx.c
Expand Down Expand Up @@ -89,8 +89,7 @@ static const char RCSid[] = "$Id: gendaymtx.c,v 2.37 2020/08/15 03:28:56 greg Ex
#include "color.h"
#include "sun.h"

char *progname; /* Program name */
char errmsg[128]; /* Error message buffer */
char *progname; /* Program name */
const double DC_SolarConstantE = 1367.0; /* Solar constant W/m^2 */
const double DC_SolarConstantL = 127.5; /* Solar constant klux */

Expand Down Expand Up @@ -535,8 +534,12 @@ main(int argc, char *argv[])
sunsfp, modsfp);
continue;
}
if (!sun_in_sky && dir > (input==1 ? 20. : 20.*WHTEFFICACY))
fprintf(stderr,
"%s: warning - unusually bright at %.1f on %d-%d\n",
progname, hr, mo, da);
/* convert measured values */
if (dir_is_horiz && altitude > 0.)
if (dir_is_horiz && altitude > FTINY)
dir /= sin(altitude);
if (input == 1) {
dir_irrad = dir;
Expand Down

0 comments on commit 3a1e000

Please # to comment.