Exemple #1
0
        InputParameters ReadSpeciesParameters(string FileName, InputParameters parameters)
        {
            // to get the option to read species parameters from an external file
            SpeciesParameterParser parser = new SpeciesParameterParser();

            IInputParameters speciesparameters = (IInputParameters)Landis.Data.Load <IInputParameters>(FileName, parser);

            foreach (ISpecies species in PlugIn.ModelCore.Species)
            {
                parameters.TOroot[species]    = speciesparameters.TOroot[species];
                parameters.TOwood[species]    = speciesparameters.TOwood[species];
                parameters.TOfol[species]     = speciesparameters.TOfol[species];
                parameters.FolRet[species]    = speciesparameters.FolRet[species];
                parameters.AmaxA[species]     = speciesparameters.AmaxA[species];
                parameters.AmaxB[species]     = speciesparameters.AmaxB[species];
                parameters.BFolResp[species]  = speciesparameters.BFolResp[species];
                parameters.GrMstSens[species] = speciesparameters.GrMstSens[species];
                parameters.WltPnt[species]    = speciesparameters.WltPnt[species];
                parameters.DVPD1[species]     = speciesparameters.DVPD1[species];
                parameters.DVPD2[species]     = speciesparameters.DVPD2[species];
                parameters.FolN[species]      = speciesparameters.FolN[species];
                parameters.HalfSat[species]   = speciesparameters.HalfSat[species];
                parameters.MaintResp[species] = speciesparameters.MaintResp[species];
                parameters.DNSC[species]      = speciesparameters.DNSC[species];
                parameters.RtStRatio[species] = speciesparameters.RtStRatio[species];
                parameters.K[species]         = speciesparameters.K[species];
                parameters.PsnAgeRed[species] = speciesparameters.PsnAgeRed[species];
                parameters.PsnTMin[species]   = speciesparameters.PsnTMin[species];
                parameters.PsnTOpt[species]   = speciesparameters.PsnTOpt[species];
                parameters.Q10[species]       = speciesparameters.Q10[species];
                parameters.CDDFolEnd[species] = speciesparameters.CDDFolEnd[species];
                parameters.SLWmax[species]    = speciesparameters.SLWmax[species];
                parameters.SLWDel[species]    = speciesparameters.SLWDel[species];
                parameters.WUEcnst[species]   = speciesparameters.WUEcnst[species];
                parameters.GDDFolSt[species]  = speciesparameters.GDDFolSt[species];
                parameters.EstMoist[species]  = speciesparameters.EstMoist[species];
                parameters.EstRad[species]    = speciesparameters.EstRad[species];
                parameters.KWdLit[species]    = speciesparameters.KWdLit[species];
                parameters.FolLignin[species] = speciesparameters.FolLignin[species];
            }

            return(parameters);
        }
        InputParameters ReadSpeciesParameters(string FileName, InputParameters parameters)
        {
            // to get the option to read species parameters from an external file
            SpeciesParameterParser parser = new SpeciesParameterParser();

            IInputParameters speciesparameters = (IInputParameters)PlugIn.ModelCore.Load <IInputParameters>(FileName, parser);

            foreach (ISpecies species in PlugIn.ModelCore.Species)
            {
                parameters.RootTurnover[species]              = speciesparameters.RootTurnover[species];
                parameters.WoodTurnover[species]              = speciesparameters.WoodTurnover[species];
                parameters.FoliageTurnover[species]           = speciesparameters.FoliageTurnover[species];
                parameters.FolReten[species]                  = speciesparameters.FolReten[species];
                parameters.AmaxA[species]                     = speciesparameters.AmaxA[species];
                parameters.AmaxB[species]                     = speciesparameters.AmaxB[species];
                parameters.BaseFolRespFrac[species]           = speciesparameters.BaseFolRespFrac[species];
                parameters.GrowthMoistureSensitivity[species] = speciesparameters.GrowthMoistureSensitivity[species];
                parameters.WiltingPoint[species]              = speciesparameters.WiltingPoint[species];
                parameters.DVPD1[species]                     = speciesparameters.DVPD1[species];
                parameters.DVPD2[species]                     = speciesparameters.DVPD2[species];
                parameters.FolNCon[species]                   = speciesparameters.FolNCon[species];
                parameters.HalfSat[species]                   = speciesparameters.HalfSat[species];
                parameters.EstRadSensitivity[species]         = speciesparameters.EstRadSensitivity[species];
                parameters.EstMoistureSensitivity[species]    = speciesparameters.EstMoistureSensitivity[species];
                parameters.MaintResp[species]                 = speciesparameters.MaintResp[species];
                parameters.DNSC[species]          = speciesparameters.DNSC[species];
                parameters.RootStemRatio[species] = speciesparameters.RootStemRatio[species];
                parameters.K[species]             = speciesparameters.K[species];
                parameters.PsnAgeRed[species]     = speciesparameters.PsnAgeRed[species];
                parameters.PsnTMin[species]       = speciesparameters.PsnTMin[species];
                parameters.PsnTOpt[species]       = speciesparameters.PsnTOpt[species];
                parameters.RespQ10[species]       = speciesparameters.RespQ10[species];
                parameters.SenescStart[species]   = speciesparameters.SenescStart[species];
                parameters.SLWmax[species]        = speciesparameters.SLWmax[species];
                parameters.SLWDel[species]        = speciesparameters.SLWDel[species];
                parameters.WUEConst[species]      = speciesparameters.WUEConst[species];
                parameters.GDDFolStart[species]   = speciesparameters.GDDFolStart[species];
                parameters.GDDFolEnd[species]     = speciesparameters.GDDFolEnd[species];
            }

            return(parameters);
        }