LandscapeDNDC  1.36.0
ldndc Namespace Reference

updates air chemistry subday and day buffers More...

Classes

class  EcHy
 Watercycle model EcosystemHydrology - EcHy. More...
 
struct  mobile_module_info_t
 structure representing module information from MoBiLE's setup module list block More...
 
class  mobile_modules_info_t
 structure manages module list information More...
 
class  MoBiLE_Substate
 abstract) base class for all simulation system state compartments More...
 
struct  module_option_register_t
 supported options shall be registered before referencing them More...
 
class  PhysiologyPlaMox
 Plamox. More...
 
class  PhysiologyVOCBIM
 This gas exchange module calculates emission of biogenetic volatile organic compounds. More...
 
class  SoilChemistryMeTrX
 Biogeochemical model MeTrx. More...
 
class  WatercycleDNDC
 Watercycle model WatercycleDNDC. More...
 

Typedefs

typedef speciesparameters::speciesparameters_set_t MoBiLE_PlantParameters
 

Enumerations

enum  lmodule_flag_e {
  LMOD_FLAG_NONE = 0u,
  LMOD_FLAG_CONTROL = 1u << 0,
  LMOD_FLAG_USER = 1u << 1,
  LMOD_FLAG_SYSTEM = 1u << 2,
  LMOD_FLAG_INITIALIZER = 1u << 3,
  LMOD_FLAG_FINALIZER = 1u << 4,
  LMOD_FLAG_MAINTENANCE = 1u << 5,
  LMOD_FLAG_OUTPUT = 1u << 6,
  LMOD_FLAG_TEST_MODULE = 1u << 7
}
 
enum  { LSUB_FLAG_NONE = 0u }
 
enum  
 Lower bounds for number of foliage layers.
 
enum  stomatalconductance_method_e
 Stomatal conductance methods.
 
enum  {
  CPOOL_VL,
  CPOOL_L,
  CPOOL_R,
  CPOOL_B
}
 Order of carbon pools in array passed to allocate_litter. More...
 

Functions

lerr_t assign_soillayer_porosity (double &_porosity_without_stones, int const &_nd_stratum, double const &_depth, double const &_c_org_without_stones, double const &_bulk_density_without_stones, const ldndc::site::input_class_site_t *_site, const ldndc::soillayers::input_class_soillayers_t *_soillayers, const ldndc::soilparameters::input_class_soilparameters_t *_soilparameters, bool _info=false)
 
lerr_t assign_soillayer_field_capacity_and_wilting_point (double &_wcmax_without_stones, double &_wcmin_without_stones, double _wfps_max, double _wfps_min, double _porosity_without_stones, int const &_nd_stratum, double const &_depth, const ldndc::site::input_class_site_t *_site, const ldndc::soillayers::input_class_soillayers_t *_soillayers, const ldndc::soilparameters::input_class_soilparameters_t *_soilparameters, bool _vg_prio=false, bool _info=false)
 
double resistance_aero_abovecanopy (double const &, double const &)
 returns boundary layer resistance above canopy
 
double resistance_aero_incanopy (double const &, double const &, double const &)
 returns boundary layer resistance within canopy
 
double crown_shape_parameter (double _length, double lref, double ps)
 Tree crown shape.
 
void canopy_biomass_distribution (size_t const _fl_cnt_max, size_t const _fl_cnt, double const _ps, double const _h_bottom, double const _h_top, double const *_h_fl, double *_fFol_fl)
 Foliage biomass distribution vertically across canopy. More...
 
void canopy_lai_distribution (double _sla_min, double _sla_max, double _height_max, double _height_min, double _mFol, double const *_fFol_fl, double const *_h_fl, double *_lai_fl, double *_sla_fl, size_t _foliage_layer_cnt, size_t _foliage_layer_cnt_max)
 Leaf area distribution vertically across the whole canopy. More...
 
void estimate_single_layer_biomass (double const _ps, double const _h_bottom, double const _h_top, double _lw, double &_fract, double _h_cum_bottom, double _h_cum_top)
 Vertical biomass estimation. More...
 
void fineroots_biomass_distribution (size_t _sl_cnt_litter, size_t _sl_cnt_soil, double _ps, double _rooting_depth, double *_f_frt_sl, double const *_h_sl)
 
double get_optimum_sap_wood_biomass (MoBiLE_Plant *_p)
 
double get_sapwood_foliage_ratio (MoBiLE_Plant *_p)
 
double sapwood_foliage_area_ratio (double _height, double _qsf_p1, double _qsf_p2)
 
double stomatal_conductance_ballberry_1987 (double, double, double, double)
 Stomatal conductance according to Berry, Woodward and Ball 1987.
 
double stomatal_conductance_leuning_1990 (double, double, double, double, double)
 Stomatal conductance according to Leuning 1990.
 
double stomatal_conductance_leuning_1995_a (double, double, double, double, double, double, double)
 Stomatal conductance according to Leuning 1995.
 
double stomatal_conductance_eller_2020 (double, double, double, double, double, double, double, double, double, double, double)
 Stomatal conductance according to Eller et al. 2020.
 
double potential_wood_transpiration (soillayers::input_class_soillayers_t const &, double _vpd, double _carbon_uptake, double _f_area, double _wuecmax, double _wuecmin, lvector_t< double > _h_sl, lvector_t< double > _wc, lvector_t< double > _wc_min, lvector_t< double > _wc_max)
 Returns potential transpiration in [m] for trees.
 
double potential_crop_transpiration (double _co2, double _carbon_uptake, double _wuecmax)
 Returns potential transpiration in [m] for crops and grass.
 
double potential_transpiration (size_t, double gsmin, double gsmax, double *_lai_fl, lvector_t< double > _vpd_fl, double *_relative_conductance_fl)
 Returns potential transpiration in [m] for any species type.
 
lerr_t get_voc_emission_factors (ldndc::MoBiLE_Plant *, int, bool, double, int, double, double)
 
lerr_t LDNDC_API allocate_litter (double _c, double _n, double _RCNRVL, double _RCNRL, double _RCNRR, double _C[], double &_n_diff)
 calculates the amount of C which is added to the very labile, labile and recalcitrant decomposition pool More...
 
double LDNDC_API cation_exchange_capacity (double _clay, double _sand, double _som, double _ph, ecosystem_type_e _ecosystem)
 Detailed description provided here . More...
 
double d_eff_air_a (double const &, double const &)
 Returns effective diffusion coefficient depending on gas content. More...
 
double d_eff_air_b (double const &, double const &, double const &, double const &)
 Returns effective diffusion coefficient depending on gas content and porosity. More...
 
