aquacropos / aquacrop

AquaCrop-OSPy: Python implementation of AquaCrop-OS
https://aquacropos.github.io/aquacrop/
Apache License 2.0
102 stars 73 forks source link

irrigation demand #153

Closed qianweihao closed 6 months ago

qianweihao commented 6 months ago

I have exported the water_flux file through the following code, but why is the irrigation amount fixed at 15mm per day (Irr Day), as I understand it, the irrigation amount should not be the same every day. My total irrigation is set to 300mm.:

from aquacrop import AquaCropModel, Soil, Crop, InitialWaterContent, IrrigationManagement from aquacrop.utils import prepare_weather, get_filepath import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.optimize import fmin import os

smts = [80]*4 max_irr_season = 300 # 300 mm (water) path = get_filepath('champion_climate.txt') wdf = prepare_weather(path) year1 = 2018 year2 = 2018 maize = Crop('Maize',planting_date='05/01') # define crop loam = Soil('ClayLoam') # define soil init_wc = InitialWaterContent(wc_type='Pct',value=[40]) # define initial soil water conditions

irrmngt = IrrigationManagement(irrigation_method=4,NetIrrSMT=30)

irrmngt = IrrigationManagement(irrigation_method=1,SMT=smts,MaxIrrSeason=max_irr_season) # define irrigation management model = AquaCropModel(f'{year1}/05/01',f'{year2}/10/31',wdf,loam,maize, irrigation_management=irrmngt,initial_water_content=init_wc) model.run_model(till_termination=True)

module_dir = os.path.dirname(os.path.abspath(file)) irr_origin = os.path.join(module_dir, 'drought-irrigation.csv') water_out = model._outputs.water_flux water_out.to_csv(irr_origin)

Han-Su22 commented 6 months ago

Hi,

This is an issue left after one of the tests recently. Also, see the issue below. https://github.com/aquacropos/aquacrop/issues/132

Before any official update, you may need to change the code by yourselves (line 178 in aquacrop/aquacrop/solution /irrigation.py). Like:

            Irr = min(IrrMngt_MaxIrr, IrrReq)

            #Irr = 15 # hard-code in 15mm depth for tests
qianweihao commented 6 months ago

extremely grateful