FireSTARR
Loading...
Searching...
No Matches
firestarr
src
py
cffdrs-ng
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
13
struct
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
31
struct
row_daily
32
{
33
double
lat, lon;
34
int
year, mon, day;
35
double
temp, rh, wind, rain;
36
};
37
41
struct
row_minmax
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
};
50
int
read_row(FILE* inp,
struct
row
* r);
54
int
read_row_daily(FILE* inp,
struct
row_daily
* r);
58
int
read_row_minmax(FILE* inp,
struct
row_minmax
* r);
66
double
findQ(
double
temp,
double
rh);
74
double
findrh(
double
q,
double
temp);
88
double
sun(
double
lat,
double
lon,
int
mon,
int
day,
int
hour,
double
timezone,
double
* sunrise,
double
* sunset);
101
double
sun_julian(
double
lat,
double
lon,
int
jd,
int
hour,
double
timezone,
double
* sunrise,
double
* sunset);
109
int
julian(
int
mon,
int
day);
116
void
check_header(FILE* input,
const
char
* header);
125
void
check_inputs(
double
temp,
double
rh,
double
wind,
double
rain);
126
127
double
seasonal_curing(
int
julian_date);
128
129
/* C90 round() only rounds to int but want digits */
130
double
_round(
double
x,
int
digits);
131
132
/* C90 max() also causing problems */
133
double
_max(
double
x,
double
y);
134
135
/* C90 min() also causing problems */
136
double
_min(
double
x,
double
y);
137
#endif
row_daily
Definition
util.h:32
row_minmax
Definition
util.h:42
row
Definition
util.h:14
Generated by
1.12.0