Skip to content

Commit 963d3d3

Browse files
authored
Merge pull request #29 from vcorcoro/master
updated automatic irrigation
2 parents 6304a28 + 1b81961 commit 963d3d3

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/rhizosphere/waterbalance.jl

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Transpiration
2626
soil_table[Symbol(soil_class)].wilting_point
2727
end ~ preserve(parameter, u"mm")
2828

29-
29+
3030
# "Irrigation"
3131
# irrigation => 0 ~ preserve(parameter, u"mm/hr")
3232

@@ -174,22 +174,32 @@ Transpiration
174174
# (field_capacity / soil_depth)
175175
#end~ track
176176

177-
"Irrigation control parameters"
178-
irrigation_start(WP, soil_depth) => WP / soil_depth ~ preserve(parameter) # Irrigation start point VWC- wilting point
179-
irrigation_end(field_capacity, soil_depth) => field_capacity / soil_depth ~ preserve(parameter) # Irrigation end point VWC - field capacity
177+
"Irrigation control parameters"
178+
irrigation_start_level => 1 ~ preserve(parameter) # as percent of ASW + WP
179+
irrigation_end_level => 1 ~ preserve(parameter) # as percent of ASW + WP
180180
irrigation_rate => 0.5 ~ preserve(parameter, u"mm/hr") # Irrigation rate mm/hr
181181

182+
irrigation_start(irrigation_start_level, field_capacity, WP, soil_depth) => begin
183+
(irrigation_start_level * (field_capacity - WP) + WP) / soil_depth
184+
end ~ preserve(parameter) # Irrigation start point VWC
185+
186+
irrigation_end(irrigation_end_level, field_capacity, WP, soil_depth) => begin
187+
(irrigation_end_level * (field_capacity - WP) + WP) / soil_depth
188+
end ~ preserve(parameter) # Irrigation end point VWC
189+
182190
"Update irrigation status based on VWC"
183-
irrigation(VWC, irrigation_rate, irrigation_start, irrigation_end) => begin
184-
if VWC < irrigation_start
191+
flag_irrigation(VWC, irrigation_start, irrigation_end, flag_irrigation) => begin
192+
(VWC < irrigation_start) || (VWC < irrigation_end && flag_irrigation)
193+
end ~ flag
194+
195+
irrigation(irrigation_rate, flag_irrigation) => begin
196+
if flag_irrigation
185197
irrigation_rate
186-
elseif VWC > irrigation_end
187-
0
188198
else
189-
irrigation_rate
199+
0
190200
end
191201
end ~ track(u"mm/hr")
192-
202+
193203
# Relative drought factor from CROPGRO. Used for N_uptake_conversion_factor.
194204
# Captures water stress due to both drought and water logging through reduction in stomatal conductance
195205
"Relative water stress factor"

0 commit comments

Comments
 (0)