HydroShoot: a functional-structural plant model for simulating hydraulic structure, gas and energy exchange dynamics of complex plant canopies under water deficit - application to grapevine (Vitis vinifera L.)

This paper aims at presenting HydroShoot, a functional-structural plant model (FSPM) that is developed to simulate gas-exchange rates of complex plant canopies under water deficit conditions, by scaling up gas-exchange rates from the leaf to the canopy levels. The main hypothesis is that simulating both the hydraulic structure of the shoot together with the energy budget of individual leaves is the asset for successfully achieving this up-scaling task. HydroShoot was hence built as the ensemble of three interacting modules: hydraulic which calculates the distribution of xylem water potential across shoot hydraulic segments, energy which calculates the complete energy budget of individual leaves, and exchange which calculates net assimilation and transpiration rates of individual leaves. HydroShoot was coupled with irradiance interception and soil water balance models, and was evaluated on virtual and real grapevines having strongly contrasted canopies, under well-watered and water-deficit conditions. HydroShoot captured accurately the impact of canopy architecture and the varying soil water deficit conditions on plant-scale gas-exchange rates and leaf-scale temperature and water potential distributions. Both shoot hydraulic structure and leaf energy budget simulations were, as postulated, required to adequately scaling-up leaf to canopy gas-exchange rates. Notwithstanding, simulating the hydraulic structure of the shoot was found far more necessary to adequately performing this scaling task than simulating leaf energy balance. That is, the intra-canopy variability of leaf water potential was a better predictor of the reduction of whole plant gas-exchange rates under water deficit than the intra-canopy variability of leaf temperature. We conclude therefore that simulating the shoot hydraulic structure is a prerequisite if FSPM’s are to be used to assess gas-exchange rates of complex plant canopies as those of grapevines. Finally HydroShoot is available through the OpenAlea platform (https://github.com/openalea/hydroshoot) as a set of reusable modules. Highlights Plant-scale gas-exchange rates were accurately reproduced using an FSPM based on the leaf-scale. Simulating the hydraulic structure of the shoot improves the prediction of plant gas-exchange rates under water deficit conditions. Simulating the intra-canopy variability of leaf temperature has a minor impact on plant-scale gas-exchange dynamics. Accurate predictions of gas-exchange rates of complex grapevine canopies require accounting for their hydraulic structure.


Introduction
Climate change is seriously challenging viticulture sustainability in its current areas of production (Hannah et al., 2013;van Leeuwen et al., 2013;Duchêne et al., 2014). One efficient short-term solution for hampering the projected adverse effects of water and heat stress on viticulture, is to reconsider training systems so that they allow maximizing the ratio of carbon assimilation ( , ) to water loss by transpiration ( ) whilst maintaining optimal leaf temperature conditions ( Therefore, the design of canopy structures that are adapted to adverse environmental conditions is most efficiently performed with the aid of models able to accurately predict the influence of canopy architecture on its gas exchange rates and leaves temperature under combined water and heat stress. That is what functional-structural plant models (FSPMs) offer .
FSPMs received nevertheless little attention in grapevine scientific literature to assess the impact of shoot architecture on plant gas-exchange rates (Medrano et al., 2015a). This is probably due to the inherent complexity in scaling up eco-physiological processes from the leaf to the canopy level, as strong variability in gas exchange rates (CO2 versus water vapor) exists inside the canopy driven by variations in micrometeorological conditions and leaf functional traits (Niinemets et al., 2014;Medrano et al., 2015b). This scaling-up task is even more complex under water deficit conditions, as stomatal aperture is likely to reduce under water deficit in a non-uniform pattern across the canopy (e.g. Gonzalez-Dugo et al., 2012; Ngao et al., 2017) further distorting intra-canopy gas-exchange and leaf temperature variability (Reynolds and Vanden Heuvel, 2009). Bauerle et al. (2007) indicated that disregarding this variability may lead to strongly overestimate the predicted whole canopy daily transpiration flux, up to 25% greater than observed values as they found on a study on Red Maple (Acer rubrum L.) Hence, adequately predicting the intra-canopy variability of both leaf stomatal conductance and temperature stands out as the key challenge to using FSPMs to predict plant gas-exchange rates under water deficit conditions. Yet, the remaining question is how can this variability be accurately described and what are their main determinants.
Describing the intra-canopy variability of both leaf stomatal conductance and temperature requires from the one hand to explicitly describe their drivers as a function of leaf position inside the canopy, and from the other hand to adequately account for their mutual interactions (how stomatal aperture affects leaf energy budget and vice versa) (Chelle, 2005). The main drivers for both processes are commonly determined as incident shortwave irradiance, air temperature, air humidity and leaf "water status" which determines stomatal closure (Damour et al., 2010). Among these drivers, leaf water status (which controls stomatal aperture and consequently both leaf transpiration and temperature) still makes no consensus in the scientific literature when it comes to determining what it refers to. A basal approach considers that leaf water status is equal to the soil water status (e.g. Misson et al., 2004;van Wijk et al., 2000), considering that the "remote" action of available water in the rhizosphere impacts uniformly all leaves, regardless of their position. By contrast, leaf water status may also be considered as a "local" water status specific to each individual leaf (e.g. Tuzet et al., 2003;Buckley et al., 2003) which results from the interplay between water demand (transpiration) and offer (xylem flow) at the leaf-scale, which are notably determined by the shoot hydraulic structure. This "local" approach mostly agrees with observations whereby stomatal closure is uneven across the canopy. Sunlit leaves, for instance, experience stronger water deficit than shaded leaves, and are therefore the first to undergo reductions in gas exchange rates under water deficit (Escalona et al., 2003). This "local" approach seems hence as the most adequate in FSPM's, however, the "remote" modelling approaches also proved satisfactory when individually considered. (e.g. Dauzat et al., 2001;Bailey et al., 2016;Ngao et al., 2017). It is hence unclear in literature how the simulation of leaf water status of individual leaves affects the predicted gas-exchange rates and leaf temperature distribution in FSPMs under water deficit and this matter needs to be assessed if FSPMs are to be used under water deficit conditions. The few number of the existing grapevine FSPM's in literature does not account for the interactions between water status, energy budget and gas-exchange rates at the leaf scale. Prieto et al. (2012) were probably the first to use an FSPM to examine the effects of canopy architecture on gasexchange in grapevine (cv. Syrah). The authors coupled the grapevine-specific structural plant model proposed by Louarn et al. (2008) to leaf-level models of photosynthesis (Farquhar et al., 1980) and stomatal conductance (Leuning, 1995) but did not incorporate the effects of (soil) water deficit. More recently, Zhu et al. (2017) developed a model similar to that proposed by Prieto et al. (2012) including the effect of water deficit on gas-exchange and leaf temperature. Nevertheless, this model assumed a uniform xylem water potential across the shoot, that disregarded how shoot hydraulic structure affects leaf-scale gas-exchange rates, which is an unrealistic assumption for large plants when considering the substantial hydraulic resistances observed in the stems of mature grapevine (Jacobsen et al., 2012). In addition, longwave energy exchange among leaves from the one hand, and between leaves and the surrounding elements from the other hand, were disregarded, which makes the application of this model to open field conditions not suitable since sky and soil longwave energies substantially affect leaves temperature (Nobel, 2005). This has been solved in two models that link a complete energy budget with gas-exchange in perennials (Bailey et al., 2016 for Vitis vinifera L. and Acer x fremanii; Ngao et al., 2017 for Malus pumila Mill.) Yet again, both models were built at the leaf-cluster scale which does not allow accounting for the location of individual leaves in plant hydraulic structure necessary to calculate local leaf water status. In addition, both models consider the "remote" action of the rhizosphere on stomatal aperture instead of the "local' water status, assuming again as negligible the potential contribution of shoot hydraulic structure on shaping the intra-canopy variability of leaf stomatal conductance and temperature.
In this paper, it is postulated that intra-canopy variability in both leaf water potential and leaf temperature are the main drivers for adequately predicting photosynthesis and transpiration fluxes at the plant scale under water deficit conditions using FSPMs. This paper has threefold objective. The first is to describe HydroShoot, a leaf-scale-based FSPM that allows predicting whole plant transpiration and photosynthesis rates by scaling-up these processes from the leaf-level. This model uses as lever for this scaling process the simulation of the interactions between hydraulic structure of the shoot, the energy balance, and gas-exchange rates of individual leaves. The second objective is to evaluate the performance of the model using both virtual and real canopies with data collected on photosynthesis and transpiration rates (plant scale), and stomatal conductance and temperature (leaf scale). Finally, the third objective is to examine how detailed hydraulic structure and energy budget simulations determine the predicted gas-exchange rates at the plant scale under water deficit conditions.

Model structure and basic assumptions
HydroShoot is a static FSPM (with regards to plant structure) that takes plant shoot architecture, weather, and soil water conditions as inputs, and returns transpiration and net photosynthesis rates both of individual leaves and the whole plant at hourly time steps as outputs. It is conceived as a set of three modules which simulate water potential (hydraulic module), energy budget (energy module), and C3-type gas-exchange rates (exchange module). These three modules run jointly, having leaf xylem water potential and temperature at the leaf level as pivots (cf. implementation and numerical solution section). The formalisms used in each module are developed in the following sections.

Hydraulic module
The hydraulic module computes water potentials of plant segments (output of the module) as a function of water flow in the plant and water potential of the soil (input to the module). The whole plant is compartmentalized in elementary conducting elements corresponding to petioles, internodes of the current-year stems, and elements of previous-year trunk and branches (internodes or pruning complexes). Leaves are treated in this system as nodes letting water flow but having no gradient in their water potential ( ). a b Water transfer across the hydraulic segments is simulated by analogy to Ohm's law in electrical circuits ( Figure 1). Each segment is characterized by its length ( , ) and hydraulic conductivity ( , Xylem conductivity varies with water potential as a result of xylem cavitation under water deficit (Tyree and Sperry, 1989). This relationship is described using a sigmoidal function: Equations 1 to 3 apply to all conducting segments (not leaves blades). Water potential of the upper extremity of the petiole is assumed equal to that of the lumped leaf water potential .

Exchange module
The exchange module computes the rates of net carbon assimilation and transpiration per unit surface area (respectively and ) for each individual leaf as a function of micrometeorological conditions and leaf water status. The calculations use the analytical solution proposed by Yin et al. (2009) for coupling the 3 photosynthesis model of Farquhar et al. (1980) to the stomatal conductance model of Ball et al. (1987). This coupling is based on Fick's first law of diffusion, whereby , the stomatal conductance to CO2 ( , 2 ), and the mesophyll conductance ( ) are used. However, as Farquhar's model has been thoroughly detailed in literature, its description is given in Appendix I. The focus of this section is given instead to the stomatal conductance formulae which are a key element in this work. −1 ], 0 is a dimensionless shape parameter, and is a dimensionless function representing the response of , 2 to air water vapor deficit ( , ). is deduced from the stomatal conductance model of Leuning (1995) as: where 0 is a scaling parameter [ ].
Eq. 5a does not account for stomatal sensitivity to soil water deficit ("remote" approach) or local leaf water potential ("local" approach). Finally, this module was provided with photoinhibition model as this phenomenon is frequently reported to affect grapevines under combined heat and water stresses (Correia et al., 1990;Flexas and Medrano, 2002;Lovisolo et al., 2010). The simple photoinhibition model implemented in HydroShoot is detailed in Appendix II and assumes that combined heat and water stresses inhibit photosynthesis by reducing the electron transport rate (cf. in Eq. A6) as the result of an increased of deactivation energy (cf. equations A9 and A10).

Energy module
The energy module computes the temperature of individual leaves based on a detailed energy balance model that is developed in the supplementary materials provided with this paper and only briefly described hereafter for the sake of simplicity.
Each leaf is represented as a group of solid flat triangles. It gains energy from the absorbed shortwave (solar irradiance) and thermal longwave irradiance from the sky, the soil, and the neighbouring leaves (indexed ). It loses energy through its own emission in the thermal longwave band and through latent heat due to transpiration (output of exchange module). Finally, it exchanges energy with the surrounding air by thermal conduction-convection. The resulting leaf-scale energy balance equation writes: Since the resolution of the last equation is highly time-consuming, we assumed the energy gain from the neighbouring leaves through thermal longwave as a lumped term whereby average leaf temperature is considered instead of individual leaves (Dauzat et al., 2001). In this case, the lumped form factor ∑ ∈ is simply taken as 1 − ( + ) (that is the solid angle where neither the sky nor the soil are seen by a single leaf). The former equation becomes:

Implementation and numerical resolution
HydroShoot is developed using the Python programming language (Python Software The resolution of HydroShoot equations is performed by an iterative procedure that is schematized in Figure 2. is xylem water potential at the nodes between each pair of stem −1 ]is initial hydraulic conductivity of each segment, is the maximum allowable error of the estimation of xylem water potential [ ] and is the maximum allowable error of the estimation of leaf temperature [ ]. Circles inside module boxes indicate internal iteration loops. Symboles between curly brackets represent spatially-structured variables. Iterations have three levels. The first is in the hydraulic module and concerns calculating xylem water potential of plant segments in interaction with their hydraulic conductivity (interdependent processes, cf. equations 1 and 2). The second level is between the exchange and hydraulic modules in order to calculate jointly gas-exchanges rates and leaf water potential values (transpiration affects the hydraulic structure Eq. 1 while the latter affects stomatal aperture Eq. 5b). The third level is between the energy module and both exchange and hydraulic modules, so that at each time new transpiration fluxes are calculated, leaf temperature values are updated and the new temperature values are used to update gas-exchange rates which in their turn impose new xylem water potential distribution. The details on the numerical resolution are given in Appendix III.
Coupling with irradiance and soil models HydroShoot needs irradiance absorption by individual leaves and soil water potential as inputs. It is therefore coupled in this work to Caribu irradiance model (Chelle et al., 1998) and to a simple soil water-budget model in order to calculate respectively irradiance absorption ( ) and soil water potential ( ) values on an hourly basis ( Figure 3). The soil module links transpired water rates to the transpirable soil water volume ( ) in order to predict the hourly variations in . At the beginning of each calculation step, transpired water volume from the previous step is withdrawn from the . The soil volumetric water content is then determined by dividing by the effective soil porosity. is then obtained from from the water retention curve (van Genuchten, 1980) and used as an input for the hydraulic module. This procedure is referred to as the Root-Shoot loop in Figure 3. −1 ] is initial hydraulic conductivity of each segment. Symbols between curly brackets represent spatially-structured variables. architecture, CARIBU (Chelle et al., 1998) and soil are external modules used to simulate canopy architecture, irradiance interception, and soil water potential, respectively.

