コード例 #1
0
 public SnowWrapper()
 {
     s             = new SnowState();
     r             = new SnowRate();
     a             = new SnowAuxiliary();
     snowComponent = new SnowComponent();
     loadParameters();
 }
コード例 #2
0
 public SnowWrapper(Universe universe) : base(universe)
 {
     s             = new SnowState();
     r             = new SnowRate();
     a             = new SnowAuxiliary();
     snowComponent = new Snow();
     loadParameters();
 }
コード例 #3
0
 public SnowWrapper(SnowWrapper toCopy, bool copyAll) : this()
 {
     s = (toCopy.s != null) ? new SnowState(toCopy.s, copyAll) : null;
     r = (toCopy.r != null) ? new SnowRate(toCopy.r, copyAll) : null;
     a = (toCopy.a != null) ? new SnowAuxiliary(toCopy.a, copyAll) : null;
     if (copyAll)
     {
         snowComponent = (toCopy.snowComponent != null) ? new SnowComponent(toCopy.snowComponent) : null;
     }
 }
コード例 #4
0
 public SnowWrapper(Universe universe, SnowWrapper toCopy, bool copyAll) : base(universe)
 {
     s = (toCopy.s != null) ? new SnowState(toCopy.s, copyAll) : null;
     r = (toCopy.r != null) ? new SnowRate(toCopy.r, copyAll) : null;
     a = (toCopy.a != null) ? new SnowAuxiliary(toCopy.a, copyAll) : null;
     if (copyAll)
     {
         snowComponent = (toCopy.snowComponent != null) ? new Snow(toCopy.snowComponent) : null;
     }
 }
コード例 #5
0
 public SnowAuxiliary(SnowAuxiliary toCopy, bool copyAll) // copy constructor
 {
     if (copyAll)
     {
         _jul    = toCopy._jul;
         _tmin   = toCopy._tmin;
         _tmax   = toCopy._tmax;
         _precip = toCopy._precip;
         _tavg   = toCopy._tavg;
     }
 }
コード例 #6
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowMelt -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: Snow Melt
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: ps
        //                          ** description : density of snow cover
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : kg/m**3
        //                          ** uri :
        //            * name: M
        //                          ** description : snow in the process of melting
        //                          ** inputtype : variable
        //                          ** variablecategory : rate
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //- outputs:
        //            * name: Snowmelt
        //                          ** description : Snow melt
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : m
        //                          ** uri :
        double ps = s.ps;
        double M  = r.M;
        double Snowmelt;

        Snowmelt = 0.0d;
        if (ps > 1e-8d)
        {
            Snowmelt = M / ps;
        }
        s.Snowmelt = Snowmelt;
    }
コード例 #7
0
 public void  Calculate_snow(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
 {
     _Tavg.Calculate_tavg(s, s1, r, a);
     _Refreezing.Calculate_refreezing(s, s1, r, a);
     _Melting.Calculate_melting(s, s1, r, a);
     _Snowdensity.Calculate_snowdensity(s, s1, r, a);
     _Snowmelt.Calculate_snowmelt(s, s1, r, a);
     _Snowaccumulation.Calculate_snowaccumulation(s, s1, r, a);
     _Snowdry.Calculate_snowdry(s, s1, r, a);
     _Snowwet.Calculate_snowwet(s, s1, r, a);
     _Snowdepth.Calculate_snowdepth(s, s1, r, a);
     _Preciprec.Calculate_preciprec(s, s1, r, a);
     _Snowdepthtrans.Calculate_snowdepthtrans(s, s1, r, a);
     _Tempmax.Calculate_tempmax(s, s1, r, a);
     _Tempmin.Calculate_tempmin(s, s1, r, a);
 }
コード例 #8
0
 public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
 {
     _Tavg.CalculateModel(s, s1, r, a);
     _Refreezing.CalculateModel(s, s1, r, a);
     _Melting.CalculateModel(s, s1, r, a);
     _SnowDensity.CalculateModel(s, s1, r, a);
     _SnowMelt.CalculateModel(s, s1, r, a);
     _SnowAccumulation.CalculateModel(s, s1, r, a);
     _SnowDry.CalculateModel(s, s1, r, a);
     _SnowWet.CalculateModel(s, s1, r, a);
     _SnowDepth.CalculateModel(s, s1, r, a);
     _Preciprec.CalculateModel(s, s1, r, a);
     _SnowDepthTrans.CalculateModel(s, s1, r, a);
     _TempMax.CalculateModel(s, s1, r, a);
     _TempMin.CalculateModel(s, s1, r, a);
 }
コード例 #9
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: Tavg -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: Mean temperature  calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: tmin
        //                          ** description : current minimum air temperature
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : degC
        //                          ** uri :
        //            * name: tmax
        //                          ** description : current maximum air temperature
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : degC
        //                          ** uri :
        //- outputs:
        //            * name: tavg
        //                          ** description : mean temperature
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : degC
        //                          ** uri :
        double tmin = a.tmin;
        double tmax = a.tmax;
        double tavg;

        tavg   = (tmin + tmax) / 2;
        a.tavg = tavg;
    }