double d_eff_air_millington_and_quirk_1961 (double const &, double const &)
 Returns effective diffusion coefficient after [46]. More...
 
lerr_t update_litter_height (soillayers::input_class_soillayers_t const &, substate_watercycle_t &, substate_soilchemistry_t &)
 Detailed description provided here . More...
 
bool forest_floor (size_t, soillayers::input_class_soillayers_t const &, const ldndc::site::input_class_site_t &)
 First floor defined by: More...
 
double LDNDC_API sap_wood_fraction (double _lai_max, double _qsfa, double _height_min, double _height_max, double _depth)
 sap_wood_fraction The calculation of the fraction of sapwood in coarse roots is based on the idealized volume fraction and assumes that the stem in the crown as well as the coarse roots are shaped as cones, and that core wood reaches a third of the cone More...
 
lerr_t wood_initialization (soillayers::input_class_soillayers_t const &, MoBiLE_PlantVegetation &, substate_soilchemistry_t &, ecosystem_type_e)
 Initialization of aboveground and belowground wood debris, derived from existing vegetation. More...
 
double non_stomatal_water_limitation (double const &_var, double const &_var_ref, double const &_var_scale)
 Non stomatal water limitation. More...
 
double LDNDC_API thornthwaite_heat_index (double, size_t, double, double)
 Thornthwaite heat index.
 
double LDNDC_API thornthwaite (double, double, double)
 Potential evapotranspiration after [55].
 

Variables

LDNDC_API lflags_t const TMODE_DEFAULTS = TMODE_SUBDAILY|TMODE_PRE_DAILY|TMODE_POST_DAILY|TMODE_PRE_YEARLY|TMODE_POST_YEARLY
 
LDNDC_API MoBiLE_ModuleFactoryEnvelope const module_factories []
 a list of destructors (because i was to lazy to add a one line file for these base classes..)
module factory array is defined here. More...
 
substate_factory_t< substate_airchemistry_t > const substate_airchemistry_factory
 substate base class implementation, sources factories More...
 

Detailed Description

updates air chemistry subday and day buffers

Dynamic farmer.

david kraus

kind of helper module to perform additional tasks after all user modules have been run

container for state variable belonging to water cycle processes

container for state variable belonging to soil processes

container for state variable belonging to micro climate processes. it also acts as a one-timestep buffer for climate data records.

convenience header pulling all substate headers

helper functions for checkpointing mobile substate

container for MoBiLE substates

kind of helper module to perform additional tasks before user modules are run.

updates climate subday and day buffers

Author
steffen klatt, edwin haas
steffen klatt, edwin haas
Note
Old simmaster methods: <fluxInitials> + <nd-[CL|AC]arr2scalar> + <ndGeneral> + <readEventHandlingFile>
Author
steffen klatt
steffen klatt (created on: oct 27, 2012), edwin haas
steffen klatt edwin haas
Steffen Klatt, Edwin Haas, David Kraus
David Kraus

Typedef Documentation

◆ MoBiLE_PlantParameters

typedef speciesparameters::speciesparameters_set_t ldndc::MoBiLE_PlantParameters

overview of plant properties ...

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LSUB_FLAG_NONE 

empty flag

75 {
77  LSUB_FLAG_NONE = 0u
78 };
Definition: mbe_substate.h:77

◆ anonymous enum

anonymous enum

Order of carbon pools in array passed to allocate_litter.

Enumerator
CPOOL_VL 

very labile

CPOOL_L 

labile

CPOOL_R 

recalcitrant

CPOOL_B 

wood

20 {
22  CPOOL_VL,
24  CPOOL_L,
26  CPOOL_R,
28  CPOOL_B,
29 
30  CPOOL_CNT
31 };
Definition: ld_allocatelitter.h:26
Definition: ld_allocatelitter.h:28
Definition: ld_allocatelitter.h:24
Definition: ld_allocatelitter.h:22

◆ lmodule_flag_e

Enumerator
LMOD_FLAG_NONE 

empty flag

LMOD_FLAG_CONTROL 

marks model as control model

LMOD_FLAG_USER 

marks model as user model

LMOD_FLAG_SYSTEM 

marks model as internal system model

LMOD_FLAG_INITIALIZER 

marks model as initializer (runs before user legacy models)

LMOD_FLAG_FINALIZER 

marks model as finalizer (runs after user legacy models)

LMOD_FLAG_MAINTENANCE 

marks model as maintenance model (e.g. updates, resets, etc)

LMOD_FLAG_OUTPUT 

marks model as output model (always added last)

LMOD_FLAG_TEST_MODULE 

marks model as test model

65 {
67  LMOD_FLAG_NONE = 0u,
68 
70  LMOD_FLAG_CONTROL = 1u << 0,
71 
73  LMOD_FLAG_USER = 1u << 1,
74 
76  LMOD_FLAG_SYSTEM = 1u << 2,
78  LMOD_FLAG_INITIALIZER = 1u << 3,
80  LMOD_FLAG_FINALIZER = 1u << 4,
82  LMOD_FLAG_MAINTENANCE = 1u << 5,
83 
85  LMOD_FLAG_OUTPUT = 1u << 6,
86 
88  LMOD_FLAG_TEST_MODULE = 1u << 7,
89 
90  LMOD_FLAG_CNT_,
91  LMOD_FLAG_CNT = 1 + 1 + cbm::log2_t< LMOD_FLAG_CNT_-1 >::LOG2
92 };
Definition: mbe_legacymodel.h:80
Definition: mbe_legacymodel.h:78
Definition: mbe_legacymodel.h:70
Definition: mbe_legacymodel.h:88
Definition: mbe_legacymodel.h:73
Definition: mbe_legacymodel.h:67
Definition: mbe_legacymodel.h:82
Definition: mbe_legacymodel.h:76
Definition: mbe_legacymodel.h:85

Function Documentation

◆ allocate_litter()

lerr_t ldndc::allocate_litter ( double  _c,
double  _n,
double  _RCNRVL,
double  _RCNRL,
double  _RCNRR,
double  _C[],
double &  _n_diff 
)

calculates the amount of C which is added to the very labile, labile and recalcitrant decomposition pool

The needed information in this function are the amount of carbon in litter _c and the corresponding CN ratio (determined from nitrogen _n).

four cases: If the CN ratio is lower than the CN ratio of the very labile litter pool, all litter-C goes to the very labile decomposition pool.

If the CN ratio is between RCNRVL and the harmonic mean of RCNRVL and RCNRR, an increasing CN ratio decreases C_0 and increases C_1 and C_2.