Model evaluation
Model evaluation was performed in three steps. Firstly, the coherence between expected and simulated gas-exchange, temperature, and xylem water potential dynamics for different canopies architectures was assessed. Secondly, the precision was assessed by comparing model outputs to measured plant gas-exchange rates and leaf stomatal conductance, water potential and temperature. Finally, the required complexity level was evaluated, whereby we sought at determining whether simulating the hydraulic structure and energy balance were (both) required in order to obtain accurate predictions of gas-exchange rates at the plant scale. For all the following simulations, parameter values are given in Appendix IV.

Coherence
For this aim, HydroShoot was run on 3 virtual grapevine canopies which share the same soil type, soil initial water content, weather conditions, and total leaf area, and differ only in their shoot architecture ( Figure 4).
The 3 canopies were trained on three different training systems: Vertical Shoot Positioning (VSP), Geneva Double Curtain (GDC) and Lyre systems (Figure 4a). All canopies had the same leaf area (5.7 2 ), internode diameter distribution (Figure 4b), planting density (inter-and intra-row spacing of 3.6 and 1.0 respectively), soil type (Sand Loam) and initial collar water potential (-0.6 ). The simulations were run using weather data extracted from the database of the weather station of the National Institute for Agricultural Research (INRA)  and maximum air temperature of 19 and 34 °C respectively, relative humidity oscillating between 32 and 44%, wind speed at 2 height going from 0 to 2 −1 , and a clear sky with a maximum of 1670 −2 −1 at solar midday.

