Skip to content

Commit 6fadc44

Browse files
committed
Minor changes to the source code, some reources were updated
1 parent a0f51c4 commit 6fadc44

File tree

11 files changed

+45
-36
lines changed

11 files changed

+45
-36
lines changed

resources/Input/LAI_1_daily.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ Format,yyyy-MM-dd HH:mm,
17751775
,1998-11-03 00:00,0.766666667
17761776
,1998-11-04 00:00,-9999
17771777
,1998-11-05 00:00,-9999
1778-
,1998-11-06 00:00,-9999
1778+
,1998-11-06 00:00,0.8
17791779
,1998-11-07 00:00,-9999
17801780
,1998-11-08 00:00,-9999
17811781
,1998-11-09 00:00,-9999
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
@T,table
2-
Created,2017-07-30 19:32
2+
Created,2017-10-06 08:26
33
Author,HortonMachine library
44
@H,timestamp,value_1
55
ID,,1
66
Type,Date,Double
77
Format,yyyy-MM-dd HH:mm,
8-
,1998-10-03 00:00,0.0
9-
,1998-10-04 00:00,1.75712008630895
10-
,1998-10-05 00:00,1.7466932491079
8+
,1998-11-03 00:00,1.05360518276067
9+
,1998-11-04 00:00,1.00830685552745
1110

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
@T,table
2-
Created,2017-07-30 19:32
2+
Created,2017-10-06 08:26
33
Author,HortonMachine library
44
@H,timestamp,value_1
55
ID,,1
66
Type,Date,Double
77
Format,yyyy-MM-dd HH:mm,
8-
,1998-10-03 00:00,0.1348868100304803
9-
,1998-10-04 00:00,15.163637831229755
10-
,1998-10-05 00:00,37.8971025087221
8+
,1998-11-03 00:00,9.727577976518907
9+
,1998-11-04 00:00,19.8988760784501
1110

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
@T,table
2-
Created,2017-07-30 19:32
2+
Created,2017-10-06 08:26
33
Author,HortonMachine library
44
@H,timestamp,value_1
55
ID,,1
66
Type,Date,Double
77
Format,yyyy-MM-dd HH:mm,
8-
,1998-10-03 00:00,0.3142980258721817
9-
,1998-10-04 00:00,3.492359566686218
10-
,1998-10-05 00:00,10.108995431213229
8+
,1998-11-03 00:00,2.140335893970077
9+
,1998-11-04 00:00,5.304078072652091
1110