コード例 #10
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowDepthTrans -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: snow cover depth conversion
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: Sdepth
        //                          ** description : snow cover depth Calculation
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : m
        //                          ** uri :
        //            * name: Pns
        //                          ** description : density of the new snow
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 100.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : cm/m
        //                          ** uri :
        //- outputs:
        //            * name: Sdepth_cm
        //                          ** description : snow cover depth in cm
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : cm
        //                          ** uri :
        double Sdepth = s.Sdepth;
        double Sdepth_cm;

        Sdepth_cm   = Sdepth * Pns;
        s.Sdepth_cm = Sdepth_cm;
    }
コード例 #11
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: Preciprec -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: Precipitation ReCalculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: Sdry_t1
        //                          ** description : water in solid state in the snow cover in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Sdry
        //                          ** description : water in solid state in the snow cover
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Swet
        //                          ** description : water in liquid state in the snow cover
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Swet_t1
        //                          ** description : water in liquid state in the snow cover in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Sdepth_t1
        //                          ** description : snow cover depth Calculation in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : m
        //                          ** uri :
        //            * name: Sdepth
        //                          ** description : snow cover depth Calculation
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : m
        //                          ** uri :
        //            * name: Mrf
        //                          ** description : liquid water in the snow cover in the process of refreezing
        //                          ** inputtype : variable
        //                          ** variablecategory : rate
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: precip
        //                          ** description : recalculated precipitation
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Snowaccu
        //                          ** description : snowfall accumulation
        //                          ** inputtype : variable
        //                          ** variablecategory : rate
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: rho
        //                          ** description : The density of the new snow fixed by the user
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 100
        //                          ** min :
        //                          ** max :
        //                          ** unit : kg/m**3
        //                          ** uri :
        //- outputs:
        //            * name: preciprec
        //                          ** description : precipitation recalculation
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        double Sdry_t1   = s1.Sdry;
        double Sdry      = s.Sdry;
        double Swet      = s.Swet;
        double Swet_t1   = s1.Swet;
        double Sdepth_t1 = s1.Sdepth;
        double Sdepth    = s.Sdepth;
        double Mrf       = r.Mrf;
        double precip    = a.precip;
        double Snowaccu  = r.Snowaccu;
        double preciprec;

        preciprec = precip;
        if (Sdry + Swet < Sdry_t1 + Swet_t1)
        {
            preciprec = preciprec + ((Sdepth_t1 - Sdepth) * rho) - Mrf;
        }
        preciprec   = preciprec - Snowaccu;
        s.preciprec = preciprec;
    }
