1 Introduction

There is a growing need to represent urban areas accurately in weather and climate models, in order to improve predictions of both the conditions experienced by city residents and the interaction with the atmosphere above (Baklanov et al. 2018). In the case of radiative transfer, the complexity of urban surfaces presents a significant computational challenge. The computationally fastest one-dimensional (1D) urban canopy radiation schemes make many assumptions, typically assuming a single infinitely long street canyon of fixed height and width, in vacuum (e.g. Masson 2000; Harman et al. 2004). At the other extreme are three-dimensional (3D) models that represent an explicit urban geometry via ray tracing, with the capability to treat urban vegetation and atmospheric effects (e.g. Gastellu-Etchegorry 2008; Lindberg et al. 2008). Three-dimensional models can be used to evaluate 1D schemes, but are far too slow and memory-hungry to incorporate into a weather or climate model.

Given the importance of urban vegetation for the neighbourhood energy balance (Grimmond et al. 2010) and the need to represent height variations within the urban canopy (Yang and Li 2015), intermediate-complexity models have been developed that represent buildings of different height (Schubert et al. 2012), street trees (Redon et al. 2017) or both (Krayenhoff et al. 2014). However, it is questionable whether they have struck the right balance between complexity and computational cost: all three models mentioned above still make the poor assumption of an infinitely long street canyon (see Hogan 2019), while one (Krayenhoff et al. 2014) uses the computationally expensive ray-tracing approach.

In this paper we propose a new framework to represent solar (hereafter ‘shortwave’) and thermal-infrared (hereafter ‘longwave’) radiative transfer in complex urban canopies. It is underpinned by the 1D discrete-ordinate method (e.g. Stamnes et al. 1988), in which a set of coupled ordinary differential equations is written for 2N streams of radiation travelling at different zenith angles, plus one for the direct solar beam in the shortwave. The equations are solved exactly for a multi-layer description of the urban canopy. Virtually all atmospheric radiation schemes used in weather and climate models are based on the two-stream discrete-ordinate method (i.e. one upwelling and one downwelling irradiance).

To represent buildings and vegetation, we use the SPARTACUS (SPeedy Algorithm for Radiative TrAnsfer through CloUd Sides) approach, which has previously been used to represent 3D radiative effects associated with clouds (Hogan et al. 2016) and forests (Hogan et al. 2018). The new ‘SPARTACUS-Urban’ scheme divides each layer of the urban canopy into a clear-air and vegetated region, and terms are added to the differential equations to represent the rates of lateral exchange of radiation between regions, and the rate at which radiation intercepts building walls. Previous SPARTACUS implementations used only two streams but here we improve the accuracy by generalizing to 2N streams. Our approach has the following advantages over previous 1D urban radiation schemes:

  • Realistic urban geometry Rather than explicitly solving for a specific urban geometry, which is only tractable for very simplistic building layouts, we take a more statistical approach. Hogan (2019) found that the probability distribution of horizontal wall-to-wall separations in real cities is well fitted by an exponential distribution, which leads to much better predictions of radiative exchange than for the infinite street canyon. This result is perfectly suited to incorporation into a discrete-ordinate model, since it predicts that radiation travelling at a particular zenith angle is attenuated by buildings according to the Beer–Lambert law, in the same way as radiation propagating in a turbid atmosphere.

  • Complex vegetation Hogan et al. (2018) have already validated the SPARTACUS approach for representing 3D shortwave interaction with trees, including the capability to represent crown heterogeneity. The present scheme can be thought of as an extension of that proposed by Hogan et al. (2018) to include buildings.

  • Atmospheric absorption, emission, and scattering It is ubiquitous in current urban radiation models to treat the space between buildings as a vacuum, but this is a poor assumption in a significant fraction of the longwave spectrum where the mean free path of the radiation can be less than the building separation. We quantify the importance of longwave absorption and emission by coupling the new scheme to the gas-optics model of an atmospheric radiation code.

  • Coupling to the free atmosphere Care has been taken to formulate the scheme to enable it to be coupled consistently with an atmospheric radiation scheme, specifically ‘ecRad’ (Hogan and Bozzo 2018). This coupling is done to ensure that exactly the same spectral intervals are used in the urban canopy as in the atmosphere above, if required.

Sections 2 and 3 provide a detailed description of the method in the shortwave and longwave, respectively. In Sect. 4 various aspects of the scheme are evaluated against existing methods for canopies with a simplistic vertical structure. In Sect. 5 the importance of longwave atmospheric effects in urban canopies is quantified using the new model. Finally, Sect. 6 discusses how the scheme could be extended in future, for example to represent pitched roofs. Note that evaluation against fully 3D calculations for real urban scenes with complex vertical structure will be the subject of a future paper.

2 Shortwave Method

This section defines numerous symbols; for convenience, those that appear in more than one equation are listed in Appendix 1.

2.1 Definition of Regions and Streams

The treatment of radiation in vegetated urban areas takes as its starting point the SPARTACUS approach for treating 3D structures that has previously been used for clouds and forests. As illustrated in Fig. 1, we divide the canopy vertically into layers and horizontally into regions. Radiation is modelled in clear-air region a and vegetated region v, while building region b is impermeable to radiation. It is straightforward to extend this to more regions, for example to represent vegetation of different densities (Hogan et al. 2018), or alternatively to neglect vegetation completely. SPARTACUS then assumes that the rate of radiation exchange between permeable regions, and the rate at which radiation intercepts building walls, is proportional to the area of the vertical interface between these regions. As shown in Fig. 1a, all surfaces are currently assumed to be either horizontal or vertical, but the statistical description in SPARTACUS can accommodate different parts of the same building having different heights, and individual tree crowns whose width varies with height.

In the shortwave part of the spectrum, the ‘direct’ (i.e. unscattered) radiation at a particular height in the urban canopy is described by a vector containing one irradiance component for each permeable region,

$$\begin{aligned} {\mathbf {s}}=\left( \begin{array}{c} s^a\\ s^v \end{array}\right) , \end{aligned}$$
(1)

where these are irradiances into a plane oriented perpendicular to the sun. To convert into a horizontal plane they should be multiplied by \(\mu _0\), the cosine of the solar zenith angle \(\theta _0\). Note that irradiances here are for one particular spectral interval and multiple calculations are required to integrate over the full spectrum to account for spectral variations in surface and atmospheric properties.

To describe the diffuse radiation field, previous SPARTACUS implementations used the two-stream method in which one number (the irradiance into a horizontal plane) was used to describe the diffuse radiation in each hemisphere. As will be shown in Sect. 4, we have found that two streams are insufficient to capture the exchange of diffuse radiation between the street, walls, and sky of an urban area, so we generalize SPARTACUS to 2N streams such that the diffuse radiation field in each hemisphere is described by radiation travelling in N discrete directions. Thus, the upwelling diffuse radiation at a particular height in the urban canopy is described by a vector, which for the four-stream (\(N=2\)) case is given by \({\mathbf {u}}=(\begin{array}{cccc} u^a_1&~u^a_2&~u^v_1&~u^v_2 \end{array})^\mathrm {T}\), where \(u^i_k\) is the irradiance component in region i due to radiation travelling in discrete direction k. The mean upwelling irradiance is obtained simply by summing the elements of \({\mathbf {u}}\). An analogous vector \({\mathbf {v}}\) describes downwelling diffuse radiation. The blue arrows in Fig. 1b depict the one direct and four diffuse streams in region a in the case of \(N=2\).

Fig. 1
figure 1

