示例#1
0
    public override void DoWaterUptake(double Amount)
    {
        Uptake = Amount;
        if (TalkDirectlyToRoot)
        {
            MyPaddock.Set(OurName + "Root.SWUptake", Amount);
        }

        else
        {
            List <string> ModelNames = new List <string>();
            List <double> Supply     = new List <double>();
            foreach (Paddock SubPaddock in MyPaddock.ChildPaddocks)
            {
                double[] SWSupply;
                string   ModelName = SubPaddock.FullName + "." + Plant.Name + "Root";
                MyPaddock.Get(ModelName + ".SWSupply", out SWSupply);
                Supply.Add(MathUtility.Sum(SWSupply));
                ModelNames.Add(ModelName);
            }
            double fraction = Amount / MathUtility.Sum(Supply);
            if (fraction > 1)
            {
                throw new Exception("Requested SW uptake > Available supplies.");
            }
            int i = 0;
            foreach (string ModelName in ModelNames)
            {
                MyPaddock.Set(ModelName + ".SWUptake", Supply[i] * fraction);
                i++;
            }
        }
    }
示例#2
0
    public void OnInitialised()
    {
        CP = Classic.SetUpCanopy(
            CanopyType.C4, // Canopy type
            363,           // CO2 partial pressure
            0.7,           // Curvature factor
            0.047,         // Diffusivity-solubility ratio
            210000,        // O2 partial pressure
            0.78,          // Diffuse extinction coefficient
            0.8,           // Diffuse extinction coefficient NIR
            0.036,         // Diffuse reflection coefficient
            0.389,         // Diffuse reflection coefficient NIR
            60,            // Leaf angle
            0.15,          // Leaf scattering coefficient
            0.8,           // Leaf scattering coefficient NIR
            0.15,          // Leaf width
            1.3,           // SLN ratio at canopy top
            14,            // Minimum Nitrogen
            1.5,           // Wind speed
            1.5);          // Wind speed extinction


        PP = Classic.SetUpPathway(
            0,                  // jTMin
            37.8649150880407,   // jTOpt
            55,                 // jTMax
            0.711229539802063,  // jC
            1,                  // jBeta
            0,                  // gTMin
            42,                 // gTOpt
            55,                 // gTMax
            0.462820450976839,  // gC
            1,                  // gBeta
            1210,               // KcAt25
            64200,              // KcFactor
            292000,             // KoAt25
            10500,              // KoFactor
            5.51328906454566,   // VcVoAt25
            21265.4029552906,   // VcVoFactor
            75,                 // KpAt25
            36300,              // KpFactor
            78000,              // VcFactor
            46390,              // RdFactor
            57043.2677590512,   // VpFactor
            120,                // pepRegeneration
            0.15,               // spectralCorrectionFactor
            0.1,                // ps2ActivityFraction
            0.003,              // bundleSheathConductance
            0.465 * PsiFactor,  // maxRubiscoActivitySLNRatio
            2.7 * PsiFactor,    // maxElectronTransportSLNRatio
            0.0 * PsiFactor,    // respirationSLNRatio
            1.55 * PsiFactor,   // maxPEPcActivitySLNRatio
            0.0135 * PsiFactor, // mesophyllCO2ConductanceSLNRatio
            2,                  // extraATPCost
            0.45);              // intercellularToAirCO2Ratio

        //Set the LAI trigger
        MyPaddock.Set("laiTrigger", LAITrigger);
    }
    private void DoWaterBalance()
    {
        double OPCover = 0;

        if (!MyPaddock.Get("OilPalm.cover_green", out OPCover))
        {
            OPCover = 0.0;
        }

        cover_green = 0.40 * (1 - OPCover);
        PEP         = eo * cover_green * (1 - OPCover);


        for (int j = 0; j < ll15_dep.Length; j++)
        {
            PotSWUptake[j] = Math.Max(0.0, RootProportion(j, RootDepth) * kl * (sw_dep[j] - ll15_dep[j]));
        }

        double TotPotSWUptake = MathUtility.Sum(PotSWUptake);

        EP = 0.0;
        for (int j = 0; j < ll15_dep.Length; j++)
        {
            SWUptake[j] = PotSWUptake[j] * Math.Min(1.0, PEP / TotPotSWUptake);
            EP         += SWUptake[j];
            sw_dep[j]   = sw_dep[j] - SWUptake[j];
        }
        if (!MyPaddock.Set("Soil Water.sw_dep", sw_dep))
        {
            throw new Exception("Unable to set sw_dep");
        }
        if (PEP > 0.0)
        {
            FW = EP / PEP;
        }
        else
        {
            FW = 1.0;
        }
    }