If thc CN ratio is between the harmonic mean of RCNRVL and RCNRR and RCNRR, C_1 and C_2 decrease and only C_0 increases.

If CN ratio is higher than RCNRR, all Litter-C goes to C_2.

Parameters
_cCarbon in litter flux
_nNitrogen in litter flux
_COrganic carbon that is added to the
  • very labile,
  • labile,
  • recalcitrant decomposition pool (kgC ha-1)
_n_diff
Note
rr_vl_l harmonic mean of RCNRL and RCNRVL; used to calculate weights how addC is partitioned into C1,C2 and C3 rr_l_r harmonic mean of RCNRL and RCNRR
Author
david kraus (created on: may 6, 2014)

References CPOOL_B, CPOOL_L, CPOOL_R, and CPOOL_VL.

19 {
20  ldndc_assert( _n >= 0.0);
21 
22  if (cbm::flt_equal_zero(_n))
23  {
24  _C[CPOOL_VL] = 0.0;
25  _C[CPOOL_L] = 0.0;
26  _C[CPOOL_R] = 0.0;
27  _C[CPOOL_B] = _c;
28  _n_diff = 0.0;
29  }
30  else
31  {
32  ldndc_assert(( _RCNRVL > 0.0) && ( _RCNRL > 0.0) && ( _RCNRR > 0.0));
33  double const cn( _c / _n);
34 
35  if ( cn < _RCNRVL)
36  {
37  /* cn \in (0,rL) */
38  _C[CPOOL_VL] = _c;
39  _C[CPOOL_L] = 0.0;
40  _C[CPOOL_R] = 0.0;
41  _C[CPOOL_B] = 0.0;
42  _n_diff = ( _n - _c/_RCNRVL);
43  }
44  else if (( cn >= _RCNRVL) && ( cn < _RCNRL))
45  {
46  /* cn \in [rL,r) */
47  double rr_l_r( 2.0 * _RCNRR * _RCNRL / ( _RCNRR + _RCNRL));
48  double addrr( _c * ( rr_l_r - cn) / ( rr_l_r - _RCNRVL) * ( _RCNRVL / cn));
49  _C[CPOOL_VL] = ( 1.25 * addrr - _c * 0.25);
50  _C[CPOOL_L] = ( _c - addrr);
51  _C[CPOOL_R] = (( _c - addrr) * 0.25);
52  _C[CPOOL_B] = 0.0;
53  _n_diff = 0.0;
54  }
55  else if (( cn >= _RCNRL) && ( cn <= _RCNRR))
56  {
57  /* cn \in [r,rR] */
58  double rr_vl_l( 2.0 * _RCNRVL * _RCNRL / ( _RCNRVL + _RCNRL));
59  double addrr( _c * ( rr_vl_l - cn) / (rr_vl_l - _RCNRR) * ( _RCNRR / cn));
60  _C[CPOOL_VL] = (( _c - addrr) * 0.25);
61  _C[CPOOL_L] = ( _c - addrr);
62  _C[CPOOL_R] = ( _c - ( _C[0] + _C[1]));
63  _C[CPOOL_B] = 0.0;
64  _n_diff = 0.0;
65  }
66  else
67  {
68  /* cn \in (rR,\inf) */
69  _C[CPOOL_VL] = 0.0;
70  _C[CPOOL_L] = 0.0;
71  _C[CPOOL_R] = _n * _RCNRR;
72  _C[CPOOL_B] = _c - _n * _RCNRR;
73  _n_diff = 0.0;
74  }
75  }
76 
77  return LDNDC_ERR_OK;
78 }
Definition: ld_allocatelitter.h:26
Definition: ld_allocatelitter.h:28
Definition: ld_allocatelitter.h:24
Definition: ld_allocatelitter.h:22

◆ assign_soillayer_field_capacity_and_wilting_point()

lerr_t ldndc::assign_soillayer_field_capacity_and_wilting_point ( double &  _wcmax_without_stones,
double &  _wcmin_without_stones,
double  _wfps_max,
double  _wfps_min,
double  _porosity_without_stones,
int const &  _nd_stratum,
double const &  _depth,
const ldndc::site::input_class_site_t *  _site,
const ldndc::soillayers::input_class_soillayers_t *  _soillayers,
const ldndc::soilparameters::input_class_soilparameters_t *  _soilparameters,
bool  _vg_prio = false,
bool  _info = false 
)

Wilting point is checked for consistency against field capacity, i.e., field capacity is not allowed to exceed 90% of estimated field capacity:

\( \theta_{min} = min(\theta_{min}, 0.9 \; \theta_{max}) \)

References forest_floor().