Illustration of how the features of a real urban neighbourhood can be represented in SPARTACUS-Urban. a Buildings and trees in a \(1\hbox { km}\times 1\hbox { km}\) area of London centred on \(51.519^\circ \hbox {N}\), \(0.123^\circ \hbox {W}\). The buildings are shown with vertical walls and flat roofs, consistent with the assumptions in the current version of the scheme. SPARTACUS-Urban approximates the horizontal building layout statistically by the exponential model of Hogan (2019). b Illustration of how the neighbourhood could be divided into layers and regions within SPARTACUS. Radiation is allowed to penetrate into the clear (white) and vegetated (green) regions, but not the buildings (red). Consistent with most atmospheric radiation schemes, we use a depth coordinate increasing down from canopy top, and likewise index the layers starting at 1 in the uppermost layer, because it is then a little easier to ensure numerical stability with sunlight originating at canopy top (\(z=0\)) and decreasing exponentially with increasing z. The blue arrows indicate the discrete radiation directions used in a four-stream shortwave scheme, while the black arrows labelled \(f^{aw}\) and \(f^{av}\) denote the rate at which clear-air radiation intercepts building walls, and passes into the vegetation region, respectively. Symbols are defined in Appendix 1

Following Sykes (1951) and Stamnes et al. (1988), and indeed most multi-stream radiation schemes, we choose the discrete angles using ‘double-Gauss’ quadrature, in which the cosine of the zenith angle, \(\mu \), is discretized using Gaussian quadrature separately in the ranges \(-1<\mu <0\) (upwelling streams) and \(0<\mu <1\) (downwelling streams). For a 2N-stream scheme the discrete zenith angles in one hemisphere are written as \(\theta _1\) to \(\theta _{N}\), and their cosines as \(\mu _1\) to \(\mu _{N}\). In the equations used herein, all \(\mu _k\) terms are treated as positive in both the upwelling and downwelling hemispheres. Each quadrature point is assigned a weight \(w_k\), dictated by the rules of Gaussian quadrature, with the weights summing to unity. In Sect. 4 we examine how the error decreases as N is increased.

2.2 Formulation of Differential Equations

SPARTACUS formulates the 1D shortwave radiative transfer problem as a set of coupled ordinary differential equations written in matrix form (Hogan et al. 2016),

$$\begin{aligned} \frac{\mathrm {d}}{\mathrm {d}z}\left( \begin{array}{c} {\mathbf {u}} \\ {\mathbf {v}} \\ {\mathbf {s}} \end{array} \right) = \varvec{\Gamma }\left( \begin{array}{c} {\mathbf {u}} \\ {\mathbf {v}} \\ {\mathbf {s}} \end{array} \right) , \end{aligned}$$
(2)

where z is defined as height measured down from the top of the canopy as shown by the vertical axis in Fig. 1b. In this convention, which matches that in most atmospheric radiation schemes, sunlight originates from the top of the canopy (\(z=0\)) and decreases with increasing z. The exchange matrix \(\varvec{\Gamma }\) may be written in terms of five component matrices,

$$\begin{aligned} \varvec{\Gamma }=\left( \begin{array}{rrr} -\varvec{\Gamma }_1 &{} -\varvec{\Gamma }_2 &{} -\varvec{\Gamma }_3 \\ \varvec{\Gamma }_2 &{} \varvec{\Gamma }_1 &{} \varvec{\Gamma }_4 \\ &{} &{} \varvec{\Gamma }_0 \end{array}\right) . \end{aligned}$$
(3)

The subscripts of the component matrices follow those of the analogous \(\gamma _0\)\(\gamma _4\) coefficients used in conventional two-stream radiation schemes (Meador and Weaver 1980), rather than the indices of zenith angles \(\theta _k\).

The \(\varvec{\Gamma }_0\) matrix describes the rate at which direct downwelling radiation changes along its path and may be expressed as the sum of two component matrices (Hogan et al. 2018),

$$\begin{aligned} \varvec{\Gamma }_0= \left( \begin{array}{cc} -f_0^{av} &{} +f_0^{va}\\ +f_0^{av} &{} -f_0^{va} \end{array}\right) + \left( \begin{array}{cc} e^a_{0} \\ &{}e^v_{0} \end{array}\right) . \end{aligned}$$
(4)

The first component matrix represents exchange of radiation between regions. The \(f^{ij}_k\) coefficients express the rate at which radiation in the angle indexed k (where \(k=0\) indicates direct radiation) is transferred from region i to region j, per unit vertical distance travelled, and is given by

$$\begin{aligned} f^{ij}_k=\frac{L^{ij}|\tan \theta _k|}{{\varvec{\uppi }} c^i}, \end{aligned}$$
(5)

where \(c^i\) is the fractional area of the domain covered by region i, and \(L^{ij}\) is the normalized perimeter length, i.e. the length of the interface between regions i and j per unit area of the horizontal domain. The modulus of the tangent is required to ensure that \(f_k^{ij}\) is positive for upwelling streams (when \(\theta _k>90^\circ \)). The second component matrix in (4) represents extinction of the direct beam due to scattering and absorption by the air, leaves or building walls, and its elements are given by

$$\begin{aligned} e_k^i=-\sigma ^i/\mu _k -f^{iw}_k(1-\alpha ^w p^w), \end{aligned}$$
(6)

where \(\sigma ^i\) is the volume extinction coefficient of region i representing scattering and absorption by the air and/or leaves, and \(f^{iw}_k\) represents the rate of radiation interception by the building walls, which may be represented in the same form as (5) but with \(L^{iw}\) being the building perimeter length surrounding region i per unit area of the domain. If reflection from the building walls has a specular component, appropriate for buildings with a glass facade, then the specularly reflected light would retain its original zenith angle and is therefore best treated as remaining in the same stream, i.e. not being scattered at all. Thus (6) reduces the building interception term by a factor \(1-\alpha ^w p^w\), where \(\alpha ^w\) is the albedo of the wall and \(p^w\) the fraction of that reflection that is specular.

If we neglect vegetated regions for the moment, then the near-surface value of \(L^{aw}\) may be derived from building polygon data: if a horizontal area A of a city contains buildings with a total perimeter length L then \(L^{aw}=L/A\). At a particular height in the urban canopy we consider only the perimeter of buildings of at least that height, so both L and \(L^{aw}\) decrease with height. Other length scales have been used in the literature to characterize building horizontal scale and separation, and can be used to estimate \(L^{aw}\). Most common is the typical street width, W: under the assumption that the urban canopy is composed of infinite streets all of width W, the total length of street in a domain of horizontal area A is \(L_\mathrm {street}=(1-c^b)A/W\), where \(c^b\) is the fractional horizontal area of the domain occupied by buildings (denoted as \(\lambda _p\) by Grimmond and Oke 1999). Since each street has two walls, \(L=2L_\mathrm {street}\), and hence

$$\begin{aligned} L^{aw}=2(1-c^b)/W. \end{aligned}$$
(7)

(A small modification is needed if a certain known fraction of the vegetation perimeter is in contact with building walls, or close enough that any radiation emerging from the vegetation immediately strikes a wall.) Hogan (2019) showed that for the purposes of radiative transfer, the infinite-street assumption is a poor fit to real cities; he found that the distribution of wall-to-wall horizontal separation distances in real cities (considering all azimuth angles) is well approximated by an exponential distribution, and described a method to estimate the e-folding separation distance, X, from building polygon data. If the distribution is a perfect exponential then X is also the mean wall-to-wall horizontal separation distance. Combining his equations 23 and 25 leads to \(W=2X/\uppi \), and hence

$$\begin{aligned} L^{aw}=\uppi (1-c^b)/X. \end{aligned}$$
(8)

As shown in Sect. 4.1, the Hogan (2019) exponential model of urban geometry is fully consistent with SPARTACUS-Urban since solutions to (2) predict the intensity of radiation propagating in a particular direction to vary exponentially with distance.

The \(\varvec{\Gamma }_1\) matrix in (3) represents the rate at which diffuse radiation changes along its path and is given by three component matrices,

$$\begin{aligned} \varvec{\Gamma }_1 = \left( \begin{array}{cccc} -f_1^{av} &{}&{} +f_1^{va} \\ &{} -f_2^{av} &{}&{} +f_2^{va} \\ +f_1^{av} &{}&{} -f_1^{va} \\ &{} +f_2^{av} &{}&{} -f_2^{va} \end{array}\right) + \left( \begin{array}{cccc} e_{1}^a &{} \\ &{} e_{2}^a \\ &{} &{} e_{1}^v \\ &{} &{} &{} e_{2}^v \\ \end{array}\right) +\varvec{\Gamma }_2. \end{aligned}$$
(9)

