FireSTARR
Loading...
Searching...
No Matches
util.h
1#ifndef _UTIL_H
2#define _UTIL_H
3#include <math.h>
4#include <stdio.h>
5
6#ifndef M_PI
7#define M_PI 3.14159265358979323846
8#endif
9
13struct row
14{
15 double lat, lon;
16 int year, mon, day, hour;
17 double temp, rh, ws, rain;
18 /* Either need solar radiation to be included, or calculated */
19 double solrad;
20 /* derived from lat/lon/date/timezone */
21 double sunrise, sunset;
22 /* grass curing (%) [0-100]*/
23 double percent_cured;
24 /* grass fuel load (kg/m^2) */
25 double grass_fuel_load;
26};
27
32{
33 double lat, lon;
34 int year, mon, day;
35 double temp, rh, wind, rain;
36};
37
42{
43 double lat, lon;
44 int year, mon, day;
45 double temp_min, temp_max, rh_min, rh_max, ws_min, ws_max, rain;
46};
50int read_row(FILE* inp, struct row* r);
54int read_row_daily(FILE* inp, struct row_daily* r);
58int read_row_minmax(FILE* inp, struct row_minmax* r);
66double findQ(double temp, double rh);
74double findrh(double q, double temp);
88double sun(double lat, double lon, int mon, int day, int hour, double timezone, double* sunrise, double* sunset);
101double sun_julian(double lat, double lon, int jd, int hour, double timezone, double* sunrise, double* sunset);
109int julian(int mon, int day);
116void check_header(FILE* input, const char* header);
125void check_inputs(double temp, double rh, double wind, double rain);
126
127double seasonal_curing(int julian_date);
128
129/* C90 round() only rounds to int but want digits */
130double _round(double x, int digits);
131
132/* C90 max() also causing problems */
133double _max(double x, double y);
134
135/* C90 min() also causing problems */
136double _min(double x, double y);
137#endif
Definition util.h:32
Definition util.h:42
Definition util.h:14