/// <summary> /// Called on the day of emergence to get the initials leaf cohorts to appear /// </summary> public void DoEmergence() { CohortToInitialise = Leaf.CohortsAtInitialisation; for (int i = 1; i <= Leaf.TipsAtEmergence; i++) { InitParams = new CohortInitParams(); PotLeafTipsAppeared += 1; CohortToInitialise += 1; InitParams.Rank = CohortToInitialise; if (AddLeafCohort != null) { AddLeafCohort.Invoke(this, InitParams); } DoLeafTipAppearance(); } }
private void OnDoPotentialPlantGrowth(object sender, EventArgs e) { if (Plant.IsGerminated) { DeltaHaunStage = 0; if (MainStemNodeAppearanceRate.Value > 0) DeltaHaunStage = ThermalTime.Value / MainStemNodeAppearanceRate.Value; if (Germinated==false) // We have no leaves set up and nodes have just started appearing - Need to initialise Leaf cohorts { Germinated = true; //On the day of germination set up the first cohorts if(InitialiseLeafCohorts !=null) InitialiseLeafCohorts.Invoke(this, args); Initialised = true; } if (Plant.IsEmerged) { if(Emerged==false) { NextLeafProportion = 1.0; DoEmergence(); } bool AllCohortsInitialised = (Leaf.InitialisedCohortNo >= MainStemFinalNodeNumber.Value); bool AllLeavesAppeared = (Leaf.AppearedCohortNo == Leaf.InitialisedCohortNo); bool LastLeafAppearing = ((Math.Truncate(LeafTipsAppeared) + 1) == Leaf.InitialisedCohortNo); if ((AllCohortsInitialised)&&(LastLeafAppearing)) { NextLeafProportion = 1-(Leaf.InitialisedCohortNo - MainStemFinalNodeNumber.Value); } else { NextLeafProportion = 1.0; } //Increment MainStemNode Number based on phyllochorn and theremal time if (Emerged == false) { Emerged = true; DeltaTipNumber = 0; //Don't increment node number on day of emergence } else { DeltaTipNumber = DeltaHaunStage; //DeltaTipNumber is only positive after emergence whereas deltaHaunstage is positive from germination } PotLeafTipsAppeared += DeltaTipNumber; //if (PotLeafTipsAppeared > MainStemFinalNodeNumber.Value) // FinalLeafDeltaTipNumberonDayOfAppearance = PotLeafTipsAppeared - MainStemFinalNodeNumber.Value; LeafTipsAppeared = Math.Min(PotLeafTipsAppeared, MainStemFinalNodeNumber.Value); bool TimeForAnotherLeaf = PotLeafTipsAppeared >= (Leaf.AppearedCohortNo + 1); int LeavesToAppear = (int)(LeafTipsAppeared - (Leaf.AppearedCohortNo - (1- NextLeafProportion))); //Each time main-stem node number increases by one or more initiate the additional cohorts until final leaf number is reached if (TimeForAnotherLeaf && (AllCohortsInitialised == false)) { int i = 1; for (i = 1; i <= LeavesToAppear; i++) { CohortToInitialise += 1; InitParams = new CohortInitParams() { }; InitParams.Rank = CohortToInitialise; if (AddLeafCohort != null) AddLeafCohort.Invoke(this, InitParams); } } //Each time main-stem node number increases by one appear another cohort until all cohorts have appeared if (TimeForAnotherLeaf && (AllLeavesAppeared == false)) { int i = 1; for (i = 1; i <= LeavesToAppear; i++) { TotalStemPopn += BranchingRate.Value * MainStemPopn; BranchNumber += BranchingRate.Value; DoLeafTipAppearance(); } } //Reduce population if there has been plant mortality if(DeltaPlantPopulation>0) TotalStemPopn -= DeltaPlantPopulation * TotalStemPopn / Plant.Population; //Reduce stem number incase of mortality double PropnMortality = 0; PropnMortality = BranchMortality.Value; { double DeltaPopn = Math.Min(PropnMortality * (TotalStemPopn - MainStemPopn), TotalStemPopn - Plant.Population); TotalStemPopn -= DeltaPopn; ProportionBranchMortality = PropnMortality; } } } }
/// <summary> /// Called on the day of emergence to get the initials leaf cohorts to appear /// </summary> public void DoEmergence() { CohortToInitialise = Leaf.CohortsAtInitialisation; int i = 1; for (i = 1; i <= (Leaf.TipsAtEmergence); i++) { InitParams = new CohortInitParams() { }; PotLeafTipsAppeared += 1; CohortToInitialise += 1; InitParams.Rank = CohortToInitialise; if(AddLeafCohort != null) AddLeafCohort.Invoke(this, InitParams); DoLeafTipAppearance(); } }
private void OnDoPotentialPlantGrowth(object sender, EventArgs e) { if (Plant.IsGerminated) { DeltaHaunStage = 0; if (MainStemNodeAppearanceRate.Value() > 0) { DeltaHaunStage = ThermalTime.Value() / MainStemNodeAppearanceRate.Value(); } if (Germinated == false) // We have no leaves set up and nodes have just started appearing - Need to initialise Leaf cohorts { Germinated = true; //On the day of germination set up the first cohorts if (InitialiseLeafCohorts != null) { InitialiseLeafCohorts.Invoke(this, args); } Initialised = true; } if (Plant.IsEmerged) { if (Emerged == false) { NextLeafProportion = 1.0; DoEmergence(); } bool AllCohortsInitialised = (Leaf.InitialisedCohortNo >= MainStemFinalNodeNumber.Value()); bool AllLeavesAppeared = (Leaf.AppearedCohortNo == Leaf.InitialisedCohortNo); bool LastLeafAppearing = ((Math.Truncate(LeafTipsAppeared) + 1) == Leaf.InitialisedCohortNo); if ((AllCohortsInitialised) && (LastLeafAppearing)) { NextLeafProportion = 1 - (Leaf.InitialisedCohortNo - MainStemFinalNodeNumber.Value()); } else { NextLeafProportion = 1.0; } //Increment MainStemNode Number based on phyllochorn and theremal time if (Emerged == false) { Emerged = true; DeltaTipNumber = 0; //Don't increment node number on day of emergence } else { DeltaTipNumber = DeltaHaunStage; //DeltaTipNumber is only positive after emergence whereas deltaHaunstage is positive from germination } PotLeafTipsAppeared += DeltaTipNumber; //if (PotLeafTipsAppeared > MainStemFinalNodeNumber.Value) // FinalLeafDeltaTipNumberonDayOfAppearance = PotLeafTipsAppeared - MainStemFinalNodeNumber.Value; LeafTipsAppeared = Math.Min(PotLeafTipsAppeared, MainStemFinalNodeNumber.Value()); bool TimeForAnotherLeaf = PotLeafTipsAppeared >= (Leaf.AppearedCohortNo + 1); int LeavesToAppear = (int)(LeafTipsAppeared - (Leaf.AppearedCohortNo - (1 - NextLeafProportion))); //Each time main-stem node number increases by one or more initiate the additional cohorts until final leaf number is reached if (TimeForAnotherLeaf && (AllCohortsInitialised == false)) { int i = 1; for (i = 1; i <= LeavesToAppear; i++) { CohortToInitialise += 1; InitParams = new CohortInitParams() { }; InitParams.Rank = CohortToInitialise; if (AddLeafCohort != null) { AddLeafCohort.Invoke(this, InitParams); } } } //Each time main-stem node number increases by one appear another cohort until all cohorts have appeared if (TimeForAnotherLeaf && (AllLeavesAppeared == false)) { int i = 1; for (i = 1; i <= LeavesToAppear; i++) { TotalStemPopn += BranchingRate.Value() * MainStemPopn; BranchNumber += BranchingRate.Value(); DoLeafTipAppearance(); } } //Reduce population if there has been plant mortality if (DeltaPlantPopulation > 0) { TotalStemPopn -= DeltaPlantPopulation * TotalStemPopn / Plant.Population; } //Reduce stem number incase of mortality double PropnMortality = 0; PropnMortality = BranchMortality.Value(); { double DeltaPopn = Math.Min(PropnMortality * (TotalStemPopn - MainStemPopn), TotalStemPopn - Plant.Population); TotalStemPopn -= DeltaPopn; ProportionBranchMortality = PropnMortality; } // Apex calculation ApexNum += (BranchingRate.Value() - BranchMortality.Value()) * PrimaryBudNo; } } }