The \(f^{ij}_k\) terms again represent exchange between regions and are given by (5). The \(e^i_k\) terms in the second component matrix again represent loss due to scattering and absorption by the air, leaves or building walls, and are given by (6). The third component matrix describes the rate at which diffuse radiation is scattered, either by the air in the canopy or the walls, into other diffuse streams. If we assume that, after accounting for specular reflection from the walls, the scattering is isotropic, then this term is equal for radiation scattered into the upward and downward streams, so is equal to \(\varvec{\Gamma }_2\) in (3) and is given by

$$\begin{aligned} \varvec{\Gamma }_2=\left( \begin{array}{cccc} e_{11}^a &{} e_{21}^a \\ e_{12}^a &{} e_{22}^a \\ &{} &{} e_{11}^v &{} e_{21}^v \\ &{} &{} e_{12}^v &{} e_{22}^v \\ \end{array}\right) , \end{aligned}$$
(10)

where the \(e^i_{kl}\) terms express the rate at which radiation in region i and stream k is scattered into stream l in either the same or the opposite hemisphere, given by

$$\begin{aligned} e_{kl}^i = \frac{w_l\sigma ^i\omega ^i}{2\mu _k} +\frac{v_lf^{iw}_k\alpha ^w(1-p^w)}{2}. \end{aligned}$$
(11)

The two terms mirror those in (6): the first represents isotropic scattering by the air or leaves, where \(\omega ^i\) is the single scattering albedo of region i, while the second represents non-specular scattering by walls (the \(1-p^w\) term removing the specular fraction). Both terms are divided by two since radiation is assumed to scatter equally into the two hemispheres. The second term uses a weighting appropriate for vertical surfaces given by

$$\begin{aligned} v_l=w_l\sin \theta _l\Big /\sum _{j=1}^Nw_j\sin \theta _j. \end{aligned}$$
(12)

This weighting assumes that non-specular scattering by the walls is Lambertian, which leads to the \(\sin \theta _l\) dependence since the radiation emitted by a small element of a vertical plane towards a viewer is proportional to the angle subtended by the element at the viewer, which varies as \(\sin \theta _l\). The summation on the denominator ensures energy conservation. The final two matrices in (3), \(\varvec{\Gamma }_3\) and \(\varvec{\Gamma }_4\), represent scattering from the direct beam into the upward and downward streams, respectively. In the case of isotropic scattering by air and leaves they are equal and given by

$$\begin{aligned} \varvec{\Gamma }_3=\varvec{\Gamma }_4=\mu _0\left( \begin{array}{cc} e_{01}^a \\ e_{02}^a \\ &{} e_{01}^v \\ &{} e_{02}^v \\ \end{array}\right) , \end{aligned}$$
(13)

where the elements are given by (11).

Fig. 2
figure 2

The main steps in the SPARTACUS-Urban shortwave and longwave solvers in the case of a two-layer representation of the urban canopy, where the shaded boxes indicate the main variable or variables involved, and the numbered steps are referred to in the text

2.3 Solving the Equations for a Single Layer

Figure 2 depicts the steps in the SPARTACUS-Urban solver. The first step is to solve (2) for each individual layer j, computing the following matrices from \(\varvec{\Gamma }\):

  • \({\mathbf {R}}_j\) is the diffuse reflectance matrix such that if the layer is illuminated from above by diffuse radiation \({\mathbf {v}}_{j-1/2}\) only, then the reflected radiation due to scattering within the layer is \({\mathbf {u}}_{j-1/2}={\mathbf {R}}_j{\mathbf {v}}_{j-1/2}\). As shown in Figs. 1b and 2, half indices indicate properties defined at the interface between layers.

  • \({\mathbf {T}}_j\) is the diffuse transmittance matrix such that diffuse illumination from above leads to the transmitted radiation exiting the base of the layer being \({\mathbf {v}}_{j+1/2}={\mathbf {T}}_j{\mathbf {v}}_{j-1/2}\).

  • \({\mathbf {E}}_j\) is the direct transmittance matrix such that if the layer is illuminated from above by direct radiation \({\mathbf {s}}_{j-1/2}\) only, then the direct radiation emerging from the base is \({\mathbf {s}}_{j+1/2}={\mathbf {E}}_j{\mathbf {s}}_{j-1/2}\).

  • \({\mathbf {S}}_j^+\) and \({\mathbf {S}}_j^-\) describe the scattering of the direct beam such that for the same direct-only illumination from above, \({\mathbf {u}}_{j-1/2}={\mathbf {S}}_j^+{\mathbf {s}}_{j-1/2}\) is the upward diffuse radiation emerging from the top of the layer and \({\mathbf {v}}_{j+1/2}={\mathbf {S}}_j^-{\mathbf {s}}_{j-1/2}\) is the downward diffuse radiation emerging from the base.

There are generally three methods for computing these matrices. The doubling method (e.g., Thomas and Stamnes 1999) is conceptually straightforward and numerically stable, but computationally expensive. The matrix-exponential method (e.g., Flatau and Stephens 1998; Hogan et al. 2016) is computationally faster but becomes numerically unstable if the optical depth of the layer along any of the discrete angles is too large. We therefore prefer the eigendecomposition method (e.g., Stamnes et al. 1988), which is both fast and numerically stable. Appendix 2 describes how this method is used to derive the matrices above.

2.4 Computing the Albedo Profile

Here we describe steps 2–4 of Fig. 2 in which we pass up through the layers of the canopy computing the albedo of the entire scene below each layer interface. Although this is similar to Sect. 2.6 of Hogan et al. (2018), it is complicated by the use of more than two streams and the variation of building and vegetation cover with height. We define matrix \({\mathbf {A}}_{j+1/2}\) as the albedo to diffuse downwelling radiation (i.e. the white-sky albedo) of the scene below interface \(j+1/2\) (including the surface contribution), and matrix \({\mathbf {D}}_{j+1/2}\) as the corresponding albedo to direct radiation (i.e. black-sky albedo). They are defined such that the upwelling irradiances at this interface are equal to the sum of the reflected downwelling diffuse and direct irradiances,

$$\begin{aligned} {\mathbf {u}}_{j+1/2}={\mathbf {A}}_{j+1/2}{\mathbf {v}}_{j+1/2}+{\mathbf {D}}_{j+1/2}{\mathbf {s}}_{j+1/2}. \end{aligned}$$
(14)

At the surface (interface \(n+1/2\) for an n-layer description of the canopy), these matrices have the following forms (for \(N=2\) and two regions; step 2 of Fig. 2),

$$\begin{aligned} {\mathbf {A}}_{n+1/2}&=\left( \begin{array}{cccc} \alpha ^a h_1 &{} \alpha ^a h_1 \\ \alpha ^a h_2 &{} \alpha ^a h_2 \\ &{} &{} \alpha ^v h_1 &{} \alpha ^v h_1 \\ &{} &{} \alpha ^v h_2 &{} \alpha ^v h_2 \end{array}\right) , \end{aligned}$$
(15)
$$\begin{aligned} {\mathbf {D}}_{n+1/2}&=\mu _0\left( \begin{array}{cc} \alpha ^a h_1 \\ \alpha ^a h_2 \\ &{} \alpha ^v h_1 \\ &{} \alpha ^v h_2 \end{array}\right) , \end{aligned}$$
(16)

where \(\alpha ^i\) is the surface albedo beneath region i (allowing for the possibility to represent trees being planted over a different surface type), and is weighted by an equivalent term to (12) but for Lambertian reflection by a horizontal surface,

$$\begin{aligned} h_l=w_l\mu _l\Big /\sum _{j=1}^N w_j\mu _j. \end{aligned}$$
(17)

The zero entries in (15) and (16) simply represent the fact that light incident on the surface beneath clear-sky is not reflected up into the vegetated region, but note that at higher levels in the canopy these these entries are not zero due to lateral exchange of radiation between regions.

