forked from perabrahamsen/daisy-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aom.h
85 lines (75 loc) · 2.8 KB
/
aom.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
// aom.h --- A single added organic matter pool.
//
// Copyright 2002 Per Abrahamsen and 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 AOM_H
#define AOM_H
#include "om.h"
#include <vector>
class Frame;
class Volume;
class AOM : public OM
{
public:
static const char *const component;
symbol library_id () const;
// Parameters.
public:
const double initial_fraction; // Relative fraction for this om.
// Content.
public:
double top_C; // Carbon on the ground.
double top_N; // Nitrogen on the ground;
// Simulation.
public:
void output (Log&) const;
void penetrate (const Geometry&, double from, double to, double penetration,
double& tillage_N_top, double& tillage_C_top,
std::vector<double>& tillage_N_soil,
std::vector<double>& tillage_C_soil);
void penetrate (const Geometry&, const Volume&, double penetration,
double& tillage_N_top, double& tillage_C_top,
std::vector<double>& tillage_N_soil,
std::vector<double>& tillage_C_soil);
double full_C (const Geometry& geometry) const;
double full_N (const Geometry& geometry) const;
double C_at (unsigned int at) const;
double N_at (unsigned int at) const;
void pour (std::vector<double>& cc, std::vector<double>& nn);
void add (unsigned int at, double C, double N);
void add (double C, double N);// Add dead leafs.
void add (const Geometry&, // Add dead roots.
double C, double N,
const std::vector<double>& density);
void tick (const std::vector<bool>&, const double* turnover_factor,
const double* N_soil, double* N_used,
double* CO2, const std::vector<SMB*>& smb,
double* som_C, double* som_N, const std::vector<DOM*>& dom,
double dt);
private:
// Disallow this OM function.
void tick (const std::vector<bool>&, const double* turnover_factor,
const double* N_soil, double* N_used,
double* CO2,
const std::vector<SMB*>& smb, const std::vector<SOM*>&som,
const std::vector<DOM*>& dom, double dt);
// Create & Destroy.
public:
AOM (const BlockModel& al);
};
#endif // AOM_H