Precision
The precision of simulated outputs was evaluated by running HydroShoot on real canopies using collected data from experiments conducted in 2009 and 2012 on grapevine (cv. Syrah, grafted on SO4) at INRA, in Montpellier (same above-mentioned station). Five grapevines trained with two contrasting training systems were considered (cf. Figure 5): GDC in 2009 and VSP in 2012. Grapevine rows were oriented 140° from North on a shallow sandy loam soil with a low water holding capacity. Inter-row spacing was 3.6 for GDC and 1.8 for VSP. Intra-row spacing was 1 (cf. supplementary materials for a detailed description of measurements).
Data on VSP grapevines (2009) were collected during a period of 4 days under well-watered and water-deficit conditions. Water deficit was created by cutting off the irrigation system on the first day of the experiment (July 29 th ). Whole plant transpiration and net assimilation monitored using open portable gas-exchange chambers (Perez Peña and Tarara, 2004). Temperature of individual leaves were monitored using thermocouples inserted into the primary veins of 10 fullydeveloped individual leaves positioned on different heights from the top of the canopy to the inside, so that temperature gradient resulting from different irradiance conditions was captured. Data on GDC grapevines (2012) were also collected during a 4 days experiment (starting on August 1 st ), but only under water-deficit conditions. Only rate was monitored by measurements of sap flow installed on the two cordons of the GDC plants. Stomatal conductance and leaf water potential measurements were performed for a number of leaves on GDC grapevines during the experiment but the exact position of leaves was not reported with measurements.
For both VSP and GDC grapevines, shoot architecture was constructed based on digitisation data, using a grapevine-specific shoot architecture module following a Multiscale Tree Graph (MTG) approach (

Complexity
In order to explore the contribution of HydroShoot's hydraulic and energy modules components to the final simulation output, a sensitivity analysis was performed by plugging/unplugging each of these components and observing the resulting difference on simulated outputs. This procedure aims in fine at evaluating whether adding complexity to an FSPM would improve its performance in predicting gas-exchange dynamics at the plant-scale. The following simulation combinations are used: • sim0: the reference (complete) version of HydroShoot having the ensemble of its components; • sim1: stomatal conductance varies with (as described by Leuning, 1995 in Eq. 5a) regardless of leaf water potential; • sim2: the hydraulic structure is disregarded (water potential of all leaves is forced equal to water potential at the collar) and stomatal conductance varies with collar water potential Eq. 5c; • sim3: energy balance is disregarded, that is all leaves have the same temperature as that of the air; • sim4: the same case of sim1 but using tighter control of on stomatal conductance ( 0 in Eq. 5a is set to 1 instead of 30 as proposed by Prieto et al. (2012).

Evaluation criteria
The overall adequacy between observed and simulated variables was assessed based on the estimation of the mean bias error ( ) and root mean square error ( ): where and are respectively simulated and observed variables values and is the number of observations.

Results and discussion
Outputs coherence Simulation outputs for virtual canopies are illustrated in Figure 6 (plant-scale outputs) and  The simulations at the plant scale ( Figure 6) show that GDC canopies had the highest absorbed irradiance rates , , followed by Lyre and VSP canopies (Figure 6a), reflecting the higher exposure to solar irradiance using the GDC system. This trend was reflected on carbon assimilation , (Figure 6b), temperature (Figure 6c), and transpiration ( Figure 6d), whereby highest values were obtained for GDC then Lyre followed by VSP canopies.

Midday depression in
, was simulated for the three canopies proportionally to the absorbed , , that is highest for GDC and lowest for VSP (Figure 6b). The higher transpiration rates of GDC led to simulate lower leaf water potential values (Figure 7) around midday, which, combined with higher absorbed irradiance, led also to higher leaf temperatures (Figure 8). The combined effects of lower leaf water potential and higher temperature in GDC led to simulate a higher effect of midday depression in , compared to Lyre and VSP canopies as may be expected.  This first illustrative example on virtual canopies shows that the effect of canopy architecture on its gas-exchange and temperature behaviour is captured in HydroShoot. The comparison to measurements in the following section will show how the observed dynamics on both plant and leaf scales are accurately reproduced using HydroShoot for two real canopies.
Comparison to observed data Leaf-scale Simulation results at the leaf-scale are shown in Figures 9, 10 and 11, respectively for water potential, stomatal conductance, and temperature. The dynamics of these variables were adequately reproduced but with some discrepancies regarding the onset timing of the effect of water-deficit. Due to a strong uncertainty on the exact position of leaves where measurements were performed, the comparison between observed and simulated processes at the leaf-scale will focus on variable dynamics rather than absolute values. Figures 9 and 10 show that the simulated and , 2 of the three GDC canopies decreased progressively as the soil water deficit increased, consistently with observations, but with an earlier onset of water stress which is probably due to inadequate parametrization either of the response function of , 2 to (cf. Eq. 5b) or of the soil hydrodynamic model (cf. Coupling with irradiance and soil models). Upon the onset of water stress, when water deficit was still mild in the first day (date 01 08 in Figure 10), HydroShoot simulated higher , 2 for sunlit leaves than for shaded leaves. Later, as water deficit increases, this trend is inverted, whereby sunlit leaves have the lowest , 2 rates (dates 02 08 and 03 08 in Figure 10). This inversion is due to a lower for sunlit leaves as a consequence of higher potential transpiration withdrawal per unit leaf surface area (cf. Eq. 1).
Moreover, Figure 10 shows that, by the end of the water-deficit period (day 03 08), leaf position had merely no more effect on its water vapor conductance , 2 . At this stage, water potential of all leaves reached low values at which stomata were almost closed. This uniformization of stomatal closure through the canopy is consistent with the observations reported by  : Snapshots of the simulated hydraulic structure of the three GDC canopies considered in this study, referred to as 'Canopy1', 'Canopy2' and 'Canopy3', respectively, prior to solar noon, during the first three days following the onset of soil water deficit, respectively 01 08, 02 08 and 03 08. Soil predawn water potential of the three days was equal to -0.19, -0.38, -0.61 respectively. Filled circles represent xylem water potential, their colors (only for leaves) represent the absorbed value per unit leaf surface area; sunlit leaves are yellow while shaded leaves are red, and grey circles are for the trunk. Due to uncertainties in measurements locations, the observed water potential values of sunlit leaves are indicated by the grey patches which cover minimum and maximum leaf water potential values. Observed data were collected from experiments conducted in 2012. Figure 10: Snapshots of the stomatal conductance of the three GDC canopies considered in this study, referred to as 'Canopy1', 'Canopy2' and 'Canopy3', respectively, prior to solar noon, during the first three days following the onset of soil water deficit, respectively 01 08, 02 08 and 03 08. Soil predawn water potential of the three days was equal to -0.19, -0.38, -0.61 respectively. Filled circles represent stomatal conductance to water ( , 2 ), their colors represent absorbed value per unlit leaf surface area; sunlit leaves are yellow while shaded leaves are red. Due to uncertainties in measurements locations, the observed stomatal conductance values of sunlit leaves are indicated by the dark grey patches which cover minimum and maximum values. Observed data were collected from experiments conducted in 2012.
The effect of soil water deficit on leaf temperature was efficiently captured by HydroShoot (Figure 11, Figure 12). The diurnal trends of leaves temperature were adequately reproduced ( Figure  11) whereby a higher diurnal temperature was simulated under water-deficit (Figure 11b, d) than wellwatered (Figure 11a, c) conditions. The comparison between simulated and observed temperatures at the leaf level ( Figure 12) shows that the model simulated an increase in leaf-to-air temperature of approximately 2 °, in agreement with observations ( Figure 12a). Furthermore, HydroShoot reproduced the observed magnitude between minimum and maximum leaf temperatures across the canopy ( Figure  12b) and how this magnitude increased with soil water deficit (Figure 12c), although underestimated the effect of water deficit on this magnitude (Figure 12c).
The overall adequation between simulated and observed leaf temperature was high when comparing median values ( Figure 11) having an equal to 0.9 and 1.2 ° under well-watered and water-deficit conditions, respectively, while bias in was limited to a maximum value of -0.74 °. However, greater error is obtained when leaf-to-leaf comparison is performed (Figure 12) with an overall reaching 2.3 ° and a bias of -0.79 °. This is mainly due to the weak performance during nocturnal hours where temperature was underestimated by the model (Figure 11, Figure 12). This may originate either from the modelling approach or from the measurements. argued that such discrepancies originate rather from the thermocouples which may not measure precisely leaf temperature due to weak thermal conductivity between the leaf tissues and the wires. Thermocouples performance may explain in our study, at least partially, the discrepancies between observed and simulated leaf temperature during the night. We add, however, to this explanation, a second one which deals with the effect of the constant value used for sky emissivity that may have been inadequate knowing that the latter is affected by air humidity and temperature (Brunt et al., 1932). Figure 11: Comparison between simulated and observed individual leaf temperature for VSP canopies under well-watered (a and c) and water stressed (b and d) conditions. Soil predawn water potential of the four days was equal to -0.37, -0.50, -0.40, and -0.32 respectively. (a and b) diurnal variation in leaf temperature: red zones indicate the extension between maximum and minimum simulated values, black curves indicate simulated mean values while blue boxplots indicate observed leaf temperature; (c and d) are 1:1 plots between observed (x-axis) and simulated (y-axis) leaves median temperatures for each hour with error bars representing minimum and maximum temperature values.

Plant-scale
The observed daily patterns of , and were accurately reproduced under both well-watered and water deficit conditions (Figure 13 for VSP and Figure 14 for GDC) albeit higher errors under water deficit occurred.
For VSP canopies (Figure 13), the reduction in soil-water availability was reflected by the severe reductions in , and rates, consistently with observations. and totaled respectively 0.4 −1 and 3.0 −1 for , under well-watered conditions (Figure 13a), compared to 2.0 −1 and 3.7 −1 , respectively, under water-deficit conditions ( Figure 13b).
For the three water-stressed GDC canopies (where only rates were observed), HydroShoot captured reasonably the diurnal variations in (Figure 14), having falling between 3.4 and 32.9 ℎ −1 and between 58.5 and 72.0 ℎ −1 which were both similar to values obtained for VSP. It is noteworthy that the impact of the imbalance in leaf area between both cordons of Canopy1 (cf. Figure 4) was reflected in the simulated (Figure 14, Canopy1) whereby a noticeable differences in the simulated fluxes was obtained between the eastern and western cordons (respectively red and blue curves in Figure 14, Canopy1) consistently with the observed sap flow rates (respectively red and blue dots in Figure 14, Canopy1). This example further demonstrate how the impact of canopy is adequately reflected on its ecophysiological functioning in HydroShoot. ) for each cordon of three grapevines plants trained to GDC under water deficit conditions. Soil predawn water potential of the three days was equal to -0.19, -0.38, -0.61, and -0.51 respectively. Red and blue colors indicate fluxes through east-and west-exposed cordons respectively. and indicate respectively mean bias error and root mean squared error (same units of the y-axes).
To which extent is modelling complexity needed?
We show in Figure 15 together with Table 1 that the best fit between simulated and observed gas-exchange rates was obtained using the complete HydroShoot model (i.e. sim0) which yielded, in almost all cases, the least values of and for both , and . However, the simulated hydraulic structure and spatialized leaf temperature values had unequal contributions to the predictions accuracy.
When stomatal aperture was dissociated from soil water status (i.e. sim1 and sim4), the results indicated a substantial increase in prediction errors, resulting in the highest values for both and especially for . For instance, increased from 131 to 433 ℎ −1 under wellwatered conditions, and from 70 to 441 ℎ −1 under water-deficit conditions, when sim0 is compared to sim1. An improvement in prediction quality was obtained when stomatal aperture was linked to the collar water potential (i.e. sim2), yet, a considerable error still existed compared to the reference case. For instance, of , increased from 0.42 to 1.62 −1 and from 2.01 to 2.51 −1 , respectively under well-watered and water-deficit conditions, with sim2 compared to sim0.
Similarly, of increased from 87 to 179 ℎ −1 and from 35 to 49 ℎ −1 respectively under well-watered and water-deficit conditions, using sim2 compared to the reference case sim0.
The aforementioned results indicate that linking leaf-scale stomatal aperture to leaf-level water potential (through ), by simulating the hydraulic structure, brought a considerable improvement to model performance. That is, predicting the intra-canopy variability in leaf water potential improves prediction accuracy of gas-exchange rates at the whole plant scale. These results agree with the conclusions reported by Ngao et al. (2017) on the role of leaf water potential variability on apple tree gas-exchange rates. The authors firstly reported that a reliable prediction of plant-scale gas-exchange fluxes in apple trees was allowed when stomatal closure was simulated as a function of soil water potential. However, they postulated that further improvements are yet expected when the hydraulic structure of the shoot is simulated.
Regarding the contribution of leaf-scale energy balance simulation on the predicted plantscale fluxes, its effect was shown weak (Table 1). Indeed, disregarding energy balance calculations (i.e. sim3) did not affect, yet improved, the predicted , rates under well-watered conditions ( and changed from of 0.42 to -0.02 −1 and from 3.0 to 3.1 −1 , respectively, using sim0 compared to sim3) and mildly affected , under water-deficit conditions ( and changed from of 2.01 to 2.13 −1 and from 3.7 to 3.9 −1 , respectively, using sim0 compared to sim3). Similar results were also obtained for .
Our results disagree with those reported by Bauerle et al. (2007) who estimated that disregarding the intra-canopy variability in leaf temperature would lead to overestimate by 22 to 25% for Red Maple (Acer rubrum L.) In our case study on grapevine, disregarding leaf energy balance calculations increased by 23% and 18% and by 13% and 5% for under well-watered conditions and water-deficit conditions, respectively. The differences between our results and those reported by Bauerle et al. (2007) may rely on the way the authors accounted for the impact of microclimate inside the canopy on leaf photosynthetic traits. In their study, Bauerle et al. (2007) used leaf temperature as the primer driver for intra-canopy variability in leaf photosynthetic traits. In our study, we linked leaf photosynthetic traits to the 10-days cumulative absorbed (cf. Eq. 11) while leaf temperature was used only to affect directly , and indirectly , 2 . This conceptual difference may explain the lower sensitivity to leaf temperature in our study compared to that performed by Bauerle et al. (2007). To this explanation may be added that provided by Bailey et al. (2016) who showed that the importance of accounting for the intra-canopy distribution of leaf temperature in FSPMs is a matter of canopy size. The authors reported that for grapevines, leaf temperature distribution had a negligible impact on the simulated plant-scale emitted thermal longwave irradiance. In contrast, on Freeman maple (Acer × Freemanii) which have notably higher leaf area per plant, simulating the spatial distribution of leaf temperature reduced by 50% prediction errors of the emitted thermal longwave irradiance. The low sensitivity of HydroShoot to leaf temperature may thus be linked to the simulated canopy size.
Notwithstanding, it is noteworthy that omitting energy balance calculations in HydroShoot allowed saving up to 21% calculation time on a portable computer. This considerable economy in calculation cost is an argument that should be considered when simulating large-scale plant scenes. ) and transpiration ( ) rates: the reference (complete) HydroShoot version is indicated as sim0, sim1 indicates the version whereby leaf stomatal conductance varies with vapor pressure deficit instead of leaf water potential (i.e. original model of Leuning, 1995), sim2 indicates the results obtained when the shoot hydraulic structure was omitted (i.e. all leaves have the same water potential which is equal to that of the collar), sim3 is for results obtained by omitting energy balance of individual leaves (i.e. leaves temperature equal to air temperature) and sim4 is the same as sim1 but with an increased impact of the vapor pressure deficit on , 2 ( 0 = 1 in Eq. 5a), finally, and indicate respectively the observed gas rate and air vapor pressure deficit. Table 1: Precision estimators of simulated carbon assimilation ( , ) and transpiration ( ) rates of the plant of well-watered and water stressed VSP grapevines using five versions of HydroShoot: sim0, the reference (complete) HydroShoot version, sim1, the version whereby leaf stomatal conductance varies with vapor pressure deficit instead of leaf water potential (i.e. original model of Leuning, 1995), sim2, shoot hydraulic structure omitted (i.e. all leaves have the same water potential which is equal to that of the collar), sim3, energy balance of individual leaves omitted (i.e. leaves temperature equal to air temperature) and sim4, the same as sim1 but with an increased impact of the vapor pressure deficit on , 2 ( 0 = 1 in Eq. 5a).