To compute the albedo matrices at the top of a layer (indexed \(j-1/2\)) given the albedos at the base (indexed \(j+1/2\)) and the properties of the layer, we apply Eqs. 33 and 34 of Hogan et al. (2018),

$$\begin{aligned} {\mathbf {A}}_{j-1/2}&={\mathbf {R}}_j+{\mathbf {T}}_j{\mathbf {B}}^{-1}{\mathbf {A}}_{j+1/2}{\mathbf {T}}_j, \end{aligned}$$
(18)
$$\begin{aligned} {\mathbf {D}}_{j-1/2}&={\mathbf {S}}_j^++{\mathbf {T}}_j{\mathbf {B}}^{-1}\left( {\mathbf {D}}_{j+1/2}{\mathbf {E}}_j+{\mathbf {A}}_{j+1/2}{\mathbf {S}}_j^-\right) , \end{aligned}$$
(19)

where \({\mathbf {B}}={\mathbf {I}}-{\mathbf {A}}_{j+1/2}{\mathbf {R}}_j\). This is a form of the ‘Adding Method’ and accounts for multiple internal reflections between layer j and the layers below (step 3, Fig. 2). If the definition of the regions was the same in each layer, then we could repeat this process immediately for the layers above until we reached the top of the canopy. However, both tree area and building area tend to decrease with height (see Fig. 1b), accompanied by a corresponding increase in clear-sky area. Therefore, we need to map from the albedo defined using the regions just below the interface, \({\mathbf {A}}_{\mathrm {below\,}j-1/2}\), to the albedo defined in the regions just above the interface, \({\mathbf {A}}_{\mathrm {above\,}j-1/2}\), and similarly for \({\mathbf {D}}\). Following Hogan et al. (2016) for clouds, ‘directional overlap matrices’ are used. For downwelling radiation, overlap matrices \({\mathbf {V}}\) and \({\mathbf {W}}\) are defined such that

$$\begin{aligned} {\mathbf {v}}_\mathrm {below}&={\mathbf {V}}{\mathbf {v}}_\mathrm {above}, \end{aligned}$$
(20)
$$\begin{aligned} {\mathbf {s}}_\mathrm {below}&={\mathbf {W}}{\mathbf {s}}_\mathrm {above}, \end{aligned}$$
(21)

where subscripts ‘above’ and ‘below’ denote irradiances just above and below a layer interface. Similarly, overlap matrix \({\mathbf {U}}\) is defined such that \({\mathbf {u}}_\mathrm {above}={\mathbf {U}}{\mathbf {u}}_\mathrm {below}\). This leads to Eq. 31 of Hogan et al. (2016) mapping the diffuse albedo across layer interface \(j-1/2\), and an equivalent expression for direct albedo (step 4, Fig. 2),

$$\begin{aligned} {\mathbf {A}}_{\mathrm {above\,}j-1/2}&={\mathbf {U}}_{j-1/2} {\mathbf {A}}_{\mathrm {below\,}j-1/2}{\mathbf {V}}_{j-1/2}, \end{aligned}$$
(22)
$$\begin{aligned} {\mathbf {D}}_{\mathrm {above\,}j-1/2}&={\mathbf {U}}_{j-1/2} {\mathbf {D}}_{\mathrm {below\,}j-1/2}{\mathbf {W}}_{j-1/2}. \end{aligned}$$
(23)

A complication arises because we do not simulate radiative transfer inside buildings, so the horizontal domain of the radiation simulation (the white and green regions in Fig. 1b) varies with height. This means that some of the clear-sky region in layer \(j-1\) overlies a roof, and will ‘see’ the roof albedo, \(\alpha ^b\). To represent this, we introduce a pseudo region in the lower layer for the exposed roof area by expanding the albedo matrices as follows,

$$\begin{aligned} {\mathbf {A}}_{\mathrm {below\,}j-1/2}&=\left( \begin{array}{ccc} {\mathbf {A}}_{j-1/2}\\ &{} \alpha ^b h_1 &{} \alpha ^b h_1\\ &{} \alpha ^b h_2 &{} \alpha ^b h_2 \end{array}\right) , \end{aligned}$$
(24)
$$\begin{aligned} {\mathbf {D}}_{\mathrm {below\,}j-1/2}&=\left( \begin{array}{cc} {\mathbf {D}}_{j-1/2}\\ &{} \mu _0\alpha ^b h_1\\ &{} \mu _0\alpha ^b h_2 \end{array}\right) . \end{aligned}$$
(25)

The overlap matrices allow for arbitrary overlapping of buildings, vegetation, and clear-air in adjacent layers, but if we were to make the assumption that there are no overhanging trees or buildings, and no trees on top of buildings, then the overlap matrix for direct downwelling radiation has the form

$$\begin{aligned} {\mathbf {W}}_{j-1/2}=\left[ \begin{array}{rc} c_j^a/c_{j-1}^a \\ (c_j^v-c_{j-1}^v)/c_{j-1}^a &{} \quad 1\\ (c_j^b-c_{j-1}^b)/c_{j-1}^a \\ \end{array}\right] , \end{aligned}$$
(26)

where \(c^i_j\) is the fractional area of region i in layer j, and \(c^b_j\) represents the fractional area of buildings in layer j. The three elements in the left column of (26) describe the fraction of clear-air radiation in layer \(j-1\) that enters the clear-air, vegetation, and flat-roof regions in layer j; they sum to 1. The single non-zero element in the right column of (26) states that all radiation in the vegetated region of layer \(j-1\) enters the vegetated region of layer j. Equation 26 can represent tree crowns over a clear region near the surface by setting the extinction coefficient of the ‘vegetated’ region to zero in the lowest layers, as illustrated in the bottom-right of Fig. 1b. To represent trees overhanging buildings, the third element in the right column of (26) may be set to the fraction of the vegetated region in layer \(j-1\) that overlies a roof in layer j, with a corresponding reduction in the second element.

The overlap matrices for diffuse radiation have more elements since we have N streams in the upward and downward hemispheres for each region, but radiation remains in the same stream as it passes through an interface so the matrices are sparse. Thus, the matrix for downwelling diffuse radiation is the same as for direct, but with each element replicated for each stream,

$$\begin{aligned} {\mathbf {V}}_{j-1/2}=\left[ \begin{array}{rc} {\mathbf {I}}c_j^a/c_{j-1}^a \\ {\mathbf {I}}(c_j^v-c_{j-1}^v)/c_{j-1}^a &{} \quad {\mathbf {I}}\\ {\mathbf {I}}(c_j^b-c_{j-1}^b)/c_{j-1}^a \\ \end{array}\right] , \end{aligned}$$
(27)

where \({\mathbf {I}}\) is the \(N\times N\) identity matrix. Similarly, the matrix for upwelling diffuse radiation is given by

$$\begin{aligned} {\mathbf {U}}_{j-1/2}=\left[ \begin{array}{c@{\qquad }l@{\qquad }c} {\mathbf {I}}\quad &{} {\mathbf {I}}\left( 1-c^v_{j-1}/c^v_j\right) &{} {\mathbf {I}}\\ &{} {\mathbf {I}}c^v_{j-1}/c^v_j \end{array}\right] . \end{aligned}$$
(28)

The middle column distributes upwelling radiation in the vegetated region of layer j into the clear-air and vegetated regions of layer \(j-1\) according to the vegetation cover in each layer. The other two columns indicate that all upwelling radiation from the clear-air and flat-roof regions in layer \(j-1\) ends up in the clear-air region of layer j.

2.5 Computing the Irradiance Profile

We now have a profile of albedo matrices just above and just below each layer interface. If SPARTACUS-Urban is to be coupled to an atmospheric radiation scheme then at this point the scalar direct and diffuse albedos at canopy top (interface 1 / 2) need to be computed (step 5, Fig. 2). Applying (22) and (23) provides the albedo matrices just above interface 1 / 2, where the overlap matrices (Eqs. 2628) are defined assuming a pseudo-layer 0 representing the free atmosphere above the urban canopy; here there are no buildings or trees so \(c^v_0=c^b_0=0\) and \(c^a_0=1\). The scalar albedo of the scene to direct radiation, \(\alpha _{\mathrm {dir,scene}}\) is then simply the top-left element of \({\mathbf {D}}_{\mathrm {above\,}1/2}\). The scalar albedo to diffuse radiation, \(\alpha _{\mathrm {diff,scene}}\), is computed assuming that the downwelling diffuse radiation at the top of the urban canopy is isotropic so the streams are weighted according to (17).

