-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathevents.h
68 lines (56 loc) · 1.51 KB
/
events.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// Created by Michael J Longfritz on 11/8/24.
//
#ifndef EVENTS_H
#define EVENTS_H
#include "modelStructures.h"
enum EventType {
FERTILIZATION,
HARVEST,
IRRIGATION,
PLANTING,
TILLAGE,
UNKNOWN_EVENT
};
typedef struct HarvestParams {
double fractionRemovedAbove;
double fractionRemovedBelow;
double fractionTransferredAbove; // to surface litter pool
double fractionTransferredBelow; // to soil litter pool
} HarvestParams;
typedef struct IrrigationParams {
double amountAdded;
int location; // 0=canopy, 1=soil
} IrrigationParams;
typedef struct FertilizationParams {
double orgN;
double orgC;
double minN;
//double nh4_no3_frac; for two-pool version
} FertilizationParams;
typedef struct PlantingParams {
int emergenceLag;
double addedC;
double addedN;
} PlantingParams;
typedef struct TillageParams {
double fractionLitterTransferred;
double somDecompModifier;
double litterDecompModifier;
} TillageParams;
typedef struct EventNode EventNode;
struct EventNode {
enum EventType type;
int loc, year, day;
void *eventParams;
EventNode *nextEvent;
};
/* Read event data from input filename (canonically events.in)
*
* Format: returned data is structured as an array of EventNode pointers, indexed by
* location. Each element of the array is the first event for that location (or null
* if there are no events). It is assumed that the events are ordered first by location
* and then by year and day.
*/
EventNode** readEventData(char *eventFile, int numLocs);
#endif //EVENTS_H