コード例 #12
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: TempMin -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: Minimum temperature  calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: Sdepth_cm
        //                          ** description : snow depth
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : cm
        //                          ** uri :
        //            * name: prof
        //                          ** description : snow cover threshold for snow insulation
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 1000
        //                          ** unit : cm
        //                          ** uri :
        //            * name: tmin
        //                          ** description : current minimum air temperature
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : degC
        //                          ** uri :
        //            * name: tminseuil
        //                          ** description : minimum temperature when snow cover is higher than prof
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : degC
        //                          ** uri :
        //            * name: tmaxseuil
        //                          ** description : maximum temperature when snow cover is higher than prof
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : degC
        //                          ** uri :
        //- outputs:
        //            * name: tminrec
        //                          ** description : recalculated minimum temperature
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : degC
        //                          ** uri :
        double Sdepth_cm = s.Sdepth_cm;
        double tmin      = a.tmin;
        double tminrec;

        tminrec = tmin;
        if (Sdepth_cm > prof)
        {
            if (tmin < tminseuil)
            {
                tminrec = tminseuil;
            }
            else
            {
                if (tmin > tmaxseuil)
                {
                    tminrec = tmaxseuil;
                }
            }
        }
        else
        {
            if (Sdepth_cm > 0.0d)
            {
                tminrec = tminseuil - ((1 - (Sdepth_cm / prof)) * (Math.Abs(tmin) + tminseuil));
            }
        }
        s.tminrec = tminrec;
    }
コード例 #13
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowDepth -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: snow cover depth Calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: Snowmelt
        //                          ** description : snow melt
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : m
        //                          ** uri :
        //            * name: Sdepth_t1
        //                          ** description : snow cover depth Calculation in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : m
        //                          ** uri :
        //            * name: Snowaccu
        //                          ** description : snowfall accumulation
        //                          ** inputtype : variable
        //                          ** variablecategory : rate
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: E
        //                          ** description : snow compaction parameter
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mm/mm/d
        //                          ** uri :
        //            * name: rho
        //                          ** description : The density of the new snow fixed by the user
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 100
        //                          ** min :
        //                          ** max :
        //                          ** unit : kg/m**3
        //                          ** uri :
        //- outputs:
        //            * name: Sdepth
        //                          ** description : snow cover depth Calculation
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : m
        //                          ** uri :
        double Snowmelt  = s.Snowmelt;
        double Sdepth_t1 = s1.Sdepth;
        double Snowaccu  = r.Snowaccu;
        double Sdepth;

        Sdepth = 0.0d;
        if (Snowmelt <= Sdepth_t1 + (Snowaccu / rho))
        {
            Sdepth = Snowaccu / rho + Sdepth_t1 - Snowmelt - (Sdepth_t1 * E);
        }
        s.Sdepth = Sdepth;
    }
コード例 #14
0
    public void  Calculate_melting(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: Melting -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: snow in the process of melting
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: jul
        //                          ** description : current day of year for the calculation
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : INT
        //                          ** default : 0
        //                          ** min : 0
        //                          ** max : 366
        //                          ** unit : d
        //                          ** uri :
        //            * name: P_Tmf
        //                          ** description : threshold temperature for snow melting
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.5
        //                          ** min : 0.0
        //                          ** max : 1.0
        //                          ** unit : °C
        //                          ** uri :
        //            * name: P_DKmax
        //                          ** description : difference between the maximum and the minimum melting rates
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : mm °C-1 d-1
        //                          ** uri :
        //            * name: P_Kmin
        //                          ** description : minimum melting rate on 21 December
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : mm °C-1 d-1
        //                          ** uri :
        //            * name: tavg
        //                          ** description : average temperature
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : °C
        //                          ** uri :
        //- outputs:
        //            * name: M
        //                          ** description : snow in the process of melting
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mm d-1
        //                          ** uri :
        int    jul  = a.jul;
        double tavg = a.tavg;
        double M;
        double K;

        M = 0.0d;
        K = P_DKmax / 2.0d * -Math.Sin((2.0d * Math.PI * (double)(jul) / 366.0d + (9.0d / 16.0d * Math.PI))) + P_Kmin + (P_DKmax / 2.0d);
        if (tavg > P_Tmf)
        {
            M = K * (tavg - P_Tmf);
        }
        s.M = M;
    }