As illustrated in Fig. 1 of Hogan and Bozzo (2018), an atmospheric radiation scheme takes the direct and diffuse albedos as a boundary condition and computes the full profile of irradiances through the atmosphere. The direct and diffuse downwelling irradiances at the base of the lowest atmospheric layer, i.e. at the top of the urban canopy, are passed back into SPARTACUS-Urban. The urban radiation calculations can be performed either at the same spectral resolution as the atmosphere above, or using a coarser spectral resolution according to the availability of data on the spectral dependence of material properties within the urban canopy.

The downwelling irradiances from the atmospheric radiation scheme are inserted into the clear-sky region of the irradiance vectors just above canopy top, \({\mathbf {s}}_{\mathrm {above\,}1/2}\) and \({\mathbf {v}}_{\mathrm {above\,}1/2}\) (step 6, Fig. 2), with the diffuse irradiance again being distributed isotropically into the streams using the weighting in (17). These are translated into the irradiances just below the canopy top using (20) and (21); step 7 in Fig. 2. Note that the final elements of \({\mathbf {s}}_{\mathrm {below\,}1/2}\) and \({\mathbf {v}}_{\mathrm {below\,}1/2}\) contain the irradiances incident on the flat roofs of the buildings in layer 1. Knowing the roof albedo we can therefore compute the net irradiance into this surface and pass it to an energy balance model for the roof. The roof irradiances are removed from these vectors and then Eqs. 39, 40, and 42 of Hogan et al. (2018), the downward part of the Adding Method, are applied to obtain the irradiances just above the base of the layer (step 8, Fig. 2). This process is repeated down to the surface to obtain the full irradiance profile.

In an atmospheric radiation scheme, the heating rate of each layer is proportional to the convergence of net irradiance across the layer, which is easy to compute from the irradiances at layer interfaces. In an urban canopy we wish to compute the net radiation absorbed separately by each facet and region (step 9, Fig. 2). The treatment of flat roofs is described above. For the other terms we define vector \({\mathbf {n}}_j=(\begin{array}{ccc}n^a_j&~n^v_j&~n^w_j\end{array})^\mathrm {T}\) as the net power absorbed by the air, vegetation, and walls in layer j, per unit area of the entire domain. It is computed from

$$\begin{aligned} {\mathbf {n}}_j={\mathbf {N}}_j^\mathrm {diff}\left( \hat{{\mathbf {u}}}_j +\hat{{\mathbf {v}}}_j\right) +{\mathbf {N}}_j^\mathrm {dir}\hat{{\mathbf {s}}}_j, \end{aligned}$$
(29)

where \(\hat{{\mathbf {u}}}_j\), \(\hat{{\mathbf {v}}}_j\), and \(\hat{{\mathbf {s}}}_j\) are the irradiance components vertically integrated across the layer (in \(\hbox {W m}^{-1}\)), expressions for which are given in Appendix 2. The \({\mathbf {N}}\) matrices represent the rate (in m\(^{-1}\)) at which radiation in each diffuse and direct stream is absorbed by each facet,

$$\begin{aligned} {\mathbf {N}}^\mathrm {diff}&=\left( \begin{array}{cccc} N_1^a&{}N_2^a\\ &{}&{}N_1^v&{}N_2^v\\ W_1^a&{}W_2^a&{}W_1^v&{}W_2^v \end{array}\right) , \end{aligned}$$
(30)
$$\begin{aligned} {\mathbf {N}}^\mathrm {dir}&=\left( \begin{array}{cc} N_0^a\\ &{}N_0^v\\ W_0^a&{}W_0^v \end{array}\right) . \end{aligned}$$
(31)

The rate at which radiation in stream k is absorbed in region i is \(N^i_k=\sigma ^i(1-\omega ^i)/\mu _k\), which is like the first term on the right-hand side of (6) except that rather than representing loss by extinction, it represents gain by absorption. Similarly, the rate at which radiation in region i in stream k is absorbed by walls is \(W^i_k=f_k^{iw}(1-\alpha ^w)\), which is the absorption analogue of the second term on the right-hand side of (6). Some urban energy balance models treat the sunlit and shadowed parts of the walls separately (e.g. Oleson et al. 2008), which could be accommodated by computing the direct solar heating of walls (associated with the \(W_0^i\) terms in Eq. 31) separately.

3 Longwave Method

The longwave implementation of SPARTACUS-Urban follows the general structure described by Hogan et al. (2016), which is similar to the shortwave but with the direct solar beam removed and thermal emission added. Hogan et al. (2016) allowed for a variation in temperature with height within model layers, but to simplify the problem we assume that although the temperatures of walls, vegetation, and clear-air are different from each other, they are each constant with height in individual layers. Thus the coupled differential equations may be written in matrix form as

$$\begin{aligned} \frac{\mathrm {d}}{\mathrm {d}z} \left( \begin{array}{c}{\mathbf {u}}\\ {\mathbf {v}}\end{array}\right) =\varvec{\Gamma }\left( \begin{array}{c}{\mathbf {u}}\\ {\mathbf {v}}\end{array}\right) +\left( \begin{array}{r}\mathbf {-b}\\ {\mathbf {b}}\end{array}\right) , \end{aligned}$$
(32)

where \(\varvec{\Gamma }\) is as in (3) but without the bottom row and right column of sub-matrices, and \({\mathbf {b}}\) represents the rate of thermal emission into each stream with height. The negative sign on the first \({\mathbf {b}}\) entry is because this is for upwelling radiation and z increases in a downward direction. The elements of the \(\varvec{\Gamma }_1\) and \(\varvec{\Gamma }_2\) sub-matrices of \(\varvec{\Gamma }\) are as defined in (9) and (10) except using optical properties in the longwave part of the spectrum. For \(N=2\) we have \({\mathbf {b}}=(\begin{array}{cccc}b^a_1&~b^a_2&~b^v_1&~b^v_2\end{array})^\mathrm {T}\), where the rate of emission into stream k of region i is

$$\begin{aligned} b^i_k=\frac{h_kc^i\sigma ^i(1-\omega ^i)B(T^i)}{\mu _k}+\frac{v_kL^{iw}(1-\alpha ^w)B(T^w)}{2}. \end{aligned}$$
(33)

The first term on the right-hand side of (33) represents emission by the air or vegetation, where \(T^i\) is the temperature of the emitters in region i, and B is the Planck function integrated across the spectral interval being simulated. In Sect. 5, multiple quasi-monochromatic SPARTACUS-Urban computations are combined to obtain irradiance profiles for the full longwave spectrum. The second term on the right-hand side represents emission by the walls at temperature \(T^w\). Since the emission is by a vertical surface, we use the \(v_k\) weighting of streams given by (12), but divide by two since the radiation is split between the two hemispheres. The emission rate is proportional to \(L^{iw}\), the normalized perimeter length of wall in contact with region i. In real cities, the temperature \(T^w\) of the various walls at a given height can vary substantially depending on whether a wall is sunlit or in shadow, and indeed this affects the longwave radiation field (Krayenhoff and Voogt 2016; Morrison et al. 2018). To interface SPARTACUS-Urban with urban energy-balance models that simulate more than one wall temperature, \(B(T^w)\) in (33) should be the Planck function averaged over all the walls in a given layer.

The eigendecomposition method in the longwave case is described in Appendix 3, but note that computation of the diffuse reflectance and transmittance matrices for each layer, \({\mathbf {R}}_j\) and \({\mathbf {T}}_j\), from \(\varvec{\Gamma }_1\) and \(\varvec{\Gamma }_2\) is exactly as in the shortwave case. Appendix 3 also describes the computation of the layer-wise emission vector \({\mathbf {p}}_j\) containing the upwelling irradiance at layer top due entirely to emission within the layer. Since temperature is assumed constant through the depth of the layer, this is equal to the irradiance emitted downwards at the base of the layer. Hogan et al. (2016) described how to treat a vertical variation in temperature within the layer, which leads to different layer-wise emission vectors at the top and base of the layer.

