@@ -925,9 +925,9 @@ void SPLASH::quick_run(int n, int y, double wn, double sw_in, double tc,
925
925
926
926
}
927
927
928
- void SPLASH::run_one_day (int n, int y, double wn, double sw_in, double tc,
928
+ etr SPLASH::run_one_day (int n, int y, double wn, double sw_in, double tc,
929
929
double pn,smr &dsoil, double slop, double asp,double snow, double snowfall, vector <double > &soil_info,
930
- double qin, double td, double nd) {
930
+ double qin, double td, double nd, double plant_uptake ) {
931
931
/* ***********************************************************************
932
932
Name: SPLASH.run_one_day
933
933
Input: - int, day of year (n)
@@ -1277,7 +1277,7 @@ void SPLASH::run_one_day(int n, int y, double wn, double sw_in, double tc,
1277
1277
// 5.1.5. calculate Hortonian (infiltration excess) runoff
1278
1278
double ro_h = max (inflow-infi,0.0 );
1279
1279
// 5.1.6. calculate recharge
1280
- double R = infi - dvap.aet ;
1280
+ double R = infi - dvap.aet - plant_uptake ;
1281
1281
// 5.1.7. define the hydraulic gradient assuming steady state: z: I=Ks(dh/dz +1), x: tan(slop), if theta<fc no vertical flow outside the column
1282
1282
1283
1283
double Kunsat = Ksat_visc * pow ((theta_m/theta_s),(3.0 +(2.0 /lambda)));
@@ -1589,10 +1589,21 @@ void SPLASH::run_one_day(int n, int y, double wn, double sw_in, double tc,
1589
1589
dsoil.sqout = qin_nday;
1590
1590
dsoil.bflow = T;
1591
1591
dsoil.nd = nd;
1592
-
1593
-
1594
1592
1595
-
1593
+ dsoil.stress_factor = (sm-RES)/(Wmax-RES);
1594
+ cout << " sw_end(calc at start) / stress_end (calc at end) = " << sw << " / " << dsoil.stress_factor << ' \n ' ;
1595
+
1596
+ theta_i = (sm)/(depth*1000.0 );
1597
+ // correct theta_i for NA error reaching boundary conditions
1598
+ if (theta_i>=theta_s){
1599
+ theta_i = theta_s - 0.001 ;
1600
+ } else if (theta_i<=theta_r){
1601
+ theta_i = theta_r + 0.001 ;
1602
+ }
1603
+ dsoil.psi_m = bub_press/pow ((((theta_i-theta_r)/(theta_s-theta_r))),(1 /lambda));
1604
+ dsoil.psi_m *= 0.00000980665 ; // convert from mmH2o --> MPa
1605
+
1606
+ return dvap;
1596
1607
}
1597
1608
1598
1609
vector<vector<double >> SPLASH::spin_up_cpp (int n, int y, vector<double > &sw_in, vector <double > &tair, vector <double > &pn,
0 commit comments