681 {
682  ldndc::site::iclass_site_stratum_t stratum;
683  lerr_t rc_stratum = _soillayers->stratum( _nd_stratum, &stratum);
684  RETURN_IF_NOT_OK( rc_stratum);
685 
686  bool vg_parameter_from_input( true);
687  double vg_a( 0.0);
688  double vg_n( 0.0);
689  double vg_m( 0.0);
690  lerr_t rc_vg = assign_soillayer_van_genuchten_parameter( vg_a, vg_n, vg_m, vg_parameter_from_input,
691  _nd_stratum, _depth, _site, _soillayers, _soilparameters, false);
692  if ( rc_vg)
693  {
694  LOGERROR( "Initialization of field capacity and wilting point of stratum ", _nd_stratum+1, " not successfull due to invalid van Genuchen parameters");
695  return LDNDC_ERR_FAIL;
696  }
697 
698  double stone_fraction( 0.0);
699  lerr_t rc_stone = assign_soillayer_stone_fraction( stone_fraction, _nd_stratum, _depth, _site, _soillayers, _soilparameters, false);
700  if ( rc_stone)
701  {
702  LOGERROR( "Initialization of field capacity and wilting point of stratum ", _nd_stratum+1, " not successfull due to invalid stone content");
703  return LDNDC_ERR_FAIL;
704  }
705 
706  double clay( 0.0);
707  double sand( 0.0);
708  lerr_t rc_texture = assign_soillayer_clay_and_sand_content( clay, sand, _nd_stratum, _depth, _site, _soillayers, _soilparameters, false);
709  if ( rc_texture)
710  {
711  LOGERROR( "Initialization of field capacity and wilting point of stratum ", _nd_stratum+1, " not successfull due to invalid soil texture info");
712  return LDNDC_ERR_FAIL;
713  }
714 
715  cbm::string_t texture_name( ldndc::get_soil_texture( sand * 100.0, clay * 100.0));
716  ldndc::soillayers::soil_type_e texture_type( ldndc::get_soil_texture_type( texture_name));
717 
718  if( cbm::flt_greater_equal_zero( stratum.wcmax))
719  {
720  _wcmax_without_stones = stratum.wcmax * cbm::M_IN_MM;
721  }
722  else
723  {
724  if ( vg_parameter_from_input || _vg_prio)
725  {
726  //capillary pressure at field capacity (pF value of 1.8)
727  double const cp_fc = 0.63; // [m]
728  _wcmax_without_stones = ldndc::hydrology::water_content( cp_fc, vg_a, vg_n, vg_m,
729  _wfps_max * _porosity_without_stones,
730  _wfps_min * _porosity_without_stones);
731  STRATUM_INFO( "Field capacity in stratum ", _nd_stratum+1," not initialized, estimated value (without stones): ",
732  _wcmax_without_stones * (1.0 - stone_fraction), " [m3 m-3] (based on van Genuchten)");
733  }
734  else
735  {
736  if ( forest_floor( _depth, *_soillayers, *_site))
737  {
738  _wcmax_without_stones = _soilparameters->HUMUS_WCMAX( _soillayers->humus_type()) * cbm::M_IN_MM;
739  }
740  else
741  {
742  if ( ldndc::use_usda_soil_texture_triangle( _soillayers->soil_type()) &&
743  (texture_type != ldndc::soillayers::SOIL_NONE))
744  {
745  _wcmax_without_stones = _soilparameters->SOIL_WCMAX( texture_type) * cbm::M_IN_MM;
746  }
747  else
748  {
749  _wcmax_without_stones = _soilparameters->SOIL_WCMAX( _soillayers->soil_type()) * cbm::M_IN_MM;
750  }
751  }
752  STRATUM_INFO( "Field capacity in stratum ", _nd_stratum+1," not initialized, estimated value is (without stones): ",
753  _wcmax_without_stones, " [m3 m-3] (based on soil texture)");
754  }
755  }
756  if( !cbm::flt_in_range_lu( 0.0, _wcmax_without_stones, 1.0))
757  {
758  LOGERROR( "Invalid value for field capacity in stratum ",_nd_stratum+1, ": ", _wcmax_without_stones," [m3 m-3]");
759  return LDNDC_ERR_FAIL;
760  }
761 
768  double const wcmin_fraction( 0.9);
769  if( cbm::flt_greater_equal_zero( stratum.wcmin))
770  {
771  _wcmin_without_stones = stratum.wcmin * cbm::M_IN_MM;
772  }
773  else
774  {
775  if ( vg_parameter_from_input || _vg_prio)
776  {
777  double const cp_wp = 150.0; // must be the same unit as 1/alpha -> m
778  _wcmin_without_stones = ldndc::hydrology::water_content( cp_wp, vg_a, vg_n, vg_m,
779  _wfps_max * _porosity_without_stones,
780  _wfps_min * _porosity_without_stones);
781  STRATUM_INFO( "Wilting point in stratum ", _nd_stratum+1," not initialized, estimated value (without stones): ",
782  _wcmin_without_stones * (1.0 - stone_fraction), " [m3 m-3] (based on van Genuchten)");
783  }
784  else
785  {
786  if ( forest_floor( _depth, *_soillayers, *_site))
787  {
788  _wcmin_without_stones = _soilparameters->HUMUS_WCMIN( _soillayers->humus_type()) * cbm::M_IN_MM;
789  }
790  else
791  {
792  if ( ldndc::use_usda_soil_texture_triangle( _soillayers->soil_type()) &&
793  (texture_type != ldndc::soillayers::SOIL_NONE))
794  {
795  _wcmin_without_stones = _soilparameters->SOIL_WCMIN( texture_type) * cbm::M_IN_MM;
796  }
797  else
798  {
799  _wcmin_without_stones = _soilparameters->SOIL_WCMIN( _soillayers->soil_type()) * cbm::M_IN_MM;
800  }
801  }
802  STRATUM_INFO( "Wilting point in stratum ", _nd_stratum+1," not initialized, estimated value is (without stones): ",
803  _wcmin_without_stones, " [m3 m-3] (based on soil texture)");
804  }
805  }
806  if( !cbm::flt_in_range_lu( 0.0, _wcmin_without_stones, 1.0))
807  {
808  LOGERROR( "Invalid value for wilting point in stratum ", _nd_stratum+1, ": ", _wcmin_without_stones," [m3 m-3]");
809  return LDNDC_ERR_FAIL;
810  }
811  else if ( cbm::flt_greater( _wcmin_without_stones, wcmin_fraction * _wcmax_without_stones))
812  {
813  _wcmin_without_stones = wcmin_fraction * _wcmax_without_stones;
814  STRATUM_INFO( "Wilting point in stratum ", _nd_stratum+1," too close to field capacity. Wilting point changed to: ", _wcmin_without_stones, " [mm/m]");
815  }
816  return LDNDC_ERR_OK;
817 }
bool forest_floor(size_t, soillayers::input_class_soillayers_t const &, const ldndc::site::input_class_site_t &)
First floor defined by:
Definition: ld_litterheight.cpp:106
Here is the call graph for this function:

◆ assign_soillayer_porosity()

lerr_t ldndc::assign_soillayer_porosity ( double &  _porosity_without_stones,
int const &  _nd_stratum,
double const &  _depth,
double const &  _c_org_without_stones,
double const &  _bulk_density_without_stones,
const ldndc::site::input_class_site_t *  _site,
const ldndc::soillayers::input_class_soillayers_t *  _soillayers,
const ldndc::soilparameters::input_class_soilparameters_t *  _soilparameters,
bool  _info = false 
)

Porosity is estimated based on organic carbon fraction and bulk density for the soil including stones. Porosity is given by a value between 0 and 1. See: porosity()

References forest_floor().