The solution to the longwave problem follows exactly the same sequence as shown in Fig. 2, but with some different calculations being performed at each step. In the upward pass through the layers, the matrix \({\mathbf {A}}\) is propagated using the same equations as in the shortwave. In addition, we propagate a vector \({\mathbf {g}}\) containing the upwelling irradiances in each region and stream at a particular interface associated with radiation that originates from thermal emission below that interface (possibly involving scattering in its journey up to that interface). At the surface its elements are \({\mathbf {g}}_{\mathrm {above\,}{n+1/2}}=(\begin{array}{cccc} g^a_1&~g^a_2&~g^v_1&~g^v_2 \end{array})^\mathrm {T}\), where \(g^i_k=h_k(1-\alpha ^i)c^iB(T_s^i)\). Here \(T_s^i\) is the surface temperature below region i allowing for different temperatures beneath vegetation and clear air, and \((1-\alpha ^i)\) is the surface emissivity beneath region i. The Adding Method for layer j consists of applying Eq. 28 of Hogan et al. (2016) to obtain the emission just below the interface at \(j-1/2\),

$$\begin{aligned} {\mathbf {g}}_{j-1/2}={\mathbf {p}}_j +{\mathbf {T}}_j{\mathbf {B}} \left( {\mathbf {g}}_{\mathrm {above}\,j+1/2} + {\mathbf {A}}_{\mathrm {above}\,j+1/2}{\mathbf {p}}_j \right) , \end{aligned}$$
(34)

where as before \({\mathbf {B}}={\mathbf {I}}-{\mathbf {A}}_{\mathrm {above}\,j+1/2}{\mathbf {R}}_j\). We then have the complication of adding the emission from the area of flat roofs at interface \(j-1/2\), which by analogy with (24) is dealt with by adding extra terms to the vector,

$$\begin{aligned} {\mathbf {g}}_{\mathrm {below}\,j-1/2}=\left( \begin{array}{c}{\mathbf {g}}_{j-1/2}\\ h_1(1-\alpha ^b)(c^b_j-c^b_{j-1})B(T^b)\\ h_2(1-\alpha ^b)(c^b_j-c^b_{j-1})B(T^b) \end{array}\right) , \end{aligned}$$
(35)

where \(T^b\) is the roof temperature, \((1-\alpha ^b)\) is the roof emissivity, and \((c^b_j-c^b_{j-1})\) is the fractional area of the domain containing roof at interface \(j-1/2\). This is translated to the regions of the layer above by applying the upward overlap matrix,

$$\begin{aligned} {\mathbf {g}}_{\mathrm {above\,}j-1/2} ={\mathbf {U}}_{j-1/2}{\mathbf {g}}_{\mathrm {below\,}j-1/2}, \end{aligned}$$
(36)

and the procedure is repeated to the top of the urban canopy. As with walls, if information is available on the horizontal variation in roof temperature (e.g. Lindberg et al. 2015) then \(B(T^b)\) in (35) should be the Planck function averaged over all the roof area at interface \(j-1/2\).

At the top of the canopy, the scalar upward longwave emission is computed (simply the sum of the elements of \({\mathbf {g}}\)) and, along with the scalar albedo, is presented to the longwave part of an atmospheric radiation scheme (step 6, Fig. 2). As in the shortwave, the radiation scheme then provides the downwelling diffuse radiation at canopy top, which is propagated down through the canopy. Overlap rules are implemented as in the shortwave, with the final entries of the \({\mathbf {v}}_{\mathrm {below\,}1/2}\) vector again containing the downwelling irradiances into the roof at interface \(j-1/2\). From these, and the roof emission rates in (35), we compute the net irradiance into the roof and can pass it into an energy-balance model for the roof. The roof irradiances are removed from \({\mathbf {v}}_{\mathrm {below\,}1/2}\) and then Eqs. 32 and 34 of Hogan et al. (2016), the downward part of the Adding Method in the longwave, are applied to obtain irradiances just above the base of the layer. This process is repeated down to the surface.

We then compute the net radiation into each facet of the urban surface analogously to (29), but without the direct solar term and with a new term that subtracts the thermal emission by each facet,

$$\begin{aligned} {\mathbf {n}}_j={\mathbf {N}}_j^\mathrm {diff}\left( \hat{{\mathbf {u}}}_j +\hat{{\mathbf {v}}}_j\right) - \left( \begin{array}{c} q^a\\ q^v\\ q^w \end{array}\right) \Delta z_j, \end{aligned}$$
(37)

where the vertically-integrated irradiances \(\hat{{\mathbf {u}}}_j\) and \(\hat{{\mathbf {v}}}_j\) are computed as in Appendix 3, and the emission rates by region i and by the walls are the terms on the right-hand side of (33) but summed over each stream of the two hemispheres,

$$\begin{aligned} q^i&=2c^i\sigma ^i(1-\omega ^i)B(T^i)\textstyle \sum _{k=1}^N h_k/\mu _k, \end{aligned}$$
(38)
$$\begin{aligned} q^w&= (1-\alpha ^w)(L^{aw}+L^{vw})B(T^w)\textstyle \sum _{k=1}^N v_k. \end{aligned}$$
(39)

4 Evaluation

In this section we evaluate SPARTACUS-Urban and its underlying assumptions in simplified scenarios for which existing models are available. We consider only one or two canopy layers and assume the air in the canopy to be completely transparent to radiation. This paves the way for consideration of atmospheric effects in Sect. 5 and more detailed evaluation in complex multi-layer scenes in future research.

4.1 Radiative Exchange Factors

Here we evaluate the discrete-ordinate method underpinning SPARTACUS-Urban subject to the assumption that the ‘exponential model’ of urban geometry proposed by Hogan (2019) is correct. Consider an urban canopy in which all walls are vertical and all buildings are of height H. The air in the canopy is transparent to radiation and vegetation is not included. In such a scenario, radiative exchange is determined by just three independent variables: \(F^{0g}\) is the fraction of direct solar radiation just below canopy top that penetrates down to the ground, \(F^{gs}\) is the fraction of diffuse radiation emanating isotropically from the ground that penetrates to the sky, and \(F^{ww}\) is the fraction of diffuse radiation emanating isotropically from a wall that strikes another wall.

Hogan (2019) derived analytic formulae for these factors for an exponential distribution of wall-to-wall separation distances with e-folding distance X. The simplest was for direct solar radiation,

$$\begin{aligned} F^{0g}=\exp (-t_0), \end{aligned}$$
(40)

where \(t_0\) is the ratio of the horizontal distance travelled by direct radiation penetrating the canopy to the e-folding separation. More generally for radiation travelling with a zenith angle \(\theta _k\) it is given by \(t_k=|\tan (\theta _k)|H/X\). SPARTACUS-Urban satisfies (40) exactly since it is simply a form of the Beer–Lambert law.

Fig. 3
figure 3

a The fraction of diffuse radiation emanating isotropically from the ground of a single-layer urban canopy in vacuum that penetrates to the sky, and b the fraction of diffuse radiation emanating isotropically from the wall of the same canopy that strikes another wall. The thick grey lines show the analytic results for an urban canopy that obeys the ‘exponential model’ of Hogan (2019), and the black lines show the predictions by the discrete-ordinate method using increasing numbers of streams. All lines are plotted with respect to the ratio of wall-to-ground area, equal to \(\pi H/X\), where H is the canopy depth and X is the e-folding wall-to-wall separation distance

The analytic formulae provided by Hogan (2019) for \(F^{gs}\) and \(F^{ww}\) are much more complicated, involving sine and cosine integrals. They are plotted as a function of the wall-to-ground area ratio by the thick grey lines in Fig. 3. In a 2N-stream discrete-ordinate approximation, we perform a weighted sum over each of the N streams in one hemisphere, using (12) or (17) to weight each stream according to whether the diffuse radiation is emanating from a horizontal or vertical surface,

