Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rmscheller committed Jan 26, 2022
2 parents 00a19df + 5cf0d8d commit ee7fe37
Show file tree
Hide file tree
Showing 22 changed files with 391 additions and 34 deletions.
12 changes: 10 additions & 2 deletions src/CohortBiomass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,21 @@ private void UpdateDeadBiomass(ICohort cohort, ActiveSite site, double[] totalMo
// Add mortality to dead biomass pools.
// Coarse root mortality is assumed proportional to aboveground woody mortality
// mass is assumed 25% of aboveground wood (White et al. 2000, Niklas & Enquist 2002)
if(mortality_wood > 0.0)
if(mortality_wood > 0.0 && !SpeciesData.Grass[cohort.Species])
{
ForestFloor.AddWoodLitter(mortality_wood, cohort.Species, site);
Roots.AddCoarseRootLitter(mortality_wood, cohort, cohort.Species, site);
}

if(mortality_nonwood > 0.0)
// Wood biomass of grass species is transfered to non wood litter. (W.Hotta 2021.12.16)
if (mortality_wood > 0.0 && SpeciesData.Grass[cohort.Species])
{
AvailableN.AddResorbedN(cohort, totalMortality[0], site); //ignoring input from scorching, which is rare, but not resorbed.
ForestFloor.AddResorbedFoliageLitter(mortality_wood, cohort.Species, site);
Roots.AddFineRootLitter(mortality_wood, cohort, cohort.Species, site);
}

if (mortality_nonwood > 0.0)
{
AvailableN.AddResorbedN(cohort, totalMortality[1], site); //ignoring input from scorching, which is rare, but not resorbed.
ForestFloor.AddResorbedFoliageLitter(mortality_nonwood, cohort.Species, site);
Expand Down
18 changes: 9 additions & 9 deletions src/ForestFloor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public static void AddWoodLitter(double woodBiomass,
ISpecies species,
ActiveSite site)
{

if(woodBiomass > 0)
WoodLayer.PartitionResidue(woodBiomass,
FunctionalType.Table[SpeciesData.FuncType[species]].WoodDecayRate,
SpeciesData.WoodCN[species],
SpeciesData.WoodLignin[species],
LayerName.Wood,
LayerType.Surface,
site);
if (woodBiomass > 0)
WoodLayer.PartitionResidue(woodBiomass,
FunctionalType.Table[SpeciesData.FuncType[species]].WoodDecayRate,
SpeciesData.WoodCN[species],
SpeciesData.WoodLignin[species],
LayerName.Wood,
LayerType.Surface,
site);

}

Expand Down
6 changes: 6 additions & 0 deletions src/HarvestEffects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ public static void ReduceLayers(string prescriptionName, Site site)
SiteVars.SurfaceDeadWood[site].Nitrogen -= nitrogenLoss;
SiteVars.SourceSink[site].Nitrogen += nitrogenLoss;

// Reduce carbon from CWD
// Chihiro; 2020.01.20
SiteVars.OriginalDeadWoodC[site][PlugIn.ModelCore.CurrentTime - 1] -= carbonLoss;
SiteVars.CurrentDeadWoodC[site][PlugIn.ModelCore.CurrentTime - 1] -= carbonLoss;


// Soil Organic Matter (Duff)

carbonLoss = Math.Round(SiteVars.SOM1surface[site].Carbon * som_Multiplier, 2);
Expand Down
44 changes: 42 additions & 2 deletions src/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
namespace Landis.Extension.Succession.NECN
{

public enum LayerName {Leaf, FineRoot, Wood, CoarseRoot, Metabolic, Structural, SOM1, SOM2, SOM3, Other};
// Chihiro; add grass layer to track dead wood in grass species
public enum LayerName { Leaf, FineRoot, Wood, CoarseRoot, Metabolic, Structural, SOM1, SOM2, SOM3, Other };
public enum LayerType {Surface, Soil, Other}

/// <summary>
Expand All @@ -36,7 +37,46 @@ public Layer(LayerName name, LayerType type)
this.carbon = 0.0;
this.nitrogen = 0.0;

this.decayValue = 0.0;
// Initial decay value of Wood is set to mean decay rate of all tree species.
//
//
// if this.name is LayerName.Wood:
// double decayvalue = 0.0
// double N_of_species = len(sppnames)
// // Compute mean wood decay rate
// for sppname in tree-sppnames:
// decayrate += decayrate(sppname)
// this.decayVlaue = decayvalue / N_of_species
//
// elif this.name is LayerName.Grass:
// double decayvalue = 0.0
// double N_of_species = len(sppnames)
// // Compute mean wood decay rate
// for sppname in grass-sppnames:
// decayrate += decayrate(sppname)
// this.decayVlaue = decayvalue / N_of_species
//
// else:
// this.decayValue = 0.0
//
if (this.name == LayerName.Wood)
{
// Compute mean decay value
double decayvalue = 0.0;
double n_of_tree_species = 0.0;
foreach (ISpecies species in PlugIn.ModelCore.Species)
{
if (!SpeciesData.Grass[species])
decayvalue += FunctionalType.Table[SpeciesData.FuncType[species]].WoodDecayRate;
n_of_tree_species += 1;
}
this.decayValue = decayvalue / n_of_tree_species;
}
else
{
this.decayValue = 0.0;
}
//this.decayValue = 0.0;
this.fractionLignin = 0.0;

this.netMineralization = 0.0;
Expand Down
5 changes: 5 additions & 0 deletions src/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public static ISiteCohorts Run(ActiveSite site,


WoodLayer.Decompose(site);
if (OtherData.CalibrateMode)
{
PlugIn.ModelCore.UI.WriteLine("currentDeadWoodC:{0},{1},{2}", PlugIn.ModelCore.CurrentTime, Month, string.Join(", ", SiteVars.CurrentDeadWoodC[site]));
PlugIn.ModelCore.UI.WriteLine("SurfaceDeadWoodC: {0},{1},{2}", PlugIn.ModelCore.CurrentTime, Month, SiteVars.SurfaceDeadWood[site].Carbon);
}
LitterLayer.Decompose(site);
SoilLayer.Decompose(site);

Expand Down
Loading

0 comments on commit ee7fe37

Please sign in to comment.