//--------------------------------------------------------------------- public void CohortPartialMortality(object sender, Landis.Library.BiomassCohorts.PartialDeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; Landis.Library.BiomassCohorts.ICohort cohort = eventArgs.Cohort; double fractionPartialMortality = (double)eventArgs.Reduction / (double)cohort.Biomass; //PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY START: species={0}, age={1}, biomass={2}, fraction_mortality={3:0.00}.", cohort.Species.Name, cohort.Age, cohort.Biomass, fractionPartialMortality); int nonWoody = cohort.ComputeNonWoodyBiomass(site); int woody = (cohort.Biomass - nonWoody); int foliarInput = (int)((double)nonWoody * fractionPartialMortality); int woodInput = (int)((double)woody * fractionPartialMortality); if (disturbanceType.IsMemberOf("disturbance:harvest") || disturbanceType.IsMemberOf("disturbance:fire")) { AgeOnlyDisturbances.PoolPercentages cohortReductions = AgeOnlyDisturbances.Module.Parameters.CohortReductions[disturbanceType]; foliarInput = AgeOnlyDisturbances.Events.ReduceInput(foliarInput, cohortReductions.Foliar); woodInput = AgeOnlyDisturbances.Events.ReduceInput(woodInput, cohortReductions.Wood); } ForestFloor.AddWoody(woodInput, cohort.Species, site); ForestFloor.AddLitter(foliarInput, cohort.Species, site); //PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY SUMMARY: Cohort Partial Mortality: species={0}, age={1}, disturbance={2}.", cohort.Species.Name, cohort.Age, disturbanceType); //PlugIn.ModelCore.UI.WriteLine(" InputB/TotalB: Foliar={0:0.00}/{1:0.00}, Wood={2:0.0}/{3:0.0}.", foliarInput, nonWoody, woodInput, woody); return; }
//--------------------------------------------------------------------- // This method does not trigger reproduction public void CohortPartialMortality(object sender, Landis.Library.BiomassCohorts.PartialDeathEventArgs eventArgs) { //PlugIn.ModelCore.UI.WriteLine("Cohort Partial Mortality: {0}", eventArgs.Site); ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; ICohort cohort = (Landis.Library.LeafBiomassCohorts.ICohort)eventArgs.Cohort; float fractionPartialMortality = (float)eventArgs.Reduction; float foliarInput = cohort.LeafBiomass * fractionPartialMortality; float woodInput = cohort.WoodBiomass * fractionPartialMortality; if (disturbanceType.IsMemberOf("disturbance:harvest")) { SiteVars.HarvestPrescriptionName = PlugIn.ModelCore.GetSiteVar <string>("Harvest.PrescriptionName"); if (!Disturbed[site]) // this is the first cohort killed/damaged { HarvestEffects.ReduceLayers(SiteVars.HarvestPrescriptionName[site], site); } woodInput -= woodInput * (float)HarvestEffects.GetCohortWoodRemoval(site); foliarInput -= foliarInput * (float)HarvestEffects.GetCohortLeafRemoval(site); } if (disturbanceType.IsMemberOf("disturbance:fire")) { SiteVars.FireSeverity = PlugIn.ModelCore.GetSiteVar <byte>("Fire.Severity"); if (!Disturbed[site]) // this is the first cohort killed/damaged { SiteVars.SmolderConsumption[site] = 0.0; SiteVars.FlamingConsumption[site] = 0.0; if (SiteVars.FireSeverity != null && SiteVars.FireSeverity[site] > 0) { FireEffects.ReduceLayers(SiteVars.FireSeverity[site], site); } } double woodFireConsumption = woodInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].CoarseLitterReduction; double foliarFireConsumption = foliarInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].FineLitterReduction; SiteVars.SmolderConsumption[site] += woodFireConsumption; SiteVars.FlamingConsumption[site] += foliarFireConsumption; woodInput -= (float)woodFireConsumption; foliarInput -= (float)foliarFireConsumption; } ForestFloor.AddWoodLitter(woodInput, cohort.Species, site); ForestFloor.AddFoliageLitter(foliarInput, cohort.Species, site); Roots.AddCoarseRootLitter(Roots.CalculateCoarseRoot(cohort, cohort.WoodBiomass * fractionPartialMortality), cohort, cohort.Species, site); Roots.AddFineRootLitter(Roots.CalculateFineRoot(cohort, cohort.LeafBiomass * fractionPartialMortality), cohort, cohort.Species, site); //PlugIn.ModelCore.UI.WriteLine("EVENT: Cohort Partial Mortality: species={0}, age={1}, disturbance={2}.", cohort.Species.Name, cohort.Age, disturbanceType); //PlugIn.ModelCore.UI.WriteLine(" Cohort Reductions: Foliar={0:0.00}. Wood={1:0.00}.", HarvestEffects.GetCohortLeafRemoval(site), HarvestEffects.GetCohortLeafRemoval(site)); //PlugIn.ModelCore.UI.WriteLine(" InputB/TotalB: Foliar={0:0.00}/{1:0.00}, Wood={2:0.0}/{3:0.0}.", foliarInput, cohort.LeafBiomass, woodInput, cohort.WoodBiomass); Disturbed[site] = true; return; }
//--------------------------------------------------------------------- public void CohortPartialMortality(object sender, Landis.Library.BiomassCohorts.PartialDeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; Landis.Library.BiomassCohorts.ICohort cohort = eventArgs.Cohort; double fractionPartialMortality = (double)eventArgs.Reduction / (double)cohort.Biomass; //PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY START: species={0}, age={1}, biomass={2}, fraction_mortality={3:0.00}.", cohort.Species.Name, cohort.Age, cohort.Biomass, fractionPartialMortality); int nonWoody = cohort.ComputeNonWoodyBiomass(site); int woody = (cohort.Biomass - nonWoody); float foliarInput = ((float)nonWoody * (float)fractionPartialMortality); float woodInput = ((float)woody * (float)fractionPartialMortality); if (disturbanceType.IsMemberOf("disturbance:harvest")) { SiteVars.HarvestPrescriptionName = PlugIn.ModelCore.GetSiteVar <string>("Harvest.PrescriptionName"); if (!Disturbed[site]) // this is the first cohort killed/damaged { HarvestEffects.ReduceLayers(SiteVars.HarvestPrescriptionName[site], site); } woodInput -= woodInput * (float)HarvestEffects.GetCohortWoodRemoval(site); foliarInput -= foliarInput * (float)HarvestEffects.GetCohortLeafRemoval(site); } if (disturbanceType.IsMemberOf("disturbance:fire")) { SiteVars.FireSeverity = PlugIn.ModelCore.GetSiteVar <byte>("Fire.Severity"); if (!Disturbed[site]) // this is the first cohort killed/damaged { if (SiteVars.FireSeverity != null && SiteVars.FireSeverity[site] > 0) { FireEffects.ReduceLayers(SiteVars.FireSeverity[site], site); } } double woodFireConsumption = woodInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].CoarseLitterReduction; double foliarFireConsumption = foliarInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].FineLitterReduction; woodInput -= (float)woodFireConsumption; foliarInput -= (float)foliarFireConsumption; } ForestFloor.AddWoody(woodInput, cohort.Species, site); ForestFloor.AddLitter(foliarInput, cohort.Species, site); //PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY SUMMARY: Cohort Partial Mortality: species={0}, age={1}, disturbance={2}.", cohort.Species.Name, cohort.Age, disturbanceType); //PlugIn.ModelCore.UI.WriteLine(" InputB/TotalB: Foliar={0:0.00}/{1:0.00}, Wood={2:0.0}/{3:0.0}.", foliarInput, nonWoody, woodInput, woody); return; }
//--------------------------------------------------------------------- public void CohortDied(object sender, Landis.Library.BiomassCohorts.DeathEventArgs eventArgs) { //PlugIn.ModelCore.UI.WriteLine("Cohort Died! :-("); ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; ICohort cohort = (Landis.Library.LeafBiomassCohorts.ICohort)eventArgs.Cohort; double foliar = (double)cohort.LeafBiomass; double wood = (double)cohort.WoodBiomass; if (disturbanceType == null) { ForestFloor.AddWoodLitter(wood, cohort.Species, eventArgs.Site); ForestFloor.AddFoliageLitter(foliar, cohort.Species, eventArgs.Site); Roots.AddCoarseRootLitter(wood, cohort, cohort.Species, eventArgs.Site); Roots.AddFineRootLitter(foliar, cohort, cohort.Species, eventArgs.Site); } if (disturbanceType != null) { Disturbed[site] = true; if (disturbanceType.IsMemberOf("disturbance:fire")) { Landis.Library.Succession.Reproduction.CheckForPostFireRegen(eventArgs.Cohort, site); } else { Landis.Library.Succession.Reproduction.CheckForResprouting(eventArgs.Cohort, site); } } }
//--------------------------------------------------------------------- // Outmoded but required? public static void SiteDisturbed(object sender, Landis.Library.BiomassCohorts.DisturbanceEventArgs eventArgs) { PlugIn.ModelCore.UI.WriteLine(" Calculating Fire or Harvest Effects."); ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; if (disturbanceType.IsMemberOf("disturbance:fire")) { SiteVars.FireSeverity = PlugIn.ModelCore.GetSiteVar <byte>("Fire.Severity"); if (SiteVars.FireSeverity != null && SiteVars.FireSeverity[site] > 0) { FireEffects.ReduceLayers(SiteVars.FireSeverity[site], site); } } if (disturbanceType.IsMemberOf("disturbance:harvest")) { HarvestEffects.ReduceLayers(SiteVars.HarvestPrescriptionName[site], site); } }
//--------------------------------------------------------------------- public void DeathEvent(object sender, Landis.Library.PnETCohorts.DeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; if (disturbanceType != null) { ActiveSite site = eventArgs.Site; if (disturbanceType.IsMemberOf("disturbance:fire")) { Reproduction.CheckForPostFireRegen(eventArgs.Cohort, site); } else { Reproduction.CheckForResprouting(eventArgs.Cohort, site); } } }
public static void CohortDied(object sender, DeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; //PoolPercentages cohortReductions = Module.Parameters.CohortReductions[disturbanceType]; ICohort cohort = eventArgs.Cohort; ActiveSite site = eventArgs.Site; if (disturbanceType.IsMemberOf("disturbance:harvest")) //base harvest doesn't get here ever, but biomass harvest does. { return; //It has already been accounted for, however in PlugIn.CohortDied, so don't repeat here. } double foliar = (double)cohort.ComputeNonWoodyBiomass(site); double wood = ((double)cohort.Biomass - foliar); SiteVars.soilClass[site].DisturbanceImpactsBiomass(site, cohort.Species, cohort.Age, wood, foliar, disturbanceType.Name, 0); }
public void CohortDied(object sender, DeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; if (disturbanceType != null) { ActiveSite site = eventArgs.Site; Disturbed[site] = true; if (disturbanceType.IsMemberOf("disturbance:fire")) { Reproduction.CheckForPostFireRegen(eventArgs.Cohort, site); } else { Reproduction.CheckForResprouting(eventArgs.Cohort, site); } } }
//--------------------------------------------------------------------- public void CohortDied(object sender, DeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; if (disturbanceType != null) { ActiveSite site = eventArgs.Site; Disturbed[site] = true; if (disturbanceType.IsMemberOf("disturbance:fire")) { Landis.Library.Succession.Reproduction.CheckForPostFireRegen(eventArgs.Cohort, site); } else { Landis.Library.Succession.Reproduction.CheckForResprouting(eventArgs.Cohort, site); } } //modelCore.Log.WriteLine(" Cohort DIED: {0}:{1}.", eventArgs.Cohort.Species.Name, eventArgs.Cohort.Age); }
//--------------------------------------------------------------------- // Total mortality, including from disturbance or senescence. public void CohortTotalMortality(object sender, Landis.Library.BiomassCohorts.DeathEventArgs eventArgs) { //PlugIn.ModelCore.UI.WriteLine("Cohort Total Mortality: {0}", eventArgs.Site); ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; ICohort cohort = (Landis.Library.LeafBiomassCohorts.ICohort)eventArgs.Cohort; double foliarInput = (double)cohort.LeafBiomass; double woodInput = (double)cohort.WoodBiomass; if (disturbanceType != null) { //PlugIn.ModelCore.UI.WriteLine("DISTURBANCE EVENT: Cohort Died: species={0}, age={1}, disturbance={2}.", cohort.Species.Name, cohort.Age, eventArgs.DisturbanceType); if (disturbanceType.IsMemberOf("disturbance:fire")) { SiteVars.FireSeverity = PlugIn.ModelCore.GetSiteVar <byte>("Fire.Severity"); Landis.Library.Succession.Reproduction.CheckForPostFireRegen(eventArgs.Cohort, site); if (!Disturbed[site]) // the first cohort killed/damaged { SiteVars.SmolderConsumption[site] = 0.0; SiteVars.FlamingConsumption[site] = 0.0; if (SiteVars.FireSeverity != null && SiteVars.FireSeverity[site] > 0) { FireEffects.ReduceLayers(SiteVars.FireSeverity[site], site); } } double woodFireConsumption = woodInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].CoarseLitterReduction; double foliarFireConsumption = foliarInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].FineLitterReduction; SiteVars.SmolderConsumption[site] += woodFireConsumption; SiteVars.FlamingConsumption[site] += foliarFireConsumption; woodInput -= (float)woodFireConsumption; foliarInput -= (float)foliarFireConsumption; } else { if (disturbanceType.IsMemberOf("disturbance:harvest")) { SiteVars.HarvestPrescriptionName = PlugIn.ModelCore.GetSiteVar <string>("Harvest.PrescriptionName"); if (!Disturbed[site]) // the first cohort killed/damaged { HarvestEffects.ReduceLayers(SiteVars.HarvestPrescriptionName[site], site); } woodInput -= woodInput * (float)HarvestEffects.GetCohortWoodRemoval(site); foliarInput -= foliarInput * (float)HarvestEffects.GetCohortLeafRemoval(site); } // If not fire, check for resprouting: Landis.Library.Succession.Reproduction.CheckForResprouting(eventArgs.Cohort, site); } } //PlugIn.ModelCore.UI.WriteLine("Cohort Died: species={0}, age={1}, wood={2:0.00}, foliage={3:0.00}.", cohort.Species.Name, cohort.Age, wood, foliar); ForestFloor.AddWoodLitter(woodInput, cohort.Species, eventArgs.Site); ForestFloor.AddFoliageLitter(foliarInput, cohort.Species, eventArgs.Site); // Assume that ALL dead root biomass stays on site. Roots.AddCoarseRootLitter(Roots.CalculateCoarseRoot(cohort, cohort.WoodBiomass), cohort, cohort.Species, eventArgs.Site); Roots.AddFineRootLitter(Roots.CalculateFineRoot(cohort, cohort.LeafBiomass), cohort, cohort.Species, eventArgs.Site); if (disturbanceType != null) { Disturbed[site] = true; } return; }
public void CohortTotalMortality(object sender, DeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; ICohort cohort = (Landis.Library.BiomassCohorts.ICohort)eventArgs.Cohort; int foliarInput = cohort.ComputeNonWoodyBiomass(site); int woodInput = (cohort.Biomass - foliarInput); if (disturbanceType != null) { if (PlugIn.CalibrateMode && PlugIn.ModelCore.CurrentTime > 0) { PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION TOTAL MORTALITY: species={0}, age={1}, woodInput={2}, foliarInputs={3}.", cohort.Species.Name, cohort.Age, woodInput, foliarInput); } if (disturbanceType.IsMemberOf("disturbance:fire")) { SiteVars.FireSeverity = PlugIn.ModelCore.GetSiteVar <byte>("Fire.Severity"); Landis.Library.Succession.Reproduction.CheckForPostFireRegen(eventArgs.Cohort, site); if (!Disturbed[site]) // the first cohort killed/damaged { if (SiteVars.FireSeverity != null && SiteVars.FireSeverity[site] > 0) { FireEffects.ReduceLayers(SiteVars.FireSeverity[site], site); } } double woodFireConsumption = woodInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].CoarseLitterReduction; double foliarFireConsumption = foliarInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].FineLitterReduction; woodInput -= (int)woodFireConsumption; foliarInput -= (int)foliarFireConsumption; } else { if (disturbanceType.IsMemberOf("disturbance:harvest")) { SiteVars.HarvestPrescriptionName = PlugIn.ModelCore.GetSiteVar <string>("Harvest.PrescriptionName"); if (!Disturbed[site]) // the first cohort killed/damaged { HarvestEffects.ReduceLayers(SiteVars.HarvestPrescriptionName[site], site); } woodInput -= (int)(woodInput * (float)HarvestEffects.GetCohortWoodRemoval(site)); foliarInput -= (int)(foliarInput * (float)HarvestEffects.GetCohortLeafRemoval(site)); } // If not fire, check for resprouting: Landis.Library.Succession.Reproduction.CheckForResprouting(eventArgs.Cohort, site); } } //PlugIn.ModelCore.UI.WriteLine("Cohort Died: species={0}, age={1}, wood={2:0.00}, foliage={3:0.00}.", cohort.Species.Name, cohort.Age, wood, foliar); ForestFloor.AddWoody(woodInput, cohort.Species, eventArgs.Site); ForestFloor.AddLitter(foliarInput, cohort.Species, eventArgs.Site); // Assume that ALL dead root biomass stays on site. //Roots.AddCoarseRootLitter(Roots.CalculateCoarseRoot(cohort, cohort.WoodBiomass), cohort, cohort.Species, eventArgs.Site); //Roots.AddFineRootLitter(Roots.CalculateFineRoot(cohort, cohort.LeafBiomass), cohort, cohort.Species, eventArgs.Site); if (disturbanceType != null) { Disturbed[site] = true; } return; //ExtensionType disturbanceType = eventArgs.DisturbanceType; //if (disturbanceType != null) //{ // ActiveSite site = eventArgs.Site; // Disturbed[site] = true; // if (disturbanceType.IsMemberOf("disturbance:fire")) // Reproduction.CheckForPostFireRegen(eventArgs.Cohort, site); // else // Reproduction.CheckForResprouting(eventArgs.Cohort, site); //} }
//--------------------------------------------------------------------- public void CohortPartialMortality(object sender, Landis.Library.BiomassCohorts.PartialDeathEventArgs eventArgs) { ExtensionType disturbanceType = eventArgs.DisturbanceType; ActiveSite site = eventArgs.Site; Landis.Library.BiomassCohorts.ICohort cohort = eventArgs.Cohort; double partialMortality = (double)eventArgs.Reduction; if (PlugIn.CalibrateMode && PlugIn.ModelCore.CurrentTime > 0) { PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY I: species={0}, age={1}, disturbance={2}.", cohort.Species.Name, cohort.Age, disturbanceType); PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY I: eventReduction={0:0.0}, new_cohort_biomass={1}.", eventArgs.Reduction, cohort.Biomass); } double nonWoodyFraction = (double)cohort.ComputeNonWoodyBiomass(site) / (double)cohort.Biomass; double woodyFraction = 1.0 - nonWoodyFraction; float foliarInput = (float)(partialMortality * nonWoodyFraction); // ((float) nonWoody * (float) fractionPartialMortality); float woodInput = (float)(partialMortality * woodyFraction); // ((float) woody * (float) fractionPartialMortality); if (PlugIn.CalibrateMode && PlugIn.ModelCore.CurrentTime > 0) { PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY II: species={0}, age={1}, woodInput={2}, foliarInputs={3}.", cohort.Species.Name, cohort.Age, woodInput, foliarInput); } if (disturbanceType.IsMemberOf("disturbance:harvest")) { SiteVars.HarvestPrescriptionName = PlugIn.ModelCore.GetSiteVar <string>("Harvest.PrescriptionName"); if (!Disturbed[site]) // this is the first cohort killed/damaged { HarvestEffects.ReduceLayers(SiteVars.HarvestPrescriptionName[site], site); } woodInput -= woodInput * (float)HarvestEffects.GetCohortWoodRemoval(site); foliarInput -= foliarInput * (float)HarvestEffects.GetCohortLeafRemoval(site); } //PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY: species={0}, age={1}, woodInput={2}, foliarInputs={3}.", cohort.Species.Name, cohort.Age, woodInput, foliarInput); if (disturbanceType.IsMemberOf("disturbance:fire")) { SiteVars.FireSeverity = PlugIn.ModelCore.GetSiteVar <byte>("Fire.Severity"); if (!Disturbed[site]) // this is the first cohort killed/damaged { if (SiteVars.FireSeverity != null && SiteVars.FireSeverity[site] > 0) { FireEffects.ReduceLayers(SiteVars.FireSeverity[site], site); } } double woodFireConsumption = woodInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].CoarseLitterReduction; double foliarFireConsumption = foliarInput * (float)FireEffects.ReductionsTable[(int)SiteVars.FireSeverity[site]].FineLitterReduction; woodInput -= (float)woodFireConsumption; foliarInput -= (float)foliarFireConsumption; } if (PlugIn.CalibrateMode && PlugIn.ModelCore.CurrentTime > 0) { PlugIn.ModelCore.UI.WriteLine(" BIOMASS SUCCESSION PARTIAL MORTALITY III: ForestFloorInputs: Foliar={0:0.00}, Wood={1:0.0}.", foliarInput, woodInput); } ForestFloor.AddWoody(woodInput, cohort.Species, site); ForestFloor.AddLitter(foliarInput, cohort.Species, site); if (disturbanceType != null) { Disturbed[site] = true; } return; }