$$\begin{aligned} F^{gs}&= \sum _{k=1}^N h_k\mathrm {e}^{-t_k}, \end{aligned}$$
(41)
$$\begin{aligned} F^{ww}&= 1-\sum _{k=1}^N v_k\frac{\mathrm {e}^{-t_k}}{t_k}. \end{aligned}$$
(42)

Thus it can be seen that (41) is just like averaging (40) over N discrete zenith angles. The slightly more complex form for \(F^{ww}\) arises due to an integration over all possible emission heights up the walls of the canopy. The grey lines in Fig. 3 show how the discrete-ordinate method approaches the exact solution with increasing numbers of streams. Hogan (2019) analyzed four real and contrasting urban scenes with wall–ground area ratios in the range 0.26–1.4; over this range of values it would appear that four or eight streams is adequate to represent diffuse radiative transfer. Two streams would appear to be insufficient, but this needs to be tested in real scenarios, particularly in the shortwave where direct radiative transfer is often dominant. In practice the choice of the number of streams is a trade-off between accuracy and computational cost; the cost of an N-stream scheme is approximately proportional to \(N^3\).

4.2 Comparison to the Matrix-Inversion Method

To investigate the consequences of the findings in Sect. 4.1 on longwave radiation, we compare SPARTACUS-Urban to the matrix-inversion technique of Harman et al. (2004) for the same idealized single-layer canopy. Their method computes the radiative power into the ground and wall facets, \(v^g\) and \(v^w\), by solving the following \(2\times 2\) matrix problem.

$$\begin{aligned} \left( \begin{array}{cr} 1 &{} -F^{wg}\alpha ^w\\ -F^{gw}\alpha ^g &{} ~~1-F^{ww}\alpha ^w \end{array}\right) \left( \begin{array}{c} v^g\\ v^w \end{array}\right) =\left( \begin{array}{l} F^{sg}v^s + F^{wg}E^w\\ F^{sw}v^s + F^{ww}E^w +F^{gw}E^g \end{array}\right) , \end{aligned}$$
(43)

where \(\alpha ^g\) and \(\alpha ^w\) are the albedos of the ground and wall facets, \(v^s\) is the downwelling longwave power from the ‘sky’ facet at canopy top, and \(E^i=A^i(1-\alpha ^i)\sigma T_i^4\) is the broadband emitted radiation from facet i as a function of its total area \(A^i\), emissivity \(1-\alpha ^i\), and temperature \(T_i\). The symmetry of the urban geometry leads to the following relationships between radiative exchange factors (e.g. Hogan 2019): \(F^{gw}=1-F^{gs}\), \(F^{sg}=F^{gs}\), \(F^{sw}=F^{gw}\), and \(F^{wg}=F^{ws}=(1-F^{ww})/2\).

Fig. 4
figure 4

The net outward longwave flux from the ground and wall facets of an idealized single-layer urban canopy containing air transparent to radiation, as a function of the depth of the canopy. Results are shown for the matrix-inversion technique of Harman et al. (2004), and the 2-, 4-, and 8-stream versions of SPARTACUS-Urban. The wall and ground facets are assumed to have a skin temperature of 31.1 \(^\circ \)C and an emissivity of 0.95, the sky facet has an effective emission temperature of 10.3 \(^\circ \)C and the e-folding building separation is \(X=50\) m. Net flux here is the radiative power per unit area of the ground facet, which excludes buildings

Figure 4 compares the net outward fluxes from the ground and wall facets (i.e. \(E^g-v^g\) and \(E^w-v^w\)) between SPARTACUS-Urban and the matrix-inversion method, both assuming the exponential model of urban geometry with an e-folding building separation of \(X=50\) m, a representative value from the real scenes analyzed by Hogan (2019). The other properties of the scene are described in the caption of Fig. 4, and match those in Sect. 5. We see that as in Fig. 3, the two-stream configuration is not very accurate, while four and eight streams are much closer to the matrix-inversion method. This gives us confidence that SPARTACUS-Urban represents horizontal building geometry accurately, enabling atmospheric effects to be investigated in Sect. 5, something not possible using the matrix-inversion technique.

4.3 Comparison to Monte-Carlo Simulations in Forests

Hogan et al. (2018) developed ‘SPARTACUS-Vegetation’, a two-stream radiation scheme targeted at forests, and evaluated it against Monte Carlo calculations in the visible and near-infrared. While it was shown to be a significant improvement over existing schemes, some errors were present when simulating scenes with snow on the ground. Since SPARTACUS-Urban without buildings can be thought of as the same scheme but extended to 2N streams, it is interesting to investigate the accuracy gained by the use of additional streams.

Fig. 5
figure 5

Comparison of normalized irradiances versus solar zenith angle for the ‘open forest canopy’ scenario of Widlowski et al. (2011) with a tree cover of 0.5 and optical properties appropriate for visible radiation, over surfaces with an albedo of a 0.122, and b 0.964. The Monte Carlo calculations are from Widlowski et al. (2011) at solar zenith angles of 27\(^\circ \), 60\(^\circ \) and 83\(^\circ \). Absorptance is the fraction of the incoming solar radiation absorbed by the vegetation while transmittance is the ratio of the downward solar radiation at the surface to the incoming radiation at the top of the canopy

The circles in Fig. 5 show the Monte Carlo calculations of Widlowski et al. (2011) for their ‘open forest canopy’ scenario, in which tree crowns are treated as homogeneous spheres of diameter 10 m, 4 m above the ground, with an areal coverage of 0.5, a domain-average leaf-area index of 2.5 and a single-scattering albedo of \(\omega ^v=0.13\). Following Hogan et al. (2018), these have been represented in SPARTACUS-Urban using two layers with the upper layer containing cylinders of vegetation similar to those shown in Fig. 1, but with a central core of higher optical depth to approximate the distribution of zenith optical depth of spheres. Regions a and v in the lower layer have the same area as in the upper layer, but are both transparent to radiation (also illustrated in layer 8 of Fig. 1b).

The dot–dashed lines in Fig. 5 show the two-stream simulations by SPARTACUS-Urban, which agree well with Monte Carlo calculations over a dark surface, but tend to underestimate reflectance and overestimate absorptance over a light surface illuminated by high sun. Virtually identical behaviour can be seen for SPARTACUS-Vegetation in Fig. 2 of Hogan et al. (2018). One slight difference between the two schemes is that SPARTACUS-Urban treats leaves as isotropic scatterers whereas SPARTACUS-Vegetation can represent anisotropic scattering, but in practice this has a barely perceptible impact on fluxes.

Physically, the problem with the two-stream scheme is that direct solar radiation incident on the snow-covered surface is reflected up at a fixed zenith angle of \(60^\circ \) (since the double-Gauss quadrature scheme represents the distribution of \(\mu \) by a single value \(\mu _1=0.5\)), too much of which intercepts a tree crown before escaping the canopy. This is also evident in Fig. 3a, which shows that the two-stream scheme underestimates the diffuse ground-to-sky factor. The dashed and solid lines in Fig. 5b show that the additional angles used by the four- and eight-stream configurations largely remove the reflectance and absorptance bias. This gives us confidence in the underlying ability of SPARTACUS-Urban to represent the radiative effects of trees, although an important part of a future study will be to validate the model for scenes containing both buildings and trees.

5 Importance of Longwave Atmospheric Absorption

One key advantage of SPARTACUS-Urban in the longwave is its ability to represent the absorption and emission by gases in the canopy, neglected in almost all previous urban radiation schemes. The need to account for atmospheric effects in thermal imaging cameras is recognized (Meier et al. 2011), yet these cameras operate in the infrared atmospheric window part of the spectrum where atmospheric effects are weakest; significant parts of the longwave spectrum have a much larger absorption.

Fig. 6
figure 6

Cumulative probability distribution of atmospheric mean free path in the longwave part of the spectrum for the near-surface conditions of three standard atmospheres indicated in the legend. The calculations use the RRTM-G gas optics model, which employs 140 spectral intervals

