public static void siteSuccession(Landis.Library.DensityCohorts.SiteCohorts siteCohorts) { int RDflag; float siteRD = SiteVars.SiteRD[siteCohorts.Site]; double GSO1 = EcoregionData.GSO1[siteCohorts.Ecoregion]; double GSO2 = EcoregionData.GSO2[siteCohorts.Ecoregion]; double GSO3 = EcoregionData.GSO3[siteCohorts.Ecoregion]; double GSO4 = EcoregionData.GSO4[siteCohorts.Ecoregion]; if (siteRD < GSO1) { RDflag = 0; } else if (siteRD >= GSO1 && siteRD < GSO2) { RDflag = 1; } else if (siteRD >= GSO2 && siteRD <= GSO3) { RDflag = 2; } else if (siteRD > GSO3 && siteRD <= GSO4) { RDflag = 3; } else { Debug.Assert(siteRD > GSO4); RDflag = 4; } if (0 == RDflag || 1 == RDflag || 2 == RDflag) { //GetSeedNumberOnSite(Row, Col); //SeedGermination(siteptr, l, RDflag); NaturalMortality(siteCohorts, 1);//kill the youngest of trees } else if (3 == RDflag) { NaturalMortality(siteCohorts, 0);//kill all ages of trees } else { NaturalMortality(siteCohorts, 0);//kill all ages of trees if (SiteVars.SiteRD[siteCohorts.Site] > GSO4) { SelfthinningTest(siteCohorts); SiteVars.TotalSiteRD(siteCohorts); } } }
public bool Grow(ActiveSite site, bool isSuccessionTimestep) { SiteVars.TotalSiteRD(this); SiteDynamics.siteSuccession(this); if (isSuccessionTimestep && Landis.Library.DensityCohorts.Cohorts.SuccessionTimeStep > 1) { foreach (SpeciesCohorts speciesCohorts in this) { speciesCohorts.CombineYoungCohorts(); } } foreach (Cohort cohort in this.AllCohorts) { cohort.IncrementAge(); if (cohort.Age >= cohort.Species.Longevity || cohort.Treenumber == 0) { RemoveCohort(cohort, null); } } //for (int i = 0; i < this.AllCohorts.Count; i++) //{ // this.AllCohorts[i].IncrementAge(); // if (this.AllCohorts[i].Age >= this.AllCohorts[i].Species.Longevity || this.AllCohorts[i].Treenumber == 0) // { // RemoveCohort(this.AllCohorts[i], null); // } //} bool success = true; return(success); }