Conclusions
We presented in this paper the functional-structural plant model (FSPM) HydroShoot. This model was built in order to allow simulating the effect of plant shoot architecture on its gas-exchange dynamics under soil water deficit conditions. In order to achieve this objective, we constructed HydroShoot on the base of three interacting processes: leaf-scale gas-exchange, leaf-scale energy balance, and internode-scale xylem transport (i.e. the hydraulic structure of the shoot). The produced model was evaluated using both virtual and real grapevine canopies of three strongly contrasting shoot architectures, under both well-watered and water-deficit conditions. We showed that HydroShoot reproduced efficiently the effect of canopy architecture on plant-scale gas-exchange processes under the observed gradient of water deficit conditions, fulfilling thus the objectives for which the model was built. We showed furthermore that both hydraulic structure and energy balance simulations were required for a precise prediction of plant-scale gas-exchange rates under soil water deficit. However, our results indicate that the hydraulic structure has, by far, the largest effect on simulated net photosynthesis and transpiration rates for grapevine. In contrast, simulating leaf-scale energy balance improves minorly prediction results.  Photosynthetic capacity parameters of individual leaves are calculated based on 10 values using equations 9 to 11 ; ii.
Leaf temperature ( ) is assumed equal to that of the previous time step or equal to air temperature ( ) for the first time step. iii.
Collar water potential is forced equal to soil water potential as lower boundary of the hydraulic structure (only if the option of hydraulic structure is considered); iv.
Xylem maximum and actual hydraulic conductivities of each internode (respectively , and ) are calculated using respectively equations 2 and 3; v.
Xylem water potential at each node ( , ) is assumed equal to that of the previous time-step, otherwise, it is calculated using Eq. 1, assuming maximum hydraulic conductivities in all plant segments and considering the plant to be in hydrostatic equilibrium with the soil.

