/////////////////////////////////////////////////////////////////////////////////////// /// \file landcover.h /// \brief Functions handling landcover aspects, such as creating or resizing Stands /// /// \author Mats Lindeskog /// $Date: 2018-12-21 08:30:58 +0100 (ven, 21 déc 2018) $ /// /////////////////////////////////////////////////////////////////////////////////////// #ifndef LPJ_GUESS_LANDCOVER_H #define LPJ_GUESS_LANDCOVER_H #include "guess.h" #include "growth.h" #include "canexch.h" #include "cropsowing.h" #include "cropphenology.h" #include "cropallocation.h" #include "management.h" #include "externalinput.h" #include "inputmodule.h" const int def_verndate_ndays_after_last_springdate = 60; /// Creates stands for landcovers present in the gridcell first year of the simulation void landcover_init(Gridcell& gridcell, InputModule* input_module); /// Handles changes in the landcover fractions from year to year /** This function will for instance kill or create new stands * if needed. */ void landcover_dynamics(Gridcell& gridcell, InputModule* input_module); /// Query whether a date is within a period spanned by two dates. bool dayinperiod(int day, int start, int end); /// Step n days from a date. int stepfromdate(int day, int step); /// struct storing carbon, nitrogen and water (plus aaet_5 and anfix_calc) during landcover change struct landcover_change_transfer { double *transfer_litter_leaf; double *transfer_litter_sap; double *transfer_litter_heart; double *transfer_litter_root; double *transfer_litter_repr; double *transfer_harvested_products_slow; double *transfer_nmass_litter_leaf; double *transfer_nmass_litter_sap; double *transfer_nmass_litter_heart; double *transfer_nmass_litter_root; double *transfer_harvested_products_slow_nmass; double transfer_acflux_harvest; double transfer_anflux_harvest; double transfer_cpool_fast; double transfer_cpool_slow; double transfer_wcont[NSOILLAYER]; double transfer_wcont_evap; double transfer_decomp_litter_mean; double transfer_k_soilfast_mean; double transfer_k_soilslow_mean; Sompool transfer_sompool[NSOMPOOL]; double transfer_nmass_avail; double transfer_snowpack; double transfer_snowpack_nmass; Historic transfer_aaet_5; double transfer_anfix_calc; landcover_change_transfer(); ~landcover_change_transfer(); void allocate(); double ccont() { double ccont = transfer_acflux_harvest; for(int i=0; i