349 {
350  ldndc::site::iclass_site_stratum_t stratum;
351  lerr_t rc_stratum = _soillayers->stratum( _nd_stratum, &stratum);
352  RETURN_IF_NOT_OK( rc_stratum);
353 
354  if( cbm::flt_greater_equal_zero( stratum.porosity))
355  {
356  _porosity_without_stones = stratum.porosity;
357  }
358  else
359  {
360  double clay( 0.0);
361  double sand( 0.0);
362  lerr_t rc_texture = assign_soillayer_clay_and_sand_content( clay, sand, _nd_stratum, _depth, _site, _soillayers, _soilparameters, false);
363  if ( rc_texture)
364  {
365  LOGERROR( "Initialization of porosity of stratum ", _nd_stratum+1, " not successfull due to invalid soil texture info");
366  return LDNDC_ERR_FAIL;
367  }
368 
374  double const min_dens( sand * cbm::DSAN + (1.0 - sand - clay) * cbm::DSIL + clay * cbm::DCLA);
375  _porosity_without_stones = ldndc::porosity( _c_org_without_stones, _bulk_density_without_stones, min_dens);
376 
377  STRATUM_INFO( "Porosity of stratum ",_nd_stratum+1," not initialized, estimated value (without stones): ", _porosity_without_stones*100.0," [%]");
378  }
379 
380  if ( !cbm::flt_in_range_lu( 0.0, _porosity_without_stones, 1.0))
381  {
382  STRATUM_INFO( "Porosity of stratum ", _nd_stratum+1, " out of range: ", _porosity_without_stones," [m3 m-3]");
383  return LDNDC_ERR_FAIL;
384  }
385  else
386  {
387  return LDNDC_ERR_OK;
388  }
389 }
Here is the call graph for this function:

◆ canopy_biomass_distribution()

void ldndc::canopy_biomass_distribution ( size_t const  _fl_cnt_max,
size_t const  _fl_cnt,
double const  _ps,
double const  _h_bottom,
double const  _h_top,
double const *  _h_fl,
double *  _fFol_fl 
)

Foliage biomass distribution vertically across canopy.

Parameters
_fl_cnt_maxmaximum number of foliage parameters
_fl_cntcurrent actively used number of foliage parameters
_ps
_h_bottom
_h_top
_h_fl
_fFol_fl
Returns
no return value

References estimate_single_layer_biomass().

44 {
45  /* reset */
46  for ( size_t fl = 0; fl < _fl_cnt_max; ++fl)
47  {
48  _fFol_fl[fl] = 0.0;
49  }
50 
51  // total distribution length
52  if ( cbm::flt_greater( _h_top, _h_bottom))
53  {
54  double h_cum_top( 0.0);
55  for ( size_t fl = 0; fl < _fl_cnt; ++fl)
56  {
57  double const h_cum_bottom( h_cum_top);
58  h_cum_top += _h_fl[fl];
59 
61  _ps, _h_bottom, _h_top,
62  _h_fl[fl], _fFol_fl[fl],
63  h_cum_bottom, h_cum_top);
64  }
65 
66  double const fFol_sum( cbm::sum( _fFol_fl, _fl_cnt));
67  if ( cbm::flt_equal_zero( fFol_sum))
68  {
69  for ( size_t fl = 0; fl < _fl_cnt; ++fl)
70  {
71  _fFol_fl[fl] = 1.0 / double( _fl_cnt);
72  }
73  }
74  else
75  {
76  for ( size_t fl = 0; fl < _fl_cnt; ++fl)
77  {
78  _fFol_fl[fl] /= fFol_sum;
79  }
80  }
81  }
82 }
void estimate_single_layer_biomass(double const _ps, double const _h_bottom, double const _h_top, double _lw, double &_fract, double _h_cum_bottom, double _h_cum_top)
Vertical biomass estimation.
Definition: ld_plantfunctions.cpp:1502
Here is the call graph for this function:

◆ canopy_lai_distribution()

void ldndc::canopy_lai_distribution ( double  _sla_min,
double  _sla_max,
double  _height_max,
double  _height_min,
double  _mFol,
double const *  _fFol_fl,
double const *  _h_fl,
double *  _lai_fl,
double *  _sla_fl,
size_t  _foliage_layer_cnt,
size_t  _foliage_layer_cnt_max 
)

Leaf area distribution vertically across the whole canopy.

Parameters
_sla_minspecific leaf area at canopy top
_sla_maxspecific leaf area at canopy bottom
_height_maxtotal plant height
_height_minplant height at start of canopy
_mFolfoliage biomass
_fFol_flfoliage biomass distribution
_h_flcanopy discretization
_lai_flcanopy layer leaf area index
_sla_flcanopy layer specific leaf are
_foliage_layer_cntnumber of canopy layers
_foliage_layer_cnt_maxmaximum number of canopy layers
Returns
no return value
101 {
102  /* reset canopy */
103  for ( size_t fl = 0; fl < _foliage_layer_cnt_max; ++fl)
104  {
105  _sla_fl[fl] = 0.0;
106  _lai_fl[fl] = 0.0;
107  }
108 
109  double const crown_length( _height_max - _height_min);
110  if ( cbm::flt_greater_zero( crown_length))
111  {
112  double const delta_sla( cbm::bound_min( 0.0, _sla_max - _sla_min));
113 
114  /* cumulative height of total plant */
115  double h_cum_total_top( 0.0);
116  double h_cum_crown_bottom( 0.0);
117  for ( size_t fl = 0; fl < _foliage_layer_cnt; ++fl)
118  {
119  h_cum_total_top += _h_fl[fl];
120 
121  /* sla and lai are greater zero only within canopy */
122  if ( cbm::flt_greater( h_cum_total_top, _height_min))
123  {
124  double const h_cum_crown_top( cbm::bound_max( h_cum_total_top - _height_min, crown_length));
125  double const h_cum_crown( 0.5 * (h_cum_crown_bottom + h_cum_crown_top));
126 
127  _sla_fl[fl] = _sla_max - (delta_sla * h_cum_crown / crown_length);
128  _lai_fl[fl] = _sla_fl[fl] * _mFol * _fFol_fl[fl];
129 
130  h_cum_crown_bottom = h_cum_crown_top;
131  }
132  }
133  }
134 }

◆ cation_exchange_capacity()

double LDNDC_API ldndc::cation_exchange_capacity ( double  _clay,
double  _sand,
double  _som,
double  _ph,
ecosystem_type_e  _ecosystem 
)

Detailed description provided here .

Parameters
_clayClay content [%]
_sandSand content [%]
_somSoil organic matter content [%]
_phpH value [-]
_ecosystemEcosystem type [-]
Returns
Cation exchange capacity [mol:g-1:1e-5]

Referenced by ldndc::SoilChemistryMeTrX::MeTrX_clay_nh4_equilibrium().

Here is the caller graph for this function:

◆ d_eff_air_a()

double ldndc::d_eff_air_a ( double const &  _exp,
double const &  _gas_content 
)

Returns effective diffusion coefficient depending on gas content.

Parameters
[in]_expExponent [-]
[in]_gas_contentGas content [m^3:m^-3]
Returns
Effective diffusion coefficient [-]

Referenced by ldndc::SoilChemistryMeTrX::MeTrX_physics().

18 {
19  return std::pow( _gas_content, _exp);
20 }
Here is the caller graph for this function:

◆ d_eff_air_b()