Convergence
When Eq. 1 is applied to a plant shoot of segments, thus consisting of N nodes according to the graph theory, a system of equations for + 1 water head values is obtained. To solve the system for water potentials at all nodes, boundary conditions are set as follows: the lower boundary condition is a Dirichlet-type whereby a constant soil water potential value ( ) is forced during each iteration; the upper boundary condition is a Neumann-type, whereby a constant flow ( ) is forced at each leaf node ( is equal to transpiration multiplied by leaf surface, cf. Eq. 6). The calculation procedure is detailed in the numerical resolution section.
1. Leaf-scale and rates are calculated using equations A1 to A8 and 4 to 8; 2.
is multiplied by leaf surface area to obtain xylem flux ( ) at the leaf level, that is forced to the hydraulic structure system; 3.
values are calculated for each internode by "walking downwards" from leaves to collar (postorder traversal on MTG); 4. New values of , are calculated from Eq. 1, assuming constant , by "walking upwards" (preorder traversal on MTG) starting from the collar (where is known) up to the leaves; 5.
values are updated using Eq. 2; 6. Steps 4 and 5 are repeated until convergence, that is the absolute difference ( , ) between two consecutive iterations (respectively − 1 and ) of at most one node, is lower than a predefined error threshold ( ): . New values are calculated from energy balance, considering the new values in Eq. 13 using the following steps; a. In a first step, the surrounding temperature ( ) is fixed at the first iteration (equal to from the previous calculation step) and is solved for each leaf.
b. In a second step, is updated considering the new values of leaf temperature and a new set of values is computed. c. The first and second steps are repeated until the maximum absolute difference of the temperature of each leaf between two consecutive iterations falls below 0.02 °C (Maes and Steppe, 2012). 8. Steps 1 to 7 are repeated until convergence, that is the absolute difference ( ) between two consecutive iterations (respectively − 1 and ) of at most one leaf, is lower than a predefined error threshold ( ): IV.    Figure 5 in the paper): GDC in 2009 and VSP in 2012. Grapevine rows were oriented 140° from North on a shallow sandy loam soil with a low water holding capacity. Inter-row spacing was 3.6 for GDC and 1.8 for VSP. Intra-row spacing was 1 .
Data on VSP plants (2009) were collected during a period of 4 days under well-watered and water-deficit conditions. Water deficit was created by cutting off the irrigation system on the first day of the experiment (July 29 th ). Whole plant transpiration and net assimilation , were monitored using open portable gas-exchange chambers having a cylinder of 1.5 diameter mounted by an opentop cone up to a height of 3 . The frame was made from 4 flat aluminum bars, positioned in a vertical plane on each extremity of the semicircular halves, mounted by 6 semicircular rings in a horizontal plane. The ensemble was covered by a polypropylene film (RXD32 Propafilm, Innovia Films Ltd. UK) of a thickness of 3.5 and 90% transmission to solar irradiance in the band. This plastic material was impermeable to water and CO2 and had a negligible water adsorption. Ambient air was taken from above the canopy at 3 height and conducted through flexible plastic pipes covered by a double aluminum foil to avoid solar heating. Air was then injected in the chamber through two holes drilled in the bottom foam and then uniformly distributed through the chamber using holed plastic socks ("plenums"). Air flux was controlled to satisfy a tradeoff between homogenizing air temperature inside the chamber (high flux) and keeping a differential in gas components between the inlets and the outlets (low flux). Air flow entering the chamber was continuously recorded using a differential pressure transducer (PX170, Omega Engineering Inc., UK). Its signal was transformed into flow units through a calibration equation of pressure versus air flow obtained with a reference method.
, was estimated as: where is given in [ −1 ], is the flow entering the chamber [ −1 ], and ℎ and ℎ are respectively the mole fractions of H2O of the ambient air at the entry and outlet of the chamber Similarly, , was calculated as: where , is given in [ −1 ], and are respectively the mole fraction of CO2 of the ambient air at the entry and outlet of the chamber [ −1 ].
Temperature of individual leaves inside the chambers were monitored using thermocouples. The latter were inserted into the primary veins of 10 fully-developed individual leaves positioned on different heights from the top of the canopy to the inside, so that temperature gradient resulting from different irradiance conditions may be captured. Temperature was measured continuously and recorded on a 12 minutes basis. Data on GDC grapevines (2012) were also collected during a 4 days experiment (starting on August 1 st ), but only under water-deficit conditions. Only rate was monitored by measurements of sap flow using heat energy balance gauges (SGEX25, Dynamax Inc., USA) installed on the two cordons of the GDC plants. The gauges were installed avoiding nodes and irregular trunk sections. Prior to installation, bark was removed to improve the thermal conductivity between the gauges and the sapwood. The gauges were then isolated from air by an aluminum foil which extended down to soil surface in the case of VSP in order to avoid vertical ascending of heat. Heating (5 V) was continuously provided by an external lead-acid battery branched which sent signals to a data logger (CR1000, Campbell Scientific Inc., UK) and a multiplexer (AM16/32, Campbell Scientific Inc., UK). Data was collected every 30 seconds, averaged and recorded every 6 minutes during the experiment.
Stomatal conductance and leaf water potential measurements were performed for a number of leaves on GDC grapevines. , 2 was measured on three days, at noon, on two fully developed, nonsenescent leaves, taken from both sides of the row, using a porometer instrument (AP4, Delta-T Devices, Cambridge, UK). Right after, leaves were cut and introduced in a pressure chamber (Soilmoisture Corp., Santa Barbara, CA, USA) to measure bulk leaf water potential ( ). Measurements of were also performed on three days at pre-dawn, in order to estimate soil water status at the beginning of the day, assuming that represents at equilibrium.

