Esempio n. 1
0
 public void OnNewMet(NewMetType NewMet)
 {
     if (Phenology.Between(StartStage, EndStage))
     {
         DoVernalisation(NewMet.maxt, NewMet.mint);
     }
 }
Esempio n. 2
0
 public void OnNewMet(NewMetType NewMet)
 {
     if ((StageCode.Value >= StartStage) && (AccumulatedThermalTime < GrowthDuration))
     {
         ThermalTimeToday        = Math.Min(ThermalTime.Value, GrowthDuration - AccumulatedThermalTime);
         AccumulatedThermalTime += ThermalTimeToday;
     }
 }
Esempio n. 3
0
 public void OnPreNewMet(NewMetType newMetData)
 {
     if (patchVariables != null)
     {
         foreach (PatchVariable variable in patchVariables)
         {
             variable.ApplyPatch(DateUtility.JulianDayNumberToDateTime((int)Math.Truncate(newMetData.today)));
         }
     }
 }
Esempio n. 4
0
    public void OnPrepare()
    {
        NewMetType metData = new NewMetType();

        metData.mint  = mint;
        metData.maxt  = maxt;
        metData.radn  = radn;
        metData.rain  = rain;
        metData.vp    = vp;
        metData.today = Today.Date.ToOADate(); //Not sure if this is what the NewMetType uses, but it's the only one that returns a double.
        newMet.Invoke(metData);
    }
 public void OnNewMet(NewMetType NewMet)
 {
     if (Phenology.Between(StartStageName, EndStageName))
     {
         double DailyIncrement = 0.0;
         foreach (Function F in My.ChildrenAsObjects)
         {
             DailyIncrement = DailyIncrement + F.Value;
         }
         AccumulatedValue += DailyIncrement;
     }
 }
Esempio n. 6
0
 public void OnNewMet(NewMetType NewMet)
 {
     //This is a fudge until we get around to making canopy temperature drive phenology dirrectly.
     if ((DroughtInducedSenAcceleration != null) && (DroughtInducedSenAcceleration.Value > 1.0))
     {
         _ThermalTime = ThermalTime.Value * DroughtInducedSenAcceleration.Value;
     }
     else
     {
         _ThermalTime = ThermalTime.Value;
     }
 }
 public void OnNewMet(NewMetType NewMet)
 {
     Maxt = NewMet.maxt;
     Mint = NewMet.mint;
     Vernalisation(NewMet.maxt, NewMet.mint);
 }
    public void OnNewMet(NewMetType NewMet)
    {
        double PotentialBiomass = Leaf.Photosynthesis.PotentialGrowth(Leaf.RadIntTot);

        TranspirationDemand = PotentialBiomass * (TranspirationEfficiencyCoefficient / DayTimeAverageVPD);
    }
Esempio n. 9
0
    public void OnPreNewMet(NewMetType NewMetData)
    {
        // Get the basic met values, evaluate their changes and re-set them on MetFile
        if (hasInitialised)
        {
            // Get and adjust windspeed
            if (MyMetFile.Get("wind", out WindSpeedMeasured))
            {
                myWindSpeed = WindSpeedMeasured;
                if (Math.Abs(dWind) > epsilon)
                {
                    myWindSpeed *= 1.0 + dWind;
                }
            }
            else
            {
                WindSpeedMeasured = -1.0;
                myWindSpeed       = defaultWindSpeed;
            }


            // Evaluate changes in VP and RH
            VPMeasured = MyMetFile.vp;
            HumidityChanges();

            // Evaluate the changes in radiation due to slope and aspect
            RadnMeasured = MyMetFile.Radn;
            RadiationOnSlope();

            // Evaluate the changes in temperature
            TmaxMeasured = MyMetFile.MaxT;
            TminMeasured = MyMetFile.MinT;
            DeltaTemperature();

            // Check whether RH needs further adjusting
            if (canChangeRH)
            {
                CheckRH();
            }

            // Set the adjusted weather variables
            RainMeasured = MyMetFile.Rain;
            if (Math.Abs(dRain) > epsilon)
            {
                MyMetFile.Rain *= (float)(1.0 + dRain);
            }

            if (Math.Abs(dltTmax) > epsilon)
            {
                MyMetFile.MaxT += (float)dltTmax;
            }
            if (Math.Abs(dltTmin) > epsilon)
            {
                if (MyMetFile.MinT + dltTmin > MyMetFile.MaxT)
                {
                    MyMetFile.MinT = MyMetFile.MaxT;
                }
                else
                {
                    MyMetFile.MinT += (float)dltTmin;
                }
            }

            if (Math.Abs(MyMetFile.Radn - myRadn) > epsilon)
            {
                MyMetFile.Radn = (float)myRadn;
            }

            if ((WindSpeedMeasured > 0.0) && (Math.Abs(dWind) > epsilon))
            {
                MyMetFile.Set("wind", (float)myWindSpeed);
            }

            if (Math.Abs(dVapPressure) > epsilon)
            {
                MyMetFile.vp = (float)myVP;
            }

            if (canChangeRH && hasChangedRH)
            {
                if (RHmeanMeasured > 0.0)
                {
                    MyMetFile.Set("rhmean", (float)myRHmean);
                }

                if (RHMeasured > 0.0)
                {
                    MyMetFile.Set("rh", (float)myRH);
                }

                if (canChangeRHminmax)
                {
                    MyMetFile.Set("rhmin", (float)myRHmin);
                    MyMetFile.Set("rhmax", (float)myRHmax);
                }
            }
        }
    }