double ldndc::d_eff_air_b ( double const &  _exp_g,
double const &  _exp_p,
double const &  _gas_content,
double const &  _porosity 
)

Returns effective diffusion coefficient depending on gas content and porosity.

Parameters
[in]_exp_gExponent for gas content [-]
[in]_exp_pExponent for porosity [-]
[in]_gas_contentGas content [m^3:m^-3]
[in]_porosityPorosity [m^3:m^-3]
Returns
Effective diffusion coefficient [-]
31 {
32  return std::pow( _gas_content, _exp_g) / std::pow( _porosity, _exp_p);
33 }

◆ d_eff_air_millington_and_quirk_1961()

double ldndc::d_eff_air_millington_and_quirk_1961 ( double const &  _gas_content,
double const &  _porosity 
)

Returns effective diffusion coefficient after [46].

Parameters
[in]_gas_contentGas content [m^3:m^-3]
[in]_porosityPorosity [m^3:m^-3]
Returns
Effective diffusion coefficient [-]

Referenced by ldndc::SoilChemistryMeTrX::MeTrX_physics().

42 {
43  return std::pow( _gas_content, 10.0/3.0) / (_porosity * _porosity);
44 }
Here is the caller graph for this function:

◆ estimate_single_layer_biomass()

void ldndc::estimate_single_layer_biomass ( double const  _ps,
double const  _h_bottom,
double const  _h_top,
double  _lw,
double &  _fract,
double  _h_cum_bottom,
double  _h_cum_top 
)

Vertical biomass estimation.

Parameters
_psform parameter
_h_bottomheight of start of distributed biomass
_h_topheight of end of distributed biomass
_lw
_fract
_h_cum_bottom
_h_cum_top
Returns
No return value

The standard vertical distribution of biomass is done with the same assumptions for canopy (veglibs_canopy) and rooting space (Fine root distribution). Only for root distribution there are several more options available.

Referenced by canopy_biomass_distribution(), and fineroots_biomass_distribution().

1510 {
1511  // calculation proceeds as long as cumulative length is smaller than total crown length
1512  if ( cbm::flt_greater( _h_cum_top, _h_bottom) &&
1513  cbm::flt_less_equal( _h_cum_bottom, _h_top))
1514  {
1515  // distance from the crown start/ soil surface for which the relative biomass shall be estimated
1516  double hAct( 0.0);
1517  double const length( _h_top - _h_bottom);
1518 
1519  // if total crown height is within the first canopy layer
1520  if ( cbm::flt_less( _h_top, _lw))
1521  {
1522  hAct = length;
1523  }
1524  // for the partially filled last canopy/ soil layer
1525  else if ( cbm::flt_less_equal( _h_top, _h_cum_top))
1526  {
1527  hAct = length - ( _h_top - _h_cum_bottom) * 0.5;
1528  }
1529  // for the partially filled first canopy/ soil layer
1530  else if ( cbm::flt_less( _h_cum_bottom, _h_bottom))
1531  {
1532  hAct = ( _h_cum_top - _h_bottom) * 0.5;
1533  }
1534  // for fully filled canopy/ soil layers
1535  else
1536  {
1537  hAct = ( _h_cum_bottom - _h_bottom) + (_h_cum_top - _h_cum_bottom) * 0.5;
1538  }
1539 
1540  double const relH( cbm::flt_less( length, _lw) ? 1.0 : ((length - hAct) / length));
1541 
1542  // relative biomass distribution throughout the canopy/ soil according to Grote 2007
1543  double fH( pow( _ps, 100.0 * hAct / ( cbm::flt_greater( length, 5.0) ? (length * length) : 25.0)));
1544 
1545  _fract = relH * fH;
1546  }
1547  else
1548  {
1549  _fract = 0.0;
1550  }
1551 }
Here is the caller graph for this function:

◆ fineroots_biomass_distribution()

void ldndc::fineroots_biomass_distribution ( size_t  _sl_cnt_litter,
size_t  _sl_cnt_soil,
double  _ps,
double  _rooting_depth,
double *  _f_frt_sl,
double const *  _h_sl 
)

scaling factor for root distribution (basically to enable root and canopy profile calculations with the same function)

fraction of fine roots in the litter layer

fraction of fine roots in the mineral soil

References estimate_single_layer_biomass().

61 {
62  if ( cbm::flt_greater_zero( _rooting_depth))
63  {
65  double const SCALE( 10.0);
66 
68  double f_litter( 0.0);
69 
70  double litter_depth( 0.0);
71  for ( size_t sl = 0; sl < _sl_cnt_litter; ++sl)
72  {
73  litter_depth += _h_sl[sl];
74  }
75 
76  /* if rooting depth <= litter depth neglect litter layer (new seedlings start in mineral layer)*/
77  if ( cbm::flt_greater( litter_depth, _rooting_depth))
78  {
79  _sl_cnt_litter = 0;
80  f_litter = 0.0;
81  }
82  /* else assume that fine roots are distributed according to litter height relative to soil profile*/
83  else
84  {
85  f_litter = litter_depth / _rooting_depth;
86  }
87 
88  for ( size_t sl = 0; sl < _sl_cnt_litter; ++sl)
89  {
90  _f_frt_sl[sl] = f_litter / (double)_sl_cnt_litter;
91  }
92 
94  double const f_soil( 1.0 - f_litter);
95 
96  double h_cum( 0.0);
97  double f_frt_sum( 0.0);
98  for ( size_t sl = _sl_cnt_litter; sl < _sl_cnt_soil; ++sl)
99  {
100  double const h_cum_old( h_cum);
101  h_cum += _h_sl[sl] * SCALE;
102 
104  _ps, 0.0, SCALE * _rooting_depth,
105  SCALE * _h_sl[sl], _f_frt_sl[sl],
106  h_cum_old, h_cum);
107  f_frt_sum += _f_frt_sl[sl];
108  }
109 
110  for ( size_t sl = _sl_cnt_litter; sl < _sl_cnt_soil; ++sl)
111  {
112  _f_frt_sl[sl] = _f_frt_sl[sl] / f_frt_sum * f_soil;
113  }
114  }
115  else
116  {
117  for ( size_t sl = 0; sl < _sl_cnt_soil; ++sl)
118  {
119  _f_frt_sl[sl] = 0.0;
120  }
121  }
122 }
void estimate_single_layer_biomass(double const _ps, double const _h_bottom, double const _h_top, double _lw, double &_fract, double _h_cum_bottom, double _h_cum_top)
Vertical biomass estimation.
Definition: ld_plantfunctions.cpp:1502
Here is the call graph for this function:

