Rev 534 | Rev 582 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
448 | werner | 2 | #ifndef SOIL_H |
3 | #define SOIL_H |
||
4 | |||
525 | werner | 5 | #include "snag.h" |
527 | werner | 6 | struct SoilParams; // forward |
448 | werner | 7 | class Soil |
8 | { |
||
9 | public: |
||
525 | werner | 10 | // lifecycle |
448 | werner | 11 | Soil(); |
525 | werner | 12 | /// set initial pool contents |
534 | werner | 13 | void setInitialState(const CNPool &young_labile_kg_ha, const CNPool &young_refractory_kg_ha, const CNPair &SOM_kg_ha); |
525 | werner | 14 | |
15 | // actions |
||
16 | void setSoilInput(const CNPool &labile_input_kg_ha, const CNPool &refractory_input_kg_ha); ///< provide values for input pools |
||
17 | void setClimateFactor(const double climate_factor_re) { mRE = climate_factor_re; } ///< set the climate decomposition factor for the current year |
||
526 | werner | 18 | void calculateYear(); ///< main calculation function: calculates the update of state variables |
566 | werner | 19 | /// remove part of the carbon (e.g.: due to fire). N content is not changed. |
20 | /// @param DWDfrac fraction of downed woody debris (yR) to remove (0: nothing, 1: remove 100% percent) |
||
21 | /// @param litterFrac fraction of litter pools (yL) to remove (0: nothing, 1: remove 100% percent) |
||
22 | /// @param soilFrac fraction of soil pool (SOM) to remove (0: nothing, 1: remove 100% percent) |
||
23 | void disturbance(double DWDfrac, double litterFrac, double soilFrac); |
||
525 | werner | 24 | |
25 | // access |
||
26 | const CNPool &youngLabile() const { return mYL;} ///< young labile matter (t/ha) |
||
27 | const CNPool &youngRefractory() const { return mYR;} ///< young refractory matter (t/ha) |
||
534 | werner | 28 | const CNPair &oldOrganicMatter() const { return mSOM;} ///< old matter (SOM) (t/ha) |
525 | werner | 29 | double availableNitrogen() const { return mAvailableNitrogen; } ///< return available Nitrogen (kg/ha*yr) |
30 | QList<QVariant> debugList(); ///< return a debug output |
||
31 | private: |
||
527 | werner | 32 | void fetchParameters(); ///< set iland parameters for soil |
33 | static SoilParams *mParams; // static container for parameters |
||
525 | werner | 34 | // variables |
35 | double mRE; ///< climate factor 're' (see Snag::calculateClimateFactors()) |
||
36 | double mAvailableNitrogen; ///< plant available nitrogen (kg/ha) |
||
534 | werner | 37 | double mKyl; ///< litter decomposition rate |
38 | double mKyr; ///< downed woody debris (dwd) decomposition rate |
||
39 | double mKo; ///< decomposition rate for soil organic matter (i.e. the "old" pool sensu ICBM) |
||
40 | double mH; ///< humification rate |
||
41 | |||
525 | werner | 42 | CNPool mInputLab; ///< input pool labile matter (t/ha) |
43 | CNPool mInputRef; ///< input pool refractory matter (t/ha) |
||
44 | // state variables |
||
45 | CNPool mYL; ///< C/N Pool for young labile matter (i.e. litter) (t/ha) |
||
46 | CNPool mYR; ///< C/N Pool for young refractory matter (i.e. downed woody debris) (t/ha) |
||
534 | werner | 47 | CNPair mSOM; ///< C/N Pool for old matter (t/ha) (i.e. soil organic matter, SOM) |
448 | werner | 48 | }; |
49 | |||
50 | #endif // SOIL_H |