forked from perabrahamsen/daisy-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbioclimate.h
147 lines (134 loc) · 5.29 KB
/
bioclimate.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// bioclimate.h
//
// Copyright 1996-2001 Per Abrahamsen and Søren Hansen
// Copyright 2000-2001 KVL.
//
// This file is part of Daisy.
//
// Daisy is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// Daisy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with Daisy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef BIOCLIMATE_H
#define BIOCLIMATE_H
#include "model_framed.h"
#include <vector>
class Surface;
class Weather;
class Vegetation;
class Litter;
class Movement;
class Geometry;
class Soil;
class SoilWater;
class SoilHeat;
class Log;
class Time;
class Treelog;
class Block;
class BlockModel;
class IM;
class Bioclimate : public ModelFramed
{
// Content.
public:
static const char *const component;
symbol library_id () const;
// Simulation.
public:
virtual void tick (const Time&, Surface&, const Weather&, Vegetation&,
const Litter& litter, const Movement&, const Geometry&,
const Soil&, SoilWater&, const SoilHeat&,
const double T_bottom,
double dt, Treelog&) = 0;
virtual void clear () = 0;
virtual double get_intercepted_water () const = 0; // [mm]
virtual double get_snow_storage () const = 0; // [mm]
virtual double snow_leak_rate (double dt) const = 0; // [h^-1]
virtual double canopy_leak_rate (double dt) const = 0; // [h^-1]
virtual double canopy_leak () const = 0; // [mm/h]
virtual double litter_leak_rate (double dt) const = 0; // [h^-1]
virtual const IM& deposit () const = 0; // [g [stuff] /cm²/h]
// Canopy.
public:
virtual const std::vector<double>& height () const = 0;
virtual const std::vector<double>& PAR () const = 0;
virtual const std::vector<double>& sun_PAR () const = 0;
virtual const std::vector<double>& sun_LAI_fraction () const = 0;
virtual double cover () const = 0;
virtual double LAI () const = 0;
virtual double sun_LAI_fraction_total () const =0;
virtual double wind_speed_field () const = 0;
virtual double rad_abs_soil() const = 0;
virtual double rad_abs_sun_canopy() const = 0;
virtual double rad_abs_shadow_canopy() const = 0;
virtual double sin_beta() const = 0;
virtual double shared_light_fraction () const = 0;
// Weather.
virtual double daily_air_temperature () const = 0;
virtual double canopy_temperature () const =0;
virtual double canopy_vapour_pressure () const = 0; // [Pa]
virtual double sun_leaf_temperature () const =0;
virtual double shadow_leaf_temperature () const =0;
virtual double sun_boundary_layer_water_conductivity () const = 0; // [m/s]
virtual double shadow_boundary_layer_water_conductivity () const = 0; // [m/s]
virtual double daily_precipitation () const = 0;
virtual double day_length () const = 0;
virtual double daily_global_radiation () const = 0;
virtual double global_radiation () const = 0;
double day_fraction (double dt) const;
virtual double direct_rain () const = 0;
virtual double atmospheric_CO2 () const = 0;
virtual double atmospheric_O2 () const = 0;
virtual double air_pressure () const = 0;
// Manager.
public:
virtual void irrigate_overhead (double flux, double temp) = 0;
virtual void irrigate_surface (double flux, double temp) = 0;
virtual void irrigate_overhead (double flux) = 0;
virtual void irrigate_surface (double flux) = 0;
virtual void irrigate_subsoil (double flux) = 0;
virtual void set_subsoil_irrigation (double flux) = 0;
virtual void add_tillage_water (double amount) = 0;
// Communication with SVAT.
virtual double total_ep () const = 0; // [mm/h]
virtual double total_ea () const = 0; // [mm/h]
virtual double snow_ea () const = 0; // [mm/h]
virtual double pond_ea () const = 0; // [mm/h]
virtual double soil_ea () const = 0; // [mm/h]
virtual double soil_surface_ea () const = 0; // soil + litter + pond + snow [mm/h]
virtual double crop_ep () const = 0; // [mm/h]
virtual double crop_ea () const = 0; // [mm/h]
virtual double canopy_ea () const = 0; // [mm/h]
virtual double min_sin_beta () const = 0; // [] Lowest sun angle.
// Utilities.
public:
static void radiation_distribution (const size_t No, const double LAI,
const double Ref,
const double Si,
const double Ext,
std::vector <double>& Rad);
private:
static void intensity_distribution (size_t No, double LAI,
double Rad0, double Ext,
std::vector <double>& Rad);
// Create.
public:
virtual void initialize (const Weather&, Treelog& msg) = 0;
virtual bool check (const Weather& weather, Treelog& msg) const = 0;
protected:
explicit Bioclimate (const BlockModel&);
public:
virtual void summarize (Treelog& msg) const = 0;
~Bioclimate ();
};
#endif // BIOCLIMATE_H