示例#4
0
    private void DoWaterBalance()
    {
        PEP = eo * cover_green;


        for (int j = 0; j < ll15_dep.Length; j++)
        {
            PotSWUptake[j] = Math.Max(0.0, RootProportion(j, RootDepth) * kl[j] * (sw_dep[j] - ll15_dep[j]));
        }

        double TotPotSWUptake = MathUtility.Sum(PotSWUptake);

        EP = 0.0;
        for (int j = 0; j < ll15_dep.Length; j++)
        {
            SWUptake[j] = PotSWUptake[j] * Math.Min(1.0, PEP / TotPotSWUptake);
            EP         += SWUptake[j];
            sw_dep[j]   = sw_dep[j] - SWUptake[j];
        }
        if (!MyPaddock.Set("Soil Water.sw_dep", sw_dep))
        {
            throw new Exception("Unable to set sw_dep");
        }

        if (PEP > 0.0)
        {
            FW = EP / PEP;
            //FWexpan = Math.Max(0.0, Math.Min(1.0, (TotPotSWUptake / PEP - 0.5) / 0.6));
            FWexpan = Math.Max(0.0, Math.Min(1.0, (TotPotSWUptake / PEP - 0.5) / 1.0));
        }
        else
        {
            FW      = 1.0;
            FWexpan = 1.0;
        }
    }
示例#5
0
    public void OnInitialised()
    {
        /* IMPORTANT - Do NOT change the order of these values */

        CP = Classic.SetUpCanopy(
            CanopyType.C3, // Canopy type
            370,           // CO2 partial pressure
            0.7,           // Empirical curvature factor
            0.047,         // Diffusivity-solubility ratio
            210000,        // O2 partial pressure
            0.78,          // PAR diffuse extinction coefficient
            0.8,           // NIR diffuse extinction coefficient
            0.036,         // PAR diffuse reflection coefficient
            0.389,         // NIR diffuse reflection coefficient
            60,            // Leaf angle
            0.15,          // PAR leaf scattering coefficient
            0.8,           // NIR leaf scattering coefficient
            0.05,          // Leaf width
            1.3,           // SLN ratio at canopy top
            14,            // Minimum structural nitrogen
            1.5,           // Wind speed
            1.5);          // Wind speed profile distribution coefficient

        PP = Classic.SetUpPathway(
            0,                   // Electron transport minimum temperature
            30.0,                // Electron transport optimum temperature
            45.0,                // Electron transport maximum temperature
            0.911017958600129,   // Electron transport scaling constant
            1,                   // Electron transport Beta value

            6048.95289,          //mesophyll conductance factor

            273.422964228666,    // Kc25 - Michaelis Menten constant of Rubisco carboxylation at 25 degrees C
            93720,               // KcFactor

            165824.064155384,    // Ko25 - Michaelis Menten constant of Rubisco oxygenation at 25 degrees C
            33600,               // KoFactor

            4.59217066521612,    // VcVo25 - Rubisco carboxylation to oxygenation at 25 degrees C
            35713.19871277176,   // VcVoFactor

            0.0,                 // Kp25 - Michaelis Menten constant of PEPc activity at 25 degrees C (Unused in C3)
            0.0,                 // KpFactor (Unused in C3)

            65330,               // VcFactor
            46390,               // RdFactor
            57043.2677590512,    // VpFactor

            0.0,                 // PEPc regeneration (Unused in C3)
            0.15,                // Spectral correction factor
            0.1,                 // Photosystem II activity fraction
            0.003,               // Bundle sheath CO2 conductance
            1.1 * PsiFactor,     // Max Rubisco activity to SLN ratio
            1.85 * PsiFactor,    // Max electron transport to SLN ratio
            0.0 * PsiFactor,     // Respiration to SLN ratio
            1.0 * PsiFactor,     // Max PEPc activity to SLN ratio
            0.00412 * PsiFactor, // Mesophyll CO2 conductance to SLN ratio
            0.75,                // Extra ATP cost
            0.7);                // Intercellular CO2 to air CO2 ratio

        //Set the LAI trigger
        MyPaddock.Set("DCaPSTTriggerLAI", LAITrigger);
        MyPaddock.Get("PsModelName1", out PsModelName1);
    }
