diff --git a/aquacrop/entities/fieldManagement.py b/aquacrop/entities/fieldManagement.py index a2240b99..75c25e95 100644 --- a/aquacrop/entities/fieldManagement.py +++ b/aquacrop/entities/fieldManagement.py @@ -19,7 +19,7 @@ class FieldMngt: f_mulch (float): Soil evaporation adjustment factor due to effect of mulches - z_bund (float): Bund height (m) + z_bund (float): Bund height, user specifies in (m) but immediately converted to (mm) on initialisation for coherent calculations bund_water (float): Initial water height in surface bunds (mm) @@ -47,7 +47,7 @@ def __init__( self.mulch_pct = mulch_pct # Area of soil surface covered by mulches (%) self.f_mulch = f_mulch # Soil evaporation adjustment factor due to effect of mulches - self.z_bund = z_bund # Bund height (m) + self.z_bund = z_bund * 1000 # Bund height, user-specified as (m), here immediately converted to (mm) self.bund_water = bund_water # Initial water height in surface bunds (mm) self.curve_number_adj_pct = curve_number_adj_pct # Percentage change in curve number (positive or negative) diff --git a/aquacrop/solution/HIref_current_day.py b/aquacrop/solution/HIref_current_day.py index 672caca2..04ac561d 100644 --- a/aquacrop/solution/HIref_current_day.py +++ b/aquacrop/solution/HIref_current_day.py @@ -18,7 +18,7 @@ from aquacrop.entities.crop import CropStructNT -@cc.export("HIref_current_day", (f8,f8,i8,i8,b1,f8,f8,f8,CropStructNT_type_sig,b1)) +@cc.export("HIref_current_day", (f8,f8,i8,i8,b1,f8,f8,f8,f8,CropStructNT_type_sig,b1)) def HIref_current_day( NewCond_HIref: float, NewCond_HIfinal: float, @@ -27,6 +27,7 @@ def HIref_current_day( NewCond_YieldForm: bool, NewCond_PctLagPhase: float, NewCond_CC: float, + NewCond_CC_prev: float, NewCond_CCxW: float, Crop: "CropStructNT", growing_season: bool, diff --git a/aquacrop/solution/check_groundwater_table.py b/aquacrop/solution/check_groundwater_table.py index feab3194..db6de5e7 100644 --- a/aquacrop/solution/check_groundwater_table.py +++ b/aquacrop/solution/check_groundwater_table.py @@ -121,9 +121,9 @@ def check_groundwater_table( # Store adjusted field capacity values NewCond_th_fc_Adj = thfcAdj # prof.th_fc_Adj = thfcAdj - return (NewCond_th_fc_Adj, NewCond_WTinSoil) + return (NewCond_th_fc_Adj, NewCond_WTinSoil, NewCond_zGW) - return (NewCond_th_fc_Adj, None) + return (NewCond_th_fc_Adj, None, None) if __name__ == "__main__": cc.compile() diff --git a/aquacrop/solution/infiltration.py b/aquacrop/solution/infiltration.py index 460f8b68..15d0654e 100644 --- a/aquacrop/solution/infiltration.py +++ b/aquacrop/solution/infiltration.py @@ -130,11 +130,11 @@ def infiltration( NewCond_SurfaceStorage = 0 # Calculate additional runoff - if NewCond_SurfaceStorage > (FieldMngt_zBund * 1000): + if NewCond_SurfaceStorage > FieldMngt_zBund: # Water overtops bunds and runs off - RunoffIni = NewCond_SurfaceStorage - (FieldMngt_zBund * 1000) + RunoffIni = NewCond_SurfaceStorage - FieldMngt_zBund # Surface storage equal to bund height - NewCond_SurfaceStorage = FieldMngt_zBund * 1000 + NewCond_SurfaceStorage = FieldMngt_zBund * 1 else: # No overtopping of bunds RunoffIni = 0 @@ -286,11 +286,11 @@ def infiltration( # Increase surface storage NewCond_SurfaceStorage = NewCond_SurfaceStorage + (Runoff - RunoffIni) # Limit surface storage to bund height - if NewCond_SurfaceStorage > (FieldMngt_zBund * 1000): + if NewCond_SurfaceStorage > FieldMngt_zBund: # Additonal water above top of bunds becomes runoff - Runoff = RunoffIni + (NewCond_SurfaceStorage - (FieldMngt_zBund * 1000)) + Runoff = RunoffIni + (NewCond_SurfaceStorage - FieldMngt_zBund) # Set surface storage to bund height - NewCond_SurfaceStorage = FieldMngt_zBund * 1000 + NewCond_SurfaceStorage = FieldMngt_zBund else: # No additional overtopping of bunds Runoff = RunoffIni diff --git a/aquacrop/solution/irrigation.py b/aquacrop/solution/irrigation.py index 71922b4f..740b1f03 100644 --- a/aquacrop/solution/irrigation.py +++ b/aquacrop/solution/irrigation.py @@ -175,8 +175,8 @@ def irrigation( EffAdj = ((100 - IrrMngt_AppEff) + 100) / 100 IrrReq = IrrReq * EffAdj # Limit irrigation to maximum depth - # Irr = min(IrrMngt_MaxIrr, IrrReq) - Irr = 15 # hard-code in 15mm depth for tests + Irr = min(IrrMngt_MaxIrr, IrrReq) + # Irr = 15 # hard-code in 15mm depth for tests else: Irr = 0 diff --git a/aquacrop/solution/root_development.py b/aquacrop/solution/root_development.py index 57e9ae7a..18bcb0f2 100644 --- a/aquacrop/solution/root_development.py +++ b/aquacrop/solution/root_development.py @@ -272,7 +272,7 @@ def root_development( # No root system outside of the growing season NewCond_Zroot = 0 - return NewCond_Zroot + return NewCond_Zroot, NewCond_rCor if __name__ == "__main__": cc.compile() diff --git a/aquacrop/timestep/run_single_timestep.py b/aquacrop/timestep/run_single_timestep.py index e776f21f..717faf7c 100644 --- a/aquacrop/timestep/run_single_timestep.py +++ b/aquacrop/timestep/run_single_timestep.py @@ -179,7 +179,7 @@ def solution_single_time_step( # Run simulations %% # 1. Check for groundwater table - NewCond.th_fc_Adj, NewCond.wt_in_soil = check_groundwater_table( + NewCond.th_fc_Adj, NewCond.wt_in_soil, NewCond.z_gw = check_groundwater_table( Soil.Profile, NewCond.z_gw, NewCond.th, @@ -189,7 +189,7 @@ def solution_single_time_step( ) # 2. Root development - NewCond.z_root = root_development( + NewCond.z_root, NewCond.r_cor = root_development( Crop, Soil.Profile, NewCond.dap, @@ -396,8 +396,8 @@ def solution_single_time_step( NewCond.delayed_cds, NewCond.yield_form, NewCond.pct_lag_phase, - #NewCond.cc_prev, NewCond.canopy_cover, + NewCond.cc_prev, NewCond.ccx_w, Crop, growing_season, diff --git a/setup.cfg b/setup.cfg index c3f9ffb0..cfbaeed2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = aquacrop -version = 3.0.8 +version = 3.0.9 author = Tim Foster author_email = timothy.foster@manchester.ac.uk description = Soil-Crop-Water model based on AquaCrop-OS.