コード例 #15
0
    public void  Calculate_snowdepth(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowDepth -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: snow cover depth Calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: Snowmelt
        //                          ** description : snow melt
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : mm
        //                          ** uri :
        //            * name: Sdepth_t1
        //                          ** description : snow cover depth Calculation in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : m
        //                          ** uri :
        //            * name: Snowaccu
        //                          ** description : snowfall accumulation
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mm
        //                          ** uri :
        //            * name: P_E
        //                          ** description : snow compaction parameter
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mm mm-1 d
        //                          ** uri :
        //            * name: M
        //                          ** description : snow in the process of melting
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mm
        //                          ** uri :
        //- outputs:
        //            * name: Sdepth
        //                          ** description : water in solid state in the snow cover
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : m
        //                          ** uri :
        double Snowmelt  = s.Snowmelt;
        double Sdepth_t1 = s1.Sdepth;
        double Snowaccu  = s.Snowaccu;
        double M         = s.M;
        double Sdepth;

        Sdepth = 0.0d;
        if (Snowmelt <= Sdepth_t1 + (Snowaccu / 100))
        {
            Sdepth = Snowaccu / 100 + Sdepth_t1 - Snowmelt - (Sdepth_t1 * P_E);
        }
        s.Sdepth = Sdepth;
    }
コード例 #16
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowDensity -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: Density of snow cover calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: ps_t1
        //                          ** description : density of snow cover in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : kg/m**3
        //                          ** uri :
        //            * name: Sdepth_t1
        //                          ** description : snow cover depth Calculation in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : m
        //                          ** uri :
        //            * name: Sdry_t1
        //                          ** description : water in solid state in the snow cover in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Swet_t1
        //                          ** description : water in liquid state in the snow cover
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : mmW
        //                          ** uri :
        //- outputs:
        //            * name: ps
        //                          ** description : density of snow cover
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : kg/m**3
        //                          ** uri :
        double ps_t1     = s1.ps;
        double Sdepth_t1 = s1.Sdepth;
        double Sdry_t1   = s1.Sdry;
        double Swet_t1   = s1.Swet;
        double ps;

        ps = 0.0d;
        if (Math.Abs(Sdepth_t1) > 0.0d)
        {
            if (Math.Abs(Sdry_t1 + Swet_t1) > 0.0d)
            {
                ps = (Sdry_t1 + Swet_t1) / Sdepth_t1;
            }
            else
            {
                ps = ps_t1;
            }
        }
        s.ps = ps;
    }
コード例 #17
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowDry -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: water in solid state in the snow cover Calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: Sdry_t1
        //                          ** description : water in solid state in the snow cover in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Snowaccu
        //                          ** description : snowfall accumulation
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: Mrf
        //                          ** description : liquid water in the snow cover in the process of refreezing
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: M
        //                          ** description : snow in the process of melting
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //- outputs:
        //            * name: Sdry
        //                          ** description : water in solid state in the snow cover
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        double Sdry_t1  = s1.Sdry;
        double Snowaccu = s.Snowaccu;
        double Mrf      = s.Mrf;
        double M        = s.M;
        double Sdry;
        double tmp_sdry;

        Sdry = 0.0d;
        if (M * 1 <= Sdry_t1)
        {
            tmp_sdry = Snowaccu + Mrf - M + Sdry_t1;
            if (tmp_sdry < 0.0d)
            {
                Sdry = 0.001d;
            }
            else
            {
                Sdry = tmp_sdry;
            }
        }
        s.Sdry = Sdry;
    }