V. Development of the leaf energy balance equation
First, we describe in this section energy balance equations of a planar single leaf whom adaxial (upper) surface is exposed to sky and abaxial (lower) surface is exposed to the soil. Then, we extend the single leaf's equations to take into account the mutual effects of surrounding leaves on its energy balance.

Energy balance of a single leaf
An individual plant leaf gains merely all its energy within both the visible (PAR) shortwave band (400-700 nm) and the infra-red short (NIR) and thermal (TIR) wave bands (respectively 780-3000 nm and 3000-15000 nm). This leaf loses energy by forms of a thermal irradiance within the TIR band, and may further lose energy as a consequence of water evaporation and heat conduction and convection between its surface and surrounding turbulent air masses.
Under the steady state conditions of constant irradiance, air temperature, wind speed and leaf orientation, the gains and losses of energy equilibrate and the energy balance equation of a single leaf at equilibrium writes (Gutschick, 2016): 0 = + + + + + − − − − − ± (Eq. S1) where + and + are energy gains respectively in the PAR and NIR wave bands, + and − are respectively energy gain and loss in the TIR wave band, − is energy loss accompanying transpiration , is energy exchange by heat convection and finally is the energy storage by the leaf. All of the aforementioned energy terms are expressed in units of energy flux density per unit leaf surface area, commonly given in −2 .
Energy input in the shortwave bands PAR and NIR depends on the leaf's spectral properties: absorptance ( ), reflectance ( ) and transmittance ( ); the three being related ( = 1 − − ). Energy input writes: where represents the lumped leaf absorptance in the shortwave band. Its value ranges typically from 0.4 to 0.6 (Nobel, 2005).
Energy exchange in the TIR waveband depends weakly on leaf spectral properties, as leaves allows roughly no energy transmittance in this band, while it reflects at most 4% of incident TIR energy fluxes (Nobel, 2005). However, TIR energy exchange becomes heavily dependent on leaf water content which is the dominant TIR-active molecule determining object's emissivity ( ), equal to its absorptivity, in the TIR band. From the Stefan-Boltzmann law for thermal radiation writes: where is leaf reflectance in the TIR band, , and are emissivities/absorptivities of the leaf, sky and soil, respectively, and and are respectively the absolute temperatures of the sky and soil [ ]. In the above equation, TIR energy loss occurs from both surfaces of the leaf (2 4 ) while it is assumed that sky input ( 4 ) and soil input ( 4 ) are attributed to adaxial and abaxial surfaces, respectively, in the absence of transmittance.
Regarding the energy loss due to water transpiration, this term writes: where is latent heat for vaporization [ −1 ].
The energy exchange by conduction-convection can be deduced from Fick's first law: where is the thermal conductivity coefficient of air [ −1 −1 ].
Finally, the energy storage term is englobes the energy used by the metabolic reactions within the leaf and the energy stored because of changes in leaf temperature. This term is negligible since both phenomena produce energy changes that are account for less than 1% of the sole gain of energy in the shortwave band (Nobel, 2005). It is hence assumed in this work that equals 0. Combining equations S1 to S6 yields the following general equation for energy balance of a single leaf:

