Appendix 1: Direct Shortwave Radiation Incident on the Ground and Walls
To obtain the direct shortwave radiation incident on the ground and walls, the shadow lengths due to walls and trees are computed by introducing points where the ray being tangent to the tree crowns intersects the horizontal (ground) and vertical (wall) axes (Fig. 10). The point (\(x_0\), \(y_0\)) where the ray passing the upper corner of the opposite wall intersects the ground (\(x_0\)) or the wall (\(y_0\)) is
$$\begin{aligned} x_0&= \text {max } [1 - h \xi , 0], \end{aligned}$$
(29a)
$$\begin{aligned} y_0&= \text {max } [h - 1/\xi , 0]. \end{aligned}$$
(29b)
The four points delimiting the tree shadow from the sunlit ground are
$$\begin{aligned} x_1&= \text {max } [d - h \xi - a \sqrt{1 + \xi ^2}, 0], \end{aligned}$$
(30a)
$$\begin{aligned} x_2&= \text {max } [d - h \xi + a \sqrt{1 + \xi ^2}, 0], \end{aligned}$$
(30b)
$$\begin{aligned} x_3&= \text {max } [ 1 - d - h \xi - a \sqrt{1 + \xi ^2}, 0], \end{aligned}$$
(30c)
$$\begin{aligned} x_4&= \text {max } [ 1 - d - h \xi + a \sqrt{1 + \xi ^2}, 0]. \end{aligned}$$
(30d)
The four points delimiting the tree shadow from the sunlit walls are
$$\begin{aligned} y_1&= \text {max } [h - (1 - d)\xi ^{-1} - a \sqrt{1 + \xi ^{-2}}, 0], \end{aligned}$$
(31a)
$$\begin{aligned} y_2&= \text {max } [h - (1 - d)\xi ^{-1} + a \sqrt{1 + \xi ^{-2}}, 0], \end{aligned}$$
(31b)
$$\begin{aligned} y_3&= \text {max } [h - d\xi ^{-1} - a \sqrt{1 + \xi ^{-2}}, 0], \end{aligned}$$
(31c)
$$\begin{aligned} y_4&= \text {max } [h - d\xi ^{-1} + a \sqrt{1 + \xi ^{-2}}, 0]. \end{aligned}$$
(31d)
Note that the points above are labelled to satisfy the conditions: \(x_1 < x_2 < x_3 < x_4\) and \(y_1 < y_2 < y_3 < y_4\). Then, the shadow lengths on the ground due to Tree 1 and Tree 2, \(\chi _{\text {Tree 1}}\) and \(\chi _{\text {Tree 2}}\), respectively, are
$$\begin{aligned} \chi _{\text {Tree 1}}&= x_2 - x_1, \end{aligned}$$
(32a)
$$\begin{aligned} \chi _{\text {Tree 2}}&= x_4 - x_3. \end{aligned}$$
(32b)
Similarly, the shadow lengths on the wall due to Tree 1 and Tree 2, \(\eta _{\text {Tree 1}}\) and \(\eta _{\text {Tree 2}}\), respectively, are
$$\begin{aligned} \eta _{\text {Tree 1}}&= y_4 - y_3, \end{aligned}$$
(33a)
$$\begin{aligned} \eta _{\text {Tree 2}}&= y_2 - y_1. \end{aligned}$$
(33b)
In the case when Tree 1 is shaded by the wall, the interception is considered as follows,
$$\begin{aligned} \varDelta = \text {max } [x_2 - x_0, 0]. \end{aligned}$$
(34)
The total shadow length on the ground, \(\chi _{\text {shadow}}\), is
$$\begin{aligned} \chi _{\text {shadow}} = {\left\{ \begin{array}{ll} 1 - \text {min } [x_0, x_3] + \chi _{\text {Tree 1}} - \varDelta &{} \quad \text {if } x_0 < x_4 \\ 1 - x_0 + \chi _{\text {Tree 1}} + \chi _{\text {Tree 2}} &{} \quad \text {if } x_0 \ge x_4. \end{array}\right. } \end{aligned}$$
(35)
Table 4 View factors for three sites, which are obtained from Monte Carlo simulations
The shadow length on the ground due to the trees, \(\chi _{\text {tree}}\), is
$$\begin{aligned} \chi _{\text {tree}} = {\left\{ \begin{array}{ll} \chi _{\text {Tree 1}} - \varDelta &{} \quad \text {if } x_0 < x_3 \\ \chi _{\text {Tree 1}} + x_0 - x_3 &{} \quad \text {if } x_3 \le x_0 < x_4 \\ \chi _{\text {Tree 1}} + \chi _{\text {Tree 2}} &{} \quad \text {if } x_0 \ge x_4. \end{array}\right. } \end{aligned}$$
(36)
The total shadow length on the wall, \(\eta _{\text {shadow}}\), is computed as follows,
$$\begin{aligned} \eta _{\text {shadow}} = {\left\{ \begin{array}{ll} \text {max } [y_0, y_1, y_2, y_3, y_4] &{} \quad \text {if } y_3 \le \eta _{\text {lowest}} \\ \eta _{\text {Tree 1}} + \eta _{\text {lowest}} &{} \quad \text {if } y_3 > \eta _{\text {lowest}}, \end{array}\right. } \end{aligned}$$
(37)
where \(\eta _{\text {lowest}}\) is \(\text {max }[y_0, y_2]\). The shadow length on the wall due to the trees when \(y_3\) is greater than \(\eta _{\text {lowest}}\) is
$$\begin{aligned} \eta _{\text {tree}} = {\left\{ \begin{array}{ll} \eta _{\text {Tree 1}} + y_2 - y_0 &{} \quad \text {if } y_2 > y_0 \\ \eta _{\text {Tree 1}} &{} \quad \text {if } y_2 \le y_0 \\ \eta _{\text {Tree 1}} + \eta _{\text {Tree 2}} &{} \quad \text {if } y_1 > y_0. \end{array}\right. } \end{aligned}$$
(38)
When \(y_3\) is less than or equal to \(\eta _{\text {lowest}}\), \(\eta _{\text {tree}}\) is
$$\begin{aligned} \eta _{\text {tree}} = {\left\{ \begin{array}{ll} y_4 - y_0 &{} \quad \text {if } y_2 > y_0 \\ 0 &{} \quad \text {if } y_2 \le y_0. \end{array}\right. } \end{aligned}$$
(39)
Appendix 2: View Factors
The view factors obtained from Monte Carlo simulations and simple relations to estimate them are introduced in this appendix. Monte Carlo methods are useful in complex geometries, where analytical approaches are not practical. Here, we use an algorithm that takes into account trees in an urban canyon, developed by Wang (2014), for computing view factors. Wang (2014) showed that the view factors obtained from Monte Carlo simulations are fairly accurate compared to analytical solutions for a two-dimensional canyon without trees. Unlike the cases in Wang (2014), we consider two symmetrical trees in the urban canyon. Table 4 lists the view factors for the three Basel sites. It should be noted that several view factors are computed as a residual to ensure energy conservation. The radiation leaving from a surface should be conserved, so that the sum of all view factors for a surface is unity.
However, the sum of all view factors from Monte Carlo simulations is not exactly unity because of the finite number of rays that are traced and of other minor simplifications in the computations. Here, the sky-view factor (\(\psi _{\text {wall} \rightarrow \text {sky}}\)) and ground-view factor (\(\psi _{\text {wall} \rightarrow \text {ground}}\)) for the wall are computed as a residual. Because they are geometrically identical to each other, they both must be equal to \((1 - \psi _{\text {wall} \rightarrow \text {wall}} - \psi _{\text {wall} \rightarrow \text {tree}})/2\).
For use in numerical weather models as an urban parametrization scheme however, performing Monte Carlo simulations for every single city (or study area targeted) is not feasible. Thus, in this study, we propose a simple method of estimating view factors using relations with canyon aspect ratio and tree-crown size. This method enables us to obtain view factors without performing a Monte Carlo simulation as long as the canyon aspect ratio and tree-crown size are known. Figure 11 shows the view factors among sky, ground, wall, and trees as a function of canyon aspect ratio, which are obtained from the Monte Carlo simulations. Overall, the view factors show fairly good linear relationships with canyon aspect ratio, as well as tree-crown size (Fig. 12). The view factors also vary linearly with tree height, but the effect of this parameter is very weak and can be omitted (Fig. 13). Based on these relations obtained through Monte Carlo simulations, we can estimate view factors using the linear relationships with canyon aspect ratio and tree-crown size, with an assumption that the two variables independently control the view factors. The regression analyses are performed using the sensitivity tests in Sect. 4. Therefore, the tree-crown radius for the regression of canyon aspect ratio is set to the value of the baseline (0.1) and the canyon aspect ratio for the regression of tree-crown radius is set to 0.75. First, view factors are estimated using the linear relationship between view factors and canyon aspect ratio, assuming that the tree-crown radius is 0.1. Then, the estimated view factors (first guess) are modified using the relationship with tree-crown size. The estimates in parenthesis are also listed in Table 4. For example, the ground sky view factor for the Urban 1 site, the value of the first guess is 0.4085 (obtained using \(y = -0.2462x + 0.6060\), where \(x = 0.8022\)). Then, this value is adjusted using the slope of tree-crown size and ground sky-view factor line (\(-1.1568\)) as follows: \(0.4085 - 1.1568(a - 0.1)\), where a is 0.0824, the tree-crown ratio for the Urban 1 site. As can be seen, the differences with the more accurate Monte Carlo results are small in general. Because this assumption does not account for some other interactions between the two variables and others (such as tree height), there must be errors (or differences) between the actual values obtained from Monte Carlo simulations and estimates. However, the differences in heat fluxes resulting from the errors (differences) are very small. We conducted additional simulations using the estimated view factors for the three Basel sites, and the difference in heat fluxes is less than \(\approx \)4 W m\(^{-2}\) (not shown). Therefore, these linear regressions can be useful for estimating view factors with trees when conducting Monte Carlo simulations is not feasible. All the needed equations are provided in Figs. 11 and 12.