コード例 #18
0
    public void  CalculateModel(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowWet -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: water in liquid state in the snow cover calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: Swet_t1
        //                          ** description : water in liquid state in the snow cover in previous day
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 100.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: precip
        //                          ** description : current precipitation
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : mmW
        //                          ** uri :
        //            * name: Snowaccu
        //                          ** description :  snowfall accumulation
        //                          ** inputtype : variable
        //                          ** variablecategory : rate
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: Mrf
        //                          ** description : liquid water in the snow cover in the process of refreezing
        //                          ** inputtype : variable
        //                          ** variablecategory : rate
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: M
        //                          ** description : snow in the process of melting
        //                          ** inputtype : variable
        //                          ** variablecategory : rate
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min :
        //                          ** max :
        //                          ** unit : mmW/d
        //                          ** uri :
        //            * name: Sdry
        //                          ** description : water in solid state in the snow cover
        //                          ** inputtype : variable
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        //- outputs:
        //            * name: Swet
        //                          ** description : water in liquid state in the snow cover
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mmW
        //                          ** uri :
        double Swet_t1  = s1.Swet;
        double precip   = a.precip;
        double Snowaccu = r.Snowaccu;
        double Mrf      = r.Mrf;
        double M        = r.M;
        double Sdry     = s.Sdry;
        double Swet;
        double frac_sdry;
        double tmp_swet;

        Swet = 0.0d;
        if (Mrf <= Swet_t1)
        {
            tmp_swet  = Swet_t1 + precip - Snowaccu + M - Mrf;
            frac_sdry = 0.1d * Sdry;
            if (tmp_swet < frac_sdry)
            {
                Swet = tmp_swet;
            }
            else
            {
                Swet = frac_sdry;
            }
        }
        s.Swet = Swet;
    }
コード例 #19
0
    public void  Calculate_snowaccumulation(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
    {
        //- Name: SnowAccumulation -Version: 1.0, -Time step: 1
        //- Description:
        //            * Title: snowfall accumulation  calculation
        //            * Author: STICS
        //            * Reference: -
        //            * Institution: INRA
        //            * Abstract: -
        //- inputs:
        //            * name: P_tsmax
        //                          ** description : maximum daily air temperature (tmax) below which all precipitation is assumed to be snow
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 1000
        //                          ** unit : °C
        //                          ** uri :
        //            * name: tmax
        //                          ** description : current maximum air temperature
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : °C
        //                          ** uri :
        //            * name: P_trmax
        //                          ** description : tmax above which all precipitation is assumed to be rain
        //                          ** inputtype : parameter
        //                          ** parametercategory : constant
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : °C
        //                          ** uri :
        //            * name: precip
        //                          ** description : recalculated precipitation
        //                          ** inputtype : variable
        //                          ** variablecategory : auxiliary
        //                          ** datatype : DOUBLE
        //                          ** default : 0.0
        //                          ** min : 0.0
        //                          ** max : 5000.0
        //                          ** unit : mm
        //                          ** uri :
        //- outputs:
        //            * name: Snowaccu
        //                          ** description : snowfall accumulation
        //                          ** variablecategory : state
        //                          ** datatype : DOUBLE
        //                          ** min : 0.0
        //                          ** max : 500.0
        //                          ** unit : mm
        //                          ** uri :
        double tmax   = a.tmax;
        double precip = a.precip;
        double Snowaccu;
        double fs = 0.0d;

        Snowaccu = 0.0d;
        if (tmax < P_tsmax)
        {
            fs = 1.0d;
        }
        if (tmax >= P_tsmax && tmax <= P_trmax)
        {
            fs = (P_trmax - tmax) / (P_trmax - P_tsmax);
        }
        Snowaccu   = fs * precip;
        s.Snowaccu = Snowaccu;
    }
コード例 #20
0
 public void Init(SnowState s, SnowState s1, SnowRate r, SnowAuxiliary a)
 {
     s.preciprec = a.precip;
     s.tminrec   = a.tmin;
     s.tmaxrec   = a.tmax;
 }