示例#6
0
    // The following event handler will be called once at the beginning of the simulation
    [EventHandler] public void OnInitialised()
    {
        string path = "IntervalValues.csv";

        stream = new FileStream(path, FileMode.Create);
        writer = new StreamWriter(stream);

        /* Do NOT change the order of these values */
        CP = Classic.SetUpCanopy(
            CanopyType.CCM, // Canopy type
            370,            // CO2 partial pressure
            0.7,            // Empirical curvature factor
            0.047,          // Diffusivity-solubility ratio (Used in CCM)
            210000,         // O2 partial pressure
            0.78,           // PAR diffuse extinction coefficient
            0.8,            // NIR diffuse extinction coefficient
            0.036,          // PAR diffuse reflection coefficient
            0.389,          // NIR diffuse reflection coefficient
            60,             // Leaf angle
            0.15,           // PAR leaf scattering coefficient
            0.8,            // NIR leaf scattering coefficient
            0.05,           // Leaf width
            1.3,            // SLN ratio at canopy top
            14,             // Minimum structural nitrogen
            1.5,            // Wind speed
            1.5);           // Wind speed profile distribution coefficient

        PP = Classic.SetUpPathway(
            0,                        // Electron transport minimum temperature
            30.0,                     // Electron transport optimum temperature
            45.0,                     // Electron transport maximum temperature
            0.911017958600129,        // Electron transport scaling constant
            1,                        // Electron transport Beta value

            0,                        // Mesophyll conductance minimum temperature
            29.2338417788683,         // Mesophyll conductance optimum temperature
            45,                       // Mesophyll conductance maximum temperature
            0.875790608584141,        // Mesophyll conductance scaling constant
            1,                        // Mesophyll conductance Beta value

            17.52 * 273.422964228666, // Kc25 - Michaelis Menten constant of Rubisco carboxylation at 25 degrees C (Changed in CCM)*********************
            93720,                    // KcFactor

            1.34 * 165824.064155384,  // Ko25 - Michaelis Menten constant of Rubisco oxygenation at 25 degrees C (Changed in CCM)*********************
            33600,                    // KoFactor

            13.07 * 4.59217066521612, // VcVo25 - Rubisco carboxylation to oxygenation at 25 degrees C (Changed in CCM)*********************
            35713.19871277176,        // VcVoFactor

            75,                       // Kp25 - Michaelis Menten constant of PEPc activity at 25 degrees C (Used in CCM)
            36300,                    // KpFactor (Used in CCM)

            65330,                    // VcFactor
            46390,                    // RdFactor
            57043.2677590512,         // VpFactor (Used in CCM)

            400.0,                    // PEPc regeneration (Used in CCM)
            0.15,                     // Spectral correction factor
            0.1,                      // Photosystem II activity fraction (used in CCM)
            0.003,                    // Bundle sheath CO2 conductance (Used in CCM)********************
            1.1 * PsiFactor,          // Max Rubisco activity to SLN ratio
            1.9484 * PsiFactor,       // Max electron transport to SLN ratio (Changed in CCM)********************
            0.0 * PsiFactor,          // Respiration to SLN ratio
            1 * PsiFactor,            // Max PEPc activity to SLN ratio (Changed in CCM)*********************0.373684157583268
            0.00412 * PsiFactor,      // Mesophyll CO2 conductance to SLN ratio
            0.75,                     // Extra ATP cost (Changed in CCM)*********************
            0.7);                     // Intercellular CO2 to air CO2 ratio

        //Set the LAI trigger
        MyPaddock.Set("DCaPSTTriggerLAI", LAITrigger);
        MyPaddock.Get("PsModelName1", out PsModelName1);
    }