## 2 Materials and Methods
### Forecasting Models
#### 2.3.2. Agrohydrological Model Setup
The impact of different values in p and k controls how drainable water is retained in the root zone, and therefore the intrinsic capacity of the soil to buffer  
Figure 3: Flowchart of the MAGDA irrigation advisory service. the onset of plant water stress and hence the need for irrigation. Both parameters can be empirically calibrated from the decay of the soil moisture observed in the root zone profile immediately after rainfall events, when drainage may account for this and evapotranspiration losses are minimal. When soil moisture data is not available, typical values from literature can be adopted. Although the impact of different k-p paired values may have a critical impact on the generation of drainage and the onset of dryness conditions, this effect can be abruptly reduced when conditions for the generation of drainage are not met. Conditions for drainage generation in our analysis were only met in 2% of all the simulation runs due to the combination of (a) initial conditions with very dry soils very far from the field capacity), (b) small-size rainfall events (less than 25 mm) that were not enough for reaching the field capacity of the soils, and (c) an irrigation strategy which aims to meet crop water requirements at each timestep instead of filling the soil bucket up to the field capacity. Due to the difficulties found in calibrating the k-p parameters and considering the boundary conditions of our study, typical values of 0.2 for k and 1.5 for p were adopted. Actual evapotranspiration from the root-zone domain (\(ET_{sm}\) in Equation (1)) is estimated using the FAO56 algorithm [62] and incorporates a stress factor (\(F_{stress}\)) when soil moisture levels fall between the wilting point (wp) and field capacity (fc) (Figure 4B). \(F_{stress}\) ranges from 0, when soil moisture is lower than the wilting point, to 1 when soil moisture exceeds the field capacity. Both soil parameters, wp and fc, can be set up based on laboratory analyses or derived from pedotransfer functions if data on soil texture and organic matter content are known. \[ET_{sm}=ET_{c}\cdot K_{c}\cdot F_{stress} \tag{4}\]  
\(ET_{c}\) is crop reference evapotranspiration computed according to the Penman-Monteith-FAO equation [63]. \(K_{c}\) is the crop coefficient under optimal or non-stress conditions. In this study, SPHY was set up and tested in the SCDAB and Tetto-Bernardo pilot sites, assuming the general parameters listed in (Table 1)). For \(\mathrm{K_{c}}\) values, the 4-stage growth model suggested by the FAO Irrigation and Drainage Paper No. 24 [64] was adopted. In both pilot sites, the crop season was split into initial, development, middle, and end stages; each one characterized by a particular length and a tabulated or expert-based crop coefficient \(\mathrm{K_{c}}\) (see (Table 2)). The starting and ending dates for each stage of the crop were calculated once the planting date was fixed. Figure 4: Conceptual flowchart of the MAGDA irrigation advisory service: (**A**) Main inflow and outflow fluxes simulated in the root-zone domain, (**B**) Subdomains of flux simulation based on the actual soil moisture content in the root-zone and the soil moisture at the wilting point and field capacity.