Energy balance of a leaf inside a canopy
Leaf positioning inside the canopy affects its energy input, both in the visible and infrared wave bands. Energy exchange between leaves can be accounted for by the radiosity method, or using one of its derivatives as for the nested radiosity employed by the Caribu light interception model (Chelle et al., 1998).
The incident energy on an individual leaf within a canopy comes from direct sources (sun, sky and clouds) and from energy that has been scattered by the surrounding elements (typically plant shoots and soil). Both direct and scattered energy are weighted by their solid angle that subtends the the leaf in question: where is the incident energy reaching the leaf , + 0 and − 0 are form factors proportions of the solid angles of direct energy sources reaching respectively the adaxial (denoted +) and abaxial ( −) surfaces, + 0 and − 0 are energy flux densities reaching + and −, respectively, + and − are two hemispheres covering + and −, respectively, is the scattered energy coming from a leaf , and finally is the form factor defined as: where is the angle between the normal to the leaf 's surface, , and the the direction ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ , is the angle between the normal to leaf 's surface and the direction ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ , () is a binary function whose output is 1 when no occlusion occurs between and , otherwise it yields 0. Equations S8 and S9 apply to energy fluxes in both visible and infrared bands. Applying the appropriate changes to Eq.S7 yields the general equation for energy balance of an individual leaf inside a canopy: where the indice has been added to distinguish the parameters specific to the leaf in question.