Before performing longwave urban simulations with SPARTACUS-Urban, we examine the range of absorption coefficients predicted by the RRTM-G gas-optics model of Mlawer et al. (1997), which underpins the radiation schemes of many weather and climate models. Figure 6 shows the cumulative probability of the absorption mean free path (the reciprocal of the volume absorption coefficient) for the near-surface conditions of three of the standard atmospheres from McClatchey et al. (1972). The contributions from water vapour, carbon dioxide, ozone, methane, nitrous oxide, CFC-11, and CFC-12 have been included. Each of the 140 spectral intervals in RRTM-G has been weighted according to its contribution to the black-body spectrum at the near-surface temperature of the standard atmosphere. Hogan (2019) reported e-folding wall-to-wall distances in the range \(X\approx 38\)–57 m for real cities. Figure 6 shows that in the case of the MLS standard atmosphere, 37% of longwave emission at the surface is associated with an atmospheric mean free path of less than 50 m, highlighting that simulations neglecting atmospheric effects in the longwave are unlikely to be accurate. In the MLS standard atmosphere, if we consider the parts of the spectrum with a mean free path of less than 50 m, then 77.94% of this energy is associated with wavelengths longer than \(12.2\,\upmu \hbox {m}\), 22.01% with wavelengths shorter than \(8.5\,\upmu \hbox {m}\), and only 0.05% with wavelengths in the infrared atmospheric window between.

To estimate the impact of atmospheric absorption on net irradiances, SPARTACUS-Urban calculations have been performed for the 140 spectral intervals of RRTM-G using the urban scenario considered in Sect. 4.2 and Fig. 4, but with the clear-sky MLS standard atmosphere above. The atmospheric optical properties are different in each spectral interval, and by summing the narrow-band irradiances in each interval we obtain broadband irradiances. The near-surface air temperature is 21.1 \(^\circ \)C for this standard atmosphere, and to represent typical daytime conditions we assume the skin temperature of the ground and walls to be \(10\,^\circ \hbox {C}\) higher than this. Atmospheric radiation calculations using the ecRad radiation scheme of Hogan and Bozzo (2018) provide downwelling longwave irradiance at the top of the canopy in each spectral interval. The dashed lines in Fig. 7a depict eight-stream calculations at this spectral resolution but neglecting absorption and emission in the urban canopy itself. These results match Fig. 4 closely, which used a single band for the whole longwave spectrum.

Fig. 7
figure 7

The net outward flux from the ground and wall facets of a single-layer urban canopy, along with the net emission by the air within the canopy, computed using the eight-stream version of SPARTACUS-Urban coupled to the RRTM-G gas-optics model. The urban canopy is placed beneath the mid-latitude summer standard atmosphere, the air temperature 20 m above the urban canopy is \(T_\mathrm {above}=21.1\,^\circ \)C, and the wall and ground facets have a skin temperature of \(31.1\,^\circ \hbox {C}\). These conditions match those in Fig. 4, but with the addition of atmospheric absorption and emission. The panels show results for air temperature in the urban canopy, \(T_\mathrm {air}\), of a\(21.1\,^\circ \hbox {C}\), and b\(26.1\,^\circ \hbox {C}\). In the 20 m above the urban canopy, air temperature is assumed to vary linearly between \(T_\mathrm {air}\) and \(T_\mathrm {above}\). This leads to a slight difference in downwelling fluxes at the canopy top, and hence a difference in the net flux at the ground for a zero building height between a and b. The dashed lines show the results where gas absorption and emission within the canopy have been neglected

The solid lines in Fig. 7a show the corresponding results when atmospheric absorption in the canopy is included, using the RRTM-G scheme to compute atmospheric extinction coefficients in each spectral interval using gas concentrations from the MLS standard atmosphere. Here we have assumed the air temperature in the canopy, \(T_\mathrm {air}\), to be equal to the air temperature above the canopy, \(T_\mathrm {above}\). The presence of atmospheric absorption significantly modifies the energy balance of the urban canopy, and its impact increases with building height. Since the air is \(10\,^\circ \hbox {C}\) cooler than the surrounding ground and walls, it absorbs more radiation than it emits, the net absorption rising to \(75\,\hbox {W m}^{-2}\) for 50-m high buildings. This is accompanied by an increase in net emission by the ground and walls compared to when atmospheric effects are neglected. These results highlight the need to incorporate atmospheric effects into longwave radiation calculations in urban canopies.

In reality the temperature of the air in the canopy is determined by both turbulent and radiative exchanges with the urban surface and the air above the canopy, and so in principle could be higher than the air temperature above the canopy. Figure 7b depicts the results for calculations in which \(T_\mathrm {air}\) is 5 K greater than \(T_\mathrm {above}\), so half way between the temperature of the air above and the skin temperature of the ground and walls. This changes the net irradiances significantly.

6 Discussion and Conclusions

A flexible and efficient urban radiation scheme ‘SPARTACUS-Urban’ has been described that can represent realistic building layouts, variations in building height, the specular component of reflection from building walls, urban vegetation, atmospheric effects between buildings, and spectral coupling to the atmosphere above. The level of complexity is configurable, specifically the number of layers, streams, regions, and spectral intervals. This makes it suitable both for simulating detailed scenes in which an accurate vertical profile is required, and for use in large-scale weather and climate models where computational speed is more important and the number of morphological variables describing an urban area may be limited.

To evaluate the scheme, simple one- and two-layer scenes for which existing schemes or 3D Monte Carlo calculations are available have been used. While a two-stream representation of the diffuse radiation field is adequate for representing trees over dark surfaces (Hogan et al. 2018), we find that four or eight streams are needed to represent radiative exchange between the horizontal and vertical surfaces of an urban area, and for representing trees over snow-covered surfaces. Work is in progress to test the scheme against explicit 3D calculations in more complex multi-layered scenes from real cities, and will be reported in a future paper.

The new scheme has been coupled to a comprehensive gas-optics model and used to demonstrate the importance of longwave absorption and emission by air between buildings, something that has been ignored by almost all previous schemes. The net absorption by the air is strongly dependent on its temperature, which is determined by turbulent as well as radiative heat fluxes. It would therefore be necessary to couple SPARTACUS-Urban to an urban energy balance scheme to fully evaluate the importance of atmospheric radiative effects in urban canopies.

There are several interesting possibilities for the future development of SPARTACUS-Urban. As with most urban radiation schemes, it currently represents only perfectly vertical or perfectly horizontal surfaces, with isotropic emission or scattering by these surfaces being represented by the weightings of the different streams given by (12) or (17). Emission or scattering by inclined surfaces could, in principle, be represented by using a different weighting between streams according to the angle of the inclination, which should improve the accuracy of simulations in urban areas with a large area of pitched roofs. However, this would need to be weighed against the increase in complexity and computational cost: the \(\varvec{\Gamma }\) matrix in (3) would no longer have repeated elements, breaking the symmetry exploited in the eigendecomposition (Appendix 2) and leading to the reflectance and transmittance matrices being different for upwelling and downwelling radiation.

One particularly challenging aspect in modelling real cities is that neighbourhoods of quite different character can lie adjacent to one another and therefore interact radiatively; for example, clusters of tall buildings are often separated by low-rise areas and small parks. With just one clear-air and one vegetated region we must either perform separate radiation calculations for each neighbourhood, thereby neglecting radiative interactions, or homogenize the building and vegetation statistics into a single calculation, thereby neglecting the differences between neighbourhoods. However, SPATACUS-Urban is quite flexible in how the regions are specified; we just need to know their fractional area and the length of the interface with all other regions. Therefore, a third option would be to introduce separate clear-air and vegetated regions for each type of neighbourhood, with radiative exchange permitted between the clear-air regions of different neighbourhoods. Such an approach would allow buildings of different albedo and temperature to be used in the different neighbourhoods, while still interacting radiatively. This could facilitate forecasts of the variation in intensity of the urban-heat-island effect across the different neighbourhoods of a city.