src/main/java/canopyOUT/WaterBudgetCanopyOUT.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public class WaterBudgetCanopyOUT{
6363
@Description("Leaf Area Index Hashmap")
6464
@In
6565
public HashMap<Integer, double[]> inHMLAI;
66+
67+
//double LAI=1;
6668

6769

6870
@Description("coefficient canopy out")
@@ -146,12 +148,14 @@ public void process() throws Exception {
146148

147149

148150
double LAI= inHMLAI.get(ID)[0];
149-
if (isNovalue(LAI)) LAI= 3;
151+
if (isNovalue(LAI)) LAI=0.6;
152+
//} else LAI=LAI_t;
150153

151154

152155
if(step==0){
153156

154-
initialConditionS_i.put(ID,new double[]{kc_canopy_out*LAI/2});
157+
initialConditionS_i.put(ID,new double[]{kc_canopy_out*LAI/2});
158+
System.out.println("kc_in"+kc_canopy_out);
155159
}
156160

157161
ETp=0;
@@ -198,15 +202,17 @@ public double computeS(double rain, double S_i, double LAI) throws IOException {
198202
/** Boundaries conditions*/
199203
double[] y = new double[] { S_i, s_CanopyMax };
200204

201-
//System.out.println("kc_in"+kc_canopy_out);
205+
202206

203207
/** Choice of the ODE solver */
204208
SolverODE solver;
205209
solver=SimpleIntegratorFactory.createSolver(solver_model, 1, ode, y);
206210

207211
/** result of the resolution of the ODE*/
208212
S_i=(S_i<0.1&rain==0)?0:solver.integrateValues();
209-
213+
214+
S_i=(S_i<0)?0:S_i;
215+
//if (S_i<0.1)System.out.println("canopy"+S_i);
210216

211217
return S_i;
212218
}

src/main/java/groundWater/WaterBudgetGroundWater.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ public void process() throws Exception {
113113
if(step==0){
114114
for (Entry<Integer, double[]> entry : entrySet){
115115
Integer ID = entry.getKey();
116-
initialConditionS_i.put(ID,new double[]{Smax/2});
116+
initialConditionS_i.put(ID,new double[]{5});
117+
System.out.println("gw"+a+"-"+b+"-"+Smax);
117118
}
118119
}
119120

@@ -171,7 +172,7 @@ public double computeS(double recharge, double S_i) throws IOException {
171172
/** Check of the Storage values: they cannot be negative*/
172173
if (S_i<0) S_i=0;
173174

174-
if(S_i<1)System.out.println("gw"+a+"-"+b+"-"+Smax);
175+
if(S_i<0.01)System.out.println("gw"+a+"-"+b+"-"+Smax);
175176

176177

177178
return S_i;

src/main/java/rootZone/WaterBudgetRootZone.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ public void process() throws Exception {
158158
for (Entry<Integer, double[]> entry : entrySet){
159159
Integer ID = entry.getKey();
160160
initialConditionS_i.put(ID,new double[]{s_RootZoneMax/2});
161+
System.out.println("P:"+Pmax );
162+
//System.out.println("input:"+actualInput );
163+
System.out.println("b:"+b_rz );
164+
System.out.println("pB:"+pB );
161165
}
162166
}
163167

@@ -185,10 +189,7 @@ public void process() throws Exception {
185189

186190
//System.out.println("RZmax:"+s_RootZoneMax );
187191

188-
//System.out.println("P:"+Pmax );
189-
//System.out.println("input:"+actualInput );
190-
//System.out.println("b:"+b_rz );
191-
//System.out.println("pB:"+pB );
192+
192193

193194

194195

@@ -279,7 +280,7 @@ public double computeS(double actualInput, double S_i, double ETp) throws IOExce
279280
/** Check of the Storage values: they cannot be negative*/
280281
//if (S_i<0) S_i=0;
281282

282-
if(S_i<0.5)System.out.println("rootzone"+"-"+s_RootZoneMax+"-"+Pmax+"-"+b_rz);
283+
//if(S_i<0.5)System.out.println("rootzone"+"-"+s_RootZoneMax+"-"+Pmax+"-"+b_rz);
283284

284285

285286
return S_i;
@@ -295,7 +296,7 @@ public double computeS(double actualInput, double S_i, double ETp) throws IOExce
295296
* @throws IOException Signals that an I/O exception has occurred.
296297
*/
297298
public double computeR(double S_i) throws IOException {
298-
double Rg=Pmax*Math.pow(S_i, b_rz);
299+
double Rg=Pmax*Math.pow(S_i/s_RootZoneMax, b_rz);
299300
return Rg;
300301
}
301302

src/main/java/rootZone/waterBudgetODE.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public int getDimension() {
7272
*/
7373
public void computeDerivatives(double t, double[] y, double[] yDot)
7474
throws MaxCountExceededException, DimensionMismatchException {
75-
yDot[0] =actualInput-Math.max(0, (ETp*Math.min(1,1.33*(y[0]/s_RootZoneMax))))-Pmax*Math.pow(y[0], b_rz);
75+
yDot[0] =actualInput-Math.max(0, (ETp*Math.min(1,1.33*(y[0]/s_RootZoneMax))))-Pmax*Math.pow(y[0]/s_RootZoneMax, b_rz);
7676
//System.out.println("y"+yDot[0]);
7777

7878
}

src/main/java/simpleBucket/WaterBudget.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class WaterBudget{
7272

7373
@Description("Smax")
7474
@In
75-
public double Smax=10;
75+
public double Smax_ro=10;
7676

7777

7878
@Description("ODE solver model: dp853, Eulero ")
@@ -113,7 +113,8 @@ public void process() throws Exception {
113113
if(step==0){
114114
for (Entry<Integer, double[]> entry : entrySet){
115115
Integer ID = entry.getKey();
116-
initialConditionS_i.put(ID,new double[]{Smax/2});
116+
initialConditionS_i.put(ID,new double[]{Smax_ro/2});
117+
System.out.println("ro"+a_ro+"-"+b_ro+"-"+Smax_ro);
117118
}
118119
}
119120

@@ -156,10 +157,10 @@ public double computeS(double recharge, double S_i) throws IOException {
156157

157158

158159
/** Creation of the differential equation*/
159-
FirstOrderDifferentialEquations ode=new waterBudgetODE(recharge,a_ro,b_ro);
160+
FirstOrderDifferentialEquations ode=new waterBudgetODE(recharge,a_ro,b_ro,Smax_ro);
160161

161162
/** Boundaries conditions*/
162-
double[] y = new double[] { S_i, Smax };
163+
double[] y = new double[] { S_i, Smax_ro };
163164

164165
/** Choice of the ODE solver */
165166
SolverODE solver;
@@ -171,7 +172,7 @@ public double computeS(double recharge, double S_i) throws IOException {
171172
/** Check of the Storage values: they cannot be negative*/
172173
if (S_i<0) S_i=0;
173174

174-
//if(S_i<1)System.out.println("ro"+a_ro+"-"+b_ro+"-"+Smax);
175+
//if(S_i<1)System.out.println("ro"+a_ro+"-"+b_ro+"-"+Smax_ro);
175176

176177

177178
return S_i;
@@ -185,7 +186,7 @@ public double computeS(double recharge, double S_i) throws IOException {
185186
* @throws IOException Signals that an I/O exception has occurred.
186187
*/
187188
public double computeQ(double S_i) throws IOException {
188-
double Q=a_ro*Math.pow(S_i,b_ro);
189+
double Q=a_ro*Math.pow(S_i/Smax_ro,b_ro);
189190
return Q;
190191
}
191192

src/main/java/simpleBucket/waterBudgetODE.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class waterBudgetODE implements FirstOrderDifferentialEquations{
3535
public double b;
3636

3737
public double recharge;
38+
39+
public double Smax_ro;
3840

3941

4042

@@ -47,10 +49,11 @@ public class waterBudgetODE implements FirstOrderDifferentialEquations{
4749
* @param recharge: input recharge value
4850
* @param Qmod: the modeled input discharge
4951
*/
50-
public waterBudgetODE(double recharge, double a, double b) {
52+
public waterBudgetODE(double recharge, double a, double b, double Smax_ro) {
5153
this.a=a;
5254
this.b=b;
5355
this.recharge=recharge;
56+
this.Smax_ro=Smax_ro;
5457

5558
}
5659

@@ -66,7 +69,7 @@ public int getDimension() {
6669
*/
6770
public void computeDerivatives(double t, double[] y, double[] yDot)
6871
throws MaxCountExceededException, DimensionMismatchException {
69-
yDot[0] =recharge-a*Math.pow(y[0], b);
72+
yDot[0] =recharge-a*Math.pow(y[0]/Smax_ro, b);
7073

7174

7275

0 commit comments

Comments
 (0)