◆ forest_floor()

bool ldndc::forest_floor ( size_t  _sl,
soillayers::input_class_soillayers_t const &  _soillayers,
const ldndc::site::input_class_site_t &  _site 
)

First floor defined by:

  • litter height
  • ecosystem type

Referenced by assign_soillayer_field_capacity_and_wilting_point(), and assign_soillayer_porosity().

110 {
111  if ( _sl < _soillayers.soil_layers_in_litter_cnt())
112  {
113  if ( (_site.soil_use_history() == ECOSYS_FOREST) ||
114  (_site.soil_use_history() == ECOSYS_FOREST_NATURAL))
115  {
116  return true;
117  }
118  }
119 
120  return false;
121 }
Here is the caller graph for this function:

◆ get_optimum_sap_wood_biomass()

double ldndc::get_optimum_sap_wood_biomass ( MoBiLE_Plant *  _p)
Parameters
_pPlant
Returns
Optimum sap wood biomass depending on foliage biomass.

Referenced by get_sapwood_foliage_ratio().

28 {
29  double const sapwood_area_demand( _p->lai_max * _p->qsfa);
30  double optimum_sap_wood( (*_p)->DSAP() * cbm::DM3_IN_M3 * sapwood_area_demand
31  * ( _p->height_at_canopy_start
32  + (_p->rooting_depth / 3.0)
33  + (_p->height_max - _p->height_at_canopy_start) / 3.0));
34 
35  if ( (*_p)->IS_WOOD())
36  {
37  double const total_wood( _p->aboveground_wood() + _p->belowground_wood());
38  return cbm::bound_max( optimum_sap_wood, total_wood);
39  }
40  else
41  {
42  return optimum_sap_wood;
43  }
44 }
Here is the caller graph for this function:

◆ get_sapwood_foliage_ratio()

double ldndc::get_sapwood_foliage_ratio ( MoBiLE_Plant *  _p)
Parameters
_pPlant
Returns
sap wood to foliage ratio

References get_optimum_sap_wood_biomass().

54 {
55  double const biomass_limit( 0.001);
56 
57  if ( !(*_p)->FREEGROWTH() && (_p->nb_ageclasses() > 0) )
58  {
59  size_t na_max( _p->nb_ageclasses() - 1);
60  if ( cbm::flt_greater( _p->mBud + _p->mFol - _p->mFol_na[na_max], biomass_limit))
61  {
62  double const m_sap_opt( get_optimum_sap_wood_biomass(_p));
63  return m_sap_opt / ( _p->mBud + _p->mFol - _p->mFol_na[na_max]);
64  }
65  }
66  else if ( cbm::flt_greater( _p->mFol + _p->mBud, biomass_limit))
67  {
68  double const m_sap_opt( get_optimum_sap_wood_biomass(_p));
69  return m_sap_opt / ( _p->mFol + _p->mBud);
70  }
71 
72  return 0.0;
73 }
double get_optimum_sap_wood_biomass(MoBiLE_Plant *_p)
Definition: ld_sapwoodbiomass.cpp:27
Here is the call graph for this function:

◆ get_voc_emission_factors()

lerr_t ldndc::get_voc_emission_factors ( ldndc::MoBiLE_Plant *  _vt,
int  _fl,
bool  _calc_synthase_activity,
double  _latitude,
int  _yearday,
double  _foliage_temperature,
double  _foliage_radiation 
)

Daily calculation of voc (isoprene and monoterpenes) synthase activity NOTE that fCO2 depends on outside CO2, internal CO2 would probably be better (explaining relatively high emissions when stomata closed)

141 {
142 // if running subdaily calc activity on last subdaily time step
143 
144 
145 // if ("beginning of simulation and first time that pointers are assigned")
146 // --> assign ef with sef
147 // --> assign ef with iso/monoAct
148 //
149 // else if ( "further within simulation ")
150 // --> assign ef with iso/monoAct
151 
152 
153 
154  if ( !_calc_synthase_activity)
155  {
156  ldndc_use_standard_emission_factors( _vt, _fl);
157  return LDNDC_ERR_OK;
158  }
159 
160  else if (( _calc_synthase_activity) && (( ( *_vt)->ALPHA0_IS() + ( *_vt)->ALPHA0_MT()) > 0.0) && ( ( *_vt)->PA() > 0.0))
161  {
162  LOGINFO_ONCE( "Calculation of voc synthase activity instead of standard emission factors");
163  ldndc_calc_voc_synthase_activity( _vt, _fl, _latitude, _yearday, _foliage_temperature, _foliage_radiation);
164 
165  /* factors for conversion from enzyme activity (nmol m-2 (leaf area) s-1) to emission factor (ug component gDW-1 h-1) */
166  double const lsw = cbm::G_IN_KG / _vt->sla_fl[_fl];
167  double const UNIT_CONV = cbm::SEC_IN_HR * cbm::UMOL_IN_NMOL;
168 
169  /* "isoAct_vtfl"/"monoAct_vtfl" [nmol enzyme product m-2 leaf area s-1] activity of isoprene/monterpene synthase to produce isoprene/monoterpenes */
170  _vt->ef_iso_fl[_fl] = _vt->isoAct_fl[_fl] * cbm::MC5H8 * UNIT_CONV / ( lsw * ( *_vt)->SCALE_I());
171  _vt->ef_mono_fl[_fl] = _vt->monoAct_fl[_fl] * cbm::MC10H16 * UNIT_CONV / ( lsw * ( *_vt)->SCALE_M());
172 
173 
174  return LDNDC_ERR_OK;
175  }
176 
177  else if (( _calc_synthase_activity) && ((( ( *_vt)->ALPHA0_IS() + ( *_vt)->ALPHA0_MT()) <= 0.0) || ( ( *_vt)->PA() <= 0.0)))
178  {
179  LOGWARN_ONCE( "Dynamic calculation of emission activity not possible",
180  " because species specific paramters ALPHA0_IS + ALPHA0_MT, or PA is equal or less than zero",
181  " [ALPHA0_IS=",( *_vt)->ALPHA0_IS(),",ALPHA0_MT=",( *_vt)->ALPHA0_MT(),",PA=",( *_vt)->PA(),"]",
182  " Thus standard emission factors are used!");
183 
184  ldndc_use_standard_emission_factors( _vt, _fl);
185  return LDNDC_ERR_OK;
186 
187  }
188 
189  else
190  {
191  LOGERROR("Wrong configuration of CalcSynthaseActivity, CalcParTempDependence, or species specific parameters...");
192  return LDNDC_ERR_FAIL;
193  }
194 
195 }

◆ non_stomatal_water_limitation()

double ldndc::non_stomatal_water_limitation ( double const &  _var,
double const &  _var_ref,
double const &  _var_scale 
)

Non stomatal water limitation.

Parameters
_var...
_var_ref...
_var_scale...
Returns
Drought stress scaling factor [0-1]
140 {
141  // water impact on non-stomatal limitations based on Tuzet et al.
142  if ( cbm::flt_greater_equal_zero( _var))
143  {
144  return 1.0;
145  }
146  else
147  {
148  return cbm::bound(0.0, (1.0 + std::exp(_var_ref * _var_scale)) / (1.0 + std::exp((_var_ref - _var) * _var_scale)), 1.0);
149  }
150 }

◆ sap_wood_fraction()

double ldndc::sap_wood_fraction ( double  _lai_max,
double  _qsfa,
double  _height_min,
double  _height_max,
double  _depth 
)

sap_wood_fraction The calculation of the fraction of sapwood in coarse roots is based on the idealized volume fraction and assumes that the stem in the crown as well as the coarse roots are shaped as cones, and that core wood reaches a third of the cone

Calculation is based on the sapwood area demand for foliage. Sapwood volume is assumed to equal a cone within the canopy and across the rooted soil, and a column between the ground and canopy start.

Author
david kraus (created on: may 6, 2014)
22 {
23  /* sapwood area (assumed to be in equilibrium with foliage demand) */
24  double const sapArea( _lai_max * _qsfa);
25 
26  /* estimated aboveground sapwood biomass */
27  double const msap_a( sapArea * _height_min + sapArea/3.0 * (_height_max - _height_min));
28 
29  /* estimated belowground sapwood biomass */
30  double const msap_b( sapArea / 3.0 * _depth);
31 
32  if ( cbm::flt_greater_zero( msap_a + msap_b))
33  {
34  return msap_b / ( msap_a + msap_b);
35  }
36 
37  return 0.0;
38 }

◆ sapwood_foliage_area_ratio()

double ldndc::sapwood_foliage_area_ratio ( double  _height,
double  _qsf_p1,
double  _qsf_p2 
)
Parameters
_heightTree height
_qsf_p1species parameter
_qsf_p2species parameter
Returns
Ratio of sap wood area to foliage area.
97 {
98  return (_qsf_p1 + std::max( 0.5 * cbm::HLIMIT, _height) * _qsf_p2) * cbm::M2_IN_CM2;
99 }

◆ update_litter_height()

lerr_t ldndc::update_litter_height ( soillayers::input_class_soillayers_t const &  _soillayers,
substate_watercycle_t &  _wc,
substate_soilchemistry_t &  _sc 
)

Detailed description provided here .

Parameters
_slSoil layers class
_wcWatercycle state
_scSoilchemistry state
Returns
Error code

Referenced by ldndc::SoilChemistryMeTrX::MeTrX_update().

30 {
31  double h_cum( 0.0);
32  for( size_t sl = 0; sl < _soillayers.soil_layer_cnt(); ++sl)
33  {
34  if (sl < _soillayers.soil_layers_in_litter_cnt())
35  {
36  if ( cbm::flt_greater_zero( _sc.dens_sl[sl] * _sc.fcorg_sl[sl]) && cbm::flt_greater_zero( _sc.som_sl[sl]))
37  {
38  // soil organic matter increases --> inc sl-height
39  double const h_sl_0( cbm::CCORG * _sc.som_sl[sl] / ( cbm::DM3_IN_M3 * _sc.dens_sl[sl] * _sc.fcorg_sl[sl]));
40  _wc.wc_sl[sl] *= _sc.h_sl[sl] / h_sl_0;
41  _sc.h_sl[sl] = h_sl_0;
42  }
43 
44  if ( !cbm::flt_greater_zero( _sc.som_sl[sl]))
45  {
46  _sc.h_sl[sl] = 0.0;
47  _wc.wc_sl[sl] = 0.0;
48 
49  LOGERROR( "Soil litter layer height vanished. Illegal situation!");
50  return LDNDC_ERR_FAIL;
51  }
52  }
53 
54  h_cum += _sc.h_sl[sl];
55  _sc.depth_sl[sl] = h_cum;
56  }
57 
58  return LDNDC_ERR_OK;
59 }
Here is the caller graph for this function:

◆ wood_initialization()

lerr_t ldndc::wood_initialization ( soillayers::input_class_soillayers_t const &  _sl,
MoBiLE_PlantVegetation &  _m_veg,
substate_soilchemistry_t &  _sc,
ecosystem_type_e  _ecosystemtype 
)

Initialization of aboveground and belowground wood debris, derived from existing vegetation.

23 {
24  for ( PlantIterator vt = _m_veg.begin(); vt != _m_veg.end(); ++vt)
25  {
26  MoBiLE_Plant *p = *vt;
32  double const add_c_wood( ((_ecosystemtype == ECOSYS_FOREST_NATURAL) ? 0.3 : 0.1) * ( p->mSap + p->mCor) * cbm::CCDM);
33 
34  //add 80% aboveground
35  _sc.c_wood += 0.8 * add_c_wood;
36  _sc.n_wood += 0.8 * add_c_wood / cbm::CCDM * p->ncCor;
37 
38  //add 20% belowground
39  for ( size_t sl = 0; sl < _sl.soil_layer_cnt(); ++sl)
40  {
41  _sc.c_wood_sl[sl] += 0.2 * p->fFrt_sl[sl] * add_c_wood;
42  _sc.n_wood_sl[sl] += 0.2 * p->fFrt_sl[sl] * add_c_wood / cbm::CCDM * p->ncCor;
43  }
44  }
45 
46  return LDNDC_ERR_OK;
47 }

Variable Documentation

◆ module_factories

ldndc::MoBiLE_ModuleFactoryEnvelope const ldndc::module_factories

a list of destructors (because i was to lazy to add a one line file for these base classes..)
module factory array is defined here.

Author
  • steffen klatt,
  • edwin haas,

◆ substate_airchemistry_factory

ldndc::substate_factory_t< substate_airchemistry_t > const ldndc::substate_airchemistry_factory

substate base class implementation, sources factories

Author
edwin haas, steffen klatt (created on: dec 05, 2013)

◆ TMODE_DEFAULTS

lflags_t const ldndc::TMODE_DEFAULTS = TMODE_SUBDAILY|TMODE_PRE_DAILY|TMODE_POST_DAILY|TMODE_PRE_YEARLY|TMODE_POST_YEARLY
Author
steffen klatt, edwin haas