The BioCro C++ Library
height_from_lai.h
Go to the documentation of this file.
1#ifndef HEIGHT_FROM_LAI_H
2#define HEIGHT_FROM_LAI_H
3
4#include "../framework/module.h"
5#include "../framework/state_map.h"
6
7namespace standardBML
8{
27class height_from_lai : public direct_module
28{
29 public:
31 state_map const& input_quantities,
32 state_map* output_quantities)
33 : direct_module{},
34
35 // Get pointers to input quantities
36 heightf{get_input(input_quantities, "heightf")},
37 lai{get_input(input_quantities, "lai")},
38
39 // Get pointers to output quantities
40 canopy_height_op{get_op(output_quantities, "canopy_height")}
41 {
42 }
43 static string_vector get_inputs();
44 static string_vector get_outputs();
45 static std::string get_name() { return "height_from_lai"; }
46
47 private:
48 // References to input quantities
49 double const& heightf;
50 double const& lai;
51
52 // Pointers to output quantities
53 double* canopy_height_op;
54
55 // Main operation
56 void do_operation() const;
57};
58
60{
61 return {
62 "heightf", // m^(-1)
63 "lai" // dimensionless
64 };
65}
66
68{
69 return {
70 "canopy_height" // m
71 };
72}
73
74void height_from_lai::do_operation() const
75{
76 update(canopy_height_op, lai / heightf); // m
77}
78
79} // namespace standardBML
80#endif
Estimates the canopy height as being proportional to LAI.
static string_vector get_outputs()
static string_vector get_inputs()
static std::string get_name()
height_from_lai(state_map const &input_quantities, state_map *output_quantities)
This is the standard BioCro module library; it includes the essential modules used in typical BioCro ...
Definition: aba_decay.h:8