Milestone 5 - Spatial Discretization Scheme

The challenge now is to evaluate the diffusion operator in spherical coordinates, such that we can use it in our 2D2D EBM model. To do that, we will obtain a discrete version of the spatial derivatives that we can compute using the nodal values for the temperature and diffusion coefficients in our 2D2D latitude/longitude grid.

Finite Difference Discretization of First and Second-Order Derivatives

The finite difference method is one of the simplest numerical methods to discretize derivatives. There are many ways to derive finite difference formulas, but we will focus on the method of the Taylor expansion, as it will give us information about the approximation errors.

Taylor series: The Taylor series (or Taylor expansion) of a function is an infinite sum of polynomial terms that are expressed in terms of the function's derivatives at a point. For instance, the Taylor series of the function f(x)f(x) around the point x0x_0 is defined as f(x)=f(x0)+df(x0)dx(xx0)+12!d2f(x0)dx2(xx0)2+13!d3f(x0)dx3(xx0)3+=f(x0)+df(x0)dxΔx+12!d2f(x0)dx2Δx2+12!d3f(x0)dx3Δx3+=n=1f(n)(x0)n!Δx,\begin{aligned} f(x) &= f(x_0) + \frac{d { f(x_0)}}{d { x} } (x-x_0) + \frac{1}{2!} \frac{d { ^2f(x_0)}}{d { x^2} } (x-x_0)^2 + \frac{1}{3!}\frac{d { ^3f(x_0)}}{d { x^3} } (x-x_0)^3 + \cdots \\ &= f(x_0) + \frac{d { f(x_0)}}{d { x} } \Delta x + \frac{1}{2!} \frac{d { ^2f(x_0)}}{d { x^2} } \Delta x^2 + \frac{1}{2!} \frac{d { ^3f(x_0)}}{d { x^3} } \Delta x^3 + \cdots \\ &= \sum_{n=1}^{\infty} \frac{f^{(n)}(x_0)}{n!} \Delta x, \end{aligned} where f(n)(x0)f^{(n)}(x_0) is a short-hand notation for the nthn^{\text{th}} derivative of function f(x)f(x) at x0x_0, and the distance between the evaluation point and the point xx and x0x_0 is Δxxx0\Delta x \coloneqq x - x_0.

Let us consider a uniform one-dimensional grid containing temperature values.

Using (1), we can write Taylor expansion for Ti+1T_{i+1} around TiT_{i}:

Ti+1=Ti+dTidxΔx+12d2Tidx2Δx2+16d3Tidx3Δx3+ . T_{i+1} = T_i + \frac{d { T_i}}{d { x} } \Delta x + \frac{1}{2} \frac{d { ^2T_i}}{d { x^2} } \Delta x^2 + \frac{1}{6} \frac{d { ^3T_i}}{d { x^3} } \Delta x^3 + \cdots.

By manipulating (2), we can obtain an expression for the first-order derivative,

dTidx=Ti+1TiΔx12d2Tidx2Δx+=Ti+1TiΔx+O(Δx),\begin{aligned} \frac{d { T_i}}{d { x} } &= \frac{T_{i+1} - T_{i}}{\Delta x} - \frac{1}{2} \frac{d { ^2T_i}}{d { x^2} } \Delta x + \ldots \\ &= \frac{T_{i+1} - T_{i}}{\Delta x} + \mathcal{O}(\Delta x), \end{aligned}

where O(Δx)\mathcal{O}(\Delta x) indicates that the largest term is of the order of Δx\Delta x. Hence, if we truncated the Taylor series there,

dTidxTi+1TiΔx, \frac{d { T_i}}{d { x} } \approx \frac{T_{i+1} - T_{i}}{\Delta x},

we would obtain an approximation of the derivative dTi/dx\mathrm{d} T_i / \mathrm{d} x, which would converge to the exact value of the derivative with first-order accuracy (i.e., errorΔx1\text{error} \sim \Delta x^1) as the grid size is reduced, Δx0\Delta x \rightarrow 0.

It is also possible to write Taylor expansions of Ti1T_{i-1} around TiT_{i},

Ti1=TidTidxΔx+12d2Tidx2Δx216d3Tidx3Δx3+ , T_{i-1} = T_i - \frac{d { T_i}}{d { x} } \Delta x + \frac{1}{2} \frac{d { ^2T_i}}{d { x^2} } \Delta x^2 - \frac{1}{6} \frac{d { ^3T_i}}{d { x^3} } \Delta x^3 + \cdots,

or Ti+2T_{i+2} around TiT_{i},

Ti+2=Ti+2dTidxΔx+2d2Tidx2Δx2+43d3Tidx3Δx3+ , T_{i+2} = T_i + 2 \frac{d { T_i}}{d { x} } \Delta x + 2 \frac{d { ^2T_i}}{d { x^2} } \Delta x^2 + \frac{4}{3} \frac{d { ^3T_i}}{d { x^3} } \Delta x^3 + \cdots,

etc.

Using (2), (5), and (6), we can obtain the following approximations for the first derivative at xix_i:

  • Right-sided finite-difference scheme of first order (errorΔx1\text{error} \sim \Delta x^1):

dTidxTi+1TiΔx. \frac{d { T_i}}{d { x} } \approx \frac{T_{i+1} - T_{i}}{\Delta x}.
  • Left-sided finite-difference scheme of first order (errorΔx1\text{error} \sim \Delta x^1):

dTidxTiTi1Δx. \frac{d { T_i}}{d { x} } \approx \frac{T_{i} - T_{i-1}}{\Delta x}.
  • Central finite-difference scheme of second order (errorΔx2\text{error} \sim \Delta x^2):

dTidxTi+1Ti12Δx. \frac{d { T_i}}{d { x} } \approx \frac{T_{i+1} - T_{i-1}}{2 \Delta x}.
  • Right-sided finite-difference scheme of second order (errorΔx2\text{error} \sim \Delta x^2):

dTidx3Ti+4Ti+1Ti+22Δx. \frac{d { T_i}}{d { x} } \approx \frac{-3 T_i + 4T_{i+1} - T_{i+2}}{2 \Delta x}.
  • And many other possibilities.

Remark: High-order approximations are desired as the higher the order, the faster we approach the exact value of the derivative as we refine the grid. However, high-order accuracy sometimes come with the price of more operations to compute.
Remark: Note that some finite difference approximations are central, and some are left-sided or right-sided. Depending on how the finite-difference formula is defined, it will have some bias as to how information travels in the domain.

Using (2), (5), and (6), we can also obtain approximations for the second derivative at xix_i:

  • Right-sided finite-difference scheme of first order (errorΔx1\text{error} \sim \Delta x^1):

d2Tidx2Ti+22Ti+1+TiΔx2. \frac{d { ^2T_i}}{d { x^2} } \approx \frac{T_{i+2} - 2T_{i+1} + T_{i}}{\Delta x^2}.
  • Central finite-difference scheme of second order (errorΔx2\text{error} \sim \Delta x^2):

d2Tidx2Ti+12Ti+Ti1Δx2. \frac{d { ^2T_i}}{d { x^2} } \approx \frac{T_{i+1} - 2T_i + T_{i-1}}{\Delta x^2}.
  • And many other possibilities.

Application to the Diffusion Operator in Spherical Coordinates

Our diffusion operator in spherical coordinates contains a term (Term 3) of the form

L1(T)=Tx, \mathcal{L}_1(T) = \frac{\partial { T}}{\partial { x} },

which can be discretized with the first-order derivative finite-difference approximations, and two terms (Terms 1 and 2) of the form

L2(T)=x(D~Tx), \mathcal{L}_2(T) = \frac{\partial { }}{\partial { x} } \left( \widetilde D \frac{\partial { T}}{\partial { x} } \right),

which is slightly more involved.

One possibility to discretize L2(T)\mathcal{L}_2(T) is to apply the chain rule of differentiation at the continuous level,

L2(T)=x(D~Tx)=D~xTx+D~2Tx2, \mathcal{L}_2(T) = \frac{\partial { }}{\partial { x} } \left( \widetilde D \frac{\partial { T}}{\partial { x} } \right) = \frac{\partial { \widetilde D}}{\partial { x} } \frac{\partial { T}}{\partial { x} } + \widetilde D \frac{\partial { ^2T}}{\partial { x^2} },

such that it is expressed in terms of first and second-order derivatives.

Remark: Even though we are now dealing with partial derivatives, the finite difference formulas can be applied dimension by dimension.

We now have enough tools to obtain a discrete form for the diffusion term of the 2D2D EBM. Our goal is to obtain a finite difference scheme with the following properties:

  • The scheme must be central: To model the parabolic nature of the heat conduction term (see Milestone 2 - Conservation and Balance), we require the scheme to be symmetric.

  • The scheme must be compact: To avoid wide stencils, we require the scheme to only use the information from neighboring nodes.

  • The scheme must be as accurate as possible: We will select a scheme of the highest order possible, such that our approximation is as accurate as possible given our constraints.

Given these criteria, we select the central second-order accurate finite-difference approximations for the first-order (9) and second-order (12) derivatives, to obtain for the degree of freedom ii

L1(Ti)=D~iTixD~iTi+1Ti12Δx, \mathcal{L}_1(T_i) = \widetilde D_i \frac{\partial { T_i}}{\partial { x} } \approx \widetilde D_i \frac{T_{i+1} - T_{i-1}}{2 \Delta x},

and

L2(Ti)=x(D~iTix)=D~xTx+D~2Tx2D~i+1D~i12ΔxTi+1Ti12Δx+D~iTi+12Ti+Ti1Δx2,\begin{aligned} \mathcal{L}_2(T_i) = \frac{\partial { }}{\partial { x} } \left( \widetilde D_i \frac{\partial { T_i}}{\partial { x} } \right) =& \frac{\partial { \widetilde D}}{\partial { x} } \frac{\partial { T}}{\partial { x} } + \widetilde D \frac{\partial { ^2T}}{\partial { x^2} } \\ \approx & \frac{\widetilde D_{i+1} - \widetilde D_{i-1}}{2 \Delta x} \frac{T_{i+1} - T_{i-1}}{2 \Delta x} + \widetilde D_i \frac{T_{i+1} - 2T_i + T_{i-1}}{\Delta x^2}, \end{aligned}

which simplifies to

L2(Ti)1Δx2(2D~iTi+[D~i+14(D~i+1D~i1)]Ti+1+[D~i14(D~i+1D~i1)]Ti1).\begin{aligned} \mathcal{L}_2(T_i) \approx \frac{1}{\Delta x^2} \biggl( -2 \widetilde D_i T_i &+ \Bigl[\widetilde D_i + \frac{1}{4} \left( \widetilde D_{i+1} - \widetilde D_{i-1} \right)\Bigr] T_{i+1} \\ &+ \Bigl[\widetilde D_i - \frac{1}{4} \left( \widetilde D_{i+1} - \widetilde D_{i-1} \right)\Bigr] T_{i-1} \biggr). \end{aligned}

Garhering everything, and introducing h=Δθ=Δφh = \Delta \theta = \Delta \varphi as the uniform mesh spacing, the central second-order finite-difference discretization of the different terms of the diffusion operator in spherical coordinates reads

Lj,i=[csc2(θ~)φ(D~(θ~,φ)Tφ)]j,iTerm 1+[θ~(D~(θ~,φ)Tθ~)]j,iTerm 2+[cot(θ~)D~(θ~,φ)Tθ~]j,iTerm 3, L_{j,i} = \underbrace{ \left[\csc^{2}(\tilde \theta)\frac{\partial}{\partial \varphi}\biggl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \varphi}\Bigr)\right]_{j,i} }_{\text{Term~1}} + \underbrace{ \left[ \frac{\partial}{\partial \tilde \theta}\Bigl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \tilde \theta}\Bigr) \right]_{j,i} }_{\text{Term~2}} + \underbrace{ \left[ \cot(\tilde \theta)\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \tilde \theta} \right]_{j,i} }_{\text{Term~3}},

with the terms

  • Term 1:

[csc2(θ~)φ(D~(θ~,φ)Tφ)]j,icsc2(θ~j,i)h2(2D~j,iTj,i+[D~j,i14(D~j,i+1D~j,i1)]Tj,i1+[D~j,i+14(D~j,i+1D~j,i1)]Tj,i+1)\begin{aligned} \left[\csc^{2}(\tilde \theta)\frac{\partial}{\partial \varphi}\biggl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \varphi}\Bigr)\right]_{j,i} \approx \frac{\csc^{2}(\tilde \theta_{j,i})}{h^2} \biggl(-2\widetilde D_{j,i}T_{j,i} & + \Bigl[\widetilde D_{j,i} - \frac{1}{4}(\widetilde D_{j,i+1} - \widetilde D_{j,i-1})\Bigr]T_{j,i-1} \\ & + \Bigl[\widetilde D_{j,i} + \frac{1}{4}(\widetilde D_{j,i+1} - \widetilde D_{j,i-1})\Bigr] T_{j,i+1}\biggr) \end{aligned}
  • Term 2:

[θ~(D~(θ~,φ)Tθ~)]j,i1h2(2D~j,iTj,i+[D~j,i14(D~j+1,iD~j1,i)]Tj1,i+[D~j,i+14(D~j+1,iD~j1,i)]Tj+1,i)\begin{aligned} \left[ \frac{\partial}{\partial \tilde \theta}\Bigl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \tilde \theta}\Bigr) \right]_{j,i} \approx \frac{1}{h^{2}}\biggl(-2\widetilde D_{j,i}T_{j,i} & + \Bigl[\widetilde D_{j,i} - \frac{1}{4}(\widetilde D_{j+1,i} - \widetilde D_{j-1,i})\Bigr] T_{j-1,i}\\ & + \Bigl[\widetilde D_{j,i} + \frac{1}{4}(\widetilde D_{j+1,i} - \widetilde D_{j-1,i})\Bigr] T_{j+1,i}\biggr) \end{aligned}
  • Term 3:

[cot(θ~)D~(θ~,φ)Tθ~]j,icot(θ~j,i)D~j,i2h[Tj+1,iTj1,i].\begin{aligned} \left[ \cot(\tilde \theta)\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \tilde \theta} \right]_{j,i} \approx \cot(\tilde \theta_{j,i})\frac{\widetilde D_{j,i}}{2h}[T_{j+1,i} - T_{j-1,i}]. \end{aligned}
Remark: We cannot use equations (20), (21), and (22) for the nodes at the pole becuse of the singularity of our grid. In fact, (20) and (22) are not well defined for θ~=0\tilde \theta = 0, and the evaluation of (21) is complicated because it requires a nodal value across the pole.

A Solution to the Pole Problem

To deal with the pole problem, we use the techniques proposed in the following papers:

Bates, J. R., Semazzi, F. H. M., Higgins, R. W., & Barros, S. R. (1990). Integration of the shallow water equations on the sphere using a vector semi-Lagrangian scheme with a multigrid solver. Monthly Weather Review, 118(8), 1615-1627.

Barros, S. R., & Garcia, C. I. (2004). A global semi-implicit semi-Lagrangian shallow-water model on locally refined grids. Monthly weather review, 132(1), 53-65.

We start by considering the diffusion operator in spherical coordinates, but we combine Terms 2 and 3 to obtain

L(θ~,φ)(DT)=csc2(θ~)φ(D~(θ~,φ)Tφ)+csc(θ~)θ~(D~(θ~,φ)sin(θ~)Tθ~).\begin{aligned} L(\tilde \theta,\varphi) \coloneqq \vec{\nabla} \cdot (D\vec{\nabla} T) = \csc^{2}(\tilde \theta) \frac{\partial}{\partial \varphi}\Bigl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \varphi}\Bigr) + \csc(\tilde \theta) \frac{\partial }{\partial \tilde \theta} \left( \widetilde D (\tilde \theta,\varphi) \sin (\tilde \theta) \frac{\partial { T}}{\partial { \tilde \theta} } \right). \end{aligned}

We will proceed to derive a discretization for the north pole. The discretization for the south pole can be derived in an analogous manner. Let us consider a control area of the size of the northern polar cell (green in the figure), which spans θ~[0,h/2]\tilde \theta \in [0,h/2], φ[0,2π]\varphi \in [0, 2\pi].

To avoid the singularity at the pole, we will now consider an integral form of (23), which we obtain by integrating the equation over the polar cell,

0h202πL(θ~,φ)RE2sinθ~dφdθ~=0h202πcsc(θ~)φ(D~(θ~,φ)Tφ)RE2dφdθ~+0h202πθ~(D~(θ~,φ)sin(θ~)Tθ~)RE2dφdθ~.\begin{aligned} \int_0^{\frac{h}{2}} \int_0^{2\pi}L(\tilde \theta,\varphi)R_E^2 \sin \tilde \theta \mathrm{d} \varphi \mathrm{d} \tilde \theta =& \int_0^{\frac{h}{2}} \int_0^{2\pi} \csc(\tilde \theta) \frac{\partial}{\partial \varphi}\Bigl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \varphi}\Bigr) R_E^2 \mathrm{d} \varphi \mathrm{d} \tilde \theta \\ &+ \int_0^{\frac{h}{2}} \int_0^{2\pi} \frac{\partial }{\partial \tilde \theta} \left( \widetilde D (\tilde \theta,\varphi) \sin (\tilde \theta) \frac{\partial { T}}{\partial { \tilde \theta} } \right) R_E^2 \mathrm{d} \varphi \mathrm{d} \tilde \theta. \end{aligned}

Remark: In (24), we have used the fact that the differential of area in spherical coordinates is defined as

dS=rθ~×rφdφdθ~=RE2sinθ~dφdθ~, \mathrm{d} S = \left| \frac{\partial { \mathbf{r}}}{\partial { \tilde \theta} } \times \frac{\partial { \mathbf{r}}}{\partial { \varphi} } \right| \mathrm{d} \varphi \mathrm{d} \tilde \theta = R_E^2 \sin \tilde \theta \mathrm{d} \varphi \mathrm{d} \tilde \theta,

where r\mathbf{r} is a vector that describes the surface of Earth, i.e., r=rsinθ~cosφx^+rsinθ~sinφy^+rcosθ~z^r=RE.\begin{aligned} \mathbf{r} = r \sin \tilde \theta \cos \varphi \hat{x} + r \sin \tilde \theta \sin \varphi \hat{y} + r \cos \tilde \theta \hat{z} \bigg\vert_{r=R_E}. \end{aligned}

To compute a surface integral, we use SL(θ~,φ)dS=0Δθ/2ππL(θ~,φ)rθ~×rφdφdθ~=0Δθ/2ππL(θ~,φ)RE2sinθ~dφdθ~.\begin{aligned} \int_S L(\tilde \theta,\varphi) \mathrm{d} S &= \int_0^{\Delta \theta/2} \int_{-\pi}^{\pi} L(\tilde \theta,\varphi) \left| \frac{\partial { \mathbf{r}}}{\partial { \tilde \theta} } \times \frac{\partial { \mathbf{r}}}{\partial { \varphi} } \right| \mathrm{d} \varphi \mathrm{d} \tilde \theta \\ &= \int_0^{\Delta \theta/2} \int_{-\pi}^{\pi} L(\tilde \theta,\varphi) R_E^2 \sin \tilde \theta \mathrm{d} \varphi \mathrm{d} \tilde \theta. \end{aligned}

We can show that the first integral in the right-hand side of (24) vanishes using the fundamental theorem of calculus:

0h202πcsc(θ~)φ(D~(θ~,φ)Tφ)RE2dφdθ~=RE20h2csc(θ~)02πφ(D~(θ~,φ)Tφ)dφdθ~=RE20h2csc(θ~)[D~(θ~,φ)Tφ]02π=0dθ~=0.\begin{aligned} \int_0^{\frac{h}{2}} \int_0^{2\pi} \csc(\tilde \theta) \frac{\partial}{\partial \varphi}\Bigl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \varphi}\Bigr) R_E^2 \mathrm{d} \varphi \mathrm{d} \tilde \theta =& R_E^2 \int_0^{\frac{h}{2}} \csc(\tilde \theta) \int_0^{2\pi} \frac{\partial}{\partial \varphi}\Bigl(\widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \varphi}\Bigr) \mathrm{d} \varphi \mathrm{d} \tilde \theta \\ =& R_E^2 \int_0^{\frac{h}{2}} \csc(\tilde \theta) \underbrace{\left[ \widetilde D (\tilde \theta,\varphi)\frac{\partial T}{\partial \varphi} \right]_0^{2\pi}}_{=0} \mathrm{d} \tilde \theta \\ =& 0. \end{aligned}
Remark: As mentioned above, there is a singularity at θ~=0\tilde \theta = 0. As shown in (28), we can deal with the singularity using the integral form of the equation. As can be derived with standard calculus, the value of the integral is well defined.

Similarly, we can use the fundamental theorem of calculus to integrate the second term in the right-hand side of (24) over the colatitude:

0h202πL(θ~,φ)RE2sinθ~dφdθ~=RE202π0h2θ~(D~(θ~,φ)sin(θ~)Tθ~)dθ~dφ=RE202π[D~(θ~,φ)sin(θ~)Tθ~]0h2dφ=RE202πD~(h2,φ)sin(h2)Tθ~θ~=h2dφ.\begin{aligned} \int_0^{\frac{h}{2}} \int_0^{2\pi} L(\tilde \theta,\varphi) R_E^2 \sin \tilde \theta \mathrm{d} \varphi \mathrm{d} \tilde \theta =& R_E^2 \int_0^{2\pi} \int_0^{\frac{h}{2}} \frac{\partial }{\partial \tilde \theta} \left( \widetilde D (\tilde \theta,\varphi) \sin (\tilde \theta) \frac{\partial { T}}{\partial { \tilde \theta} } \right) \mathrm{d} \tilde \theta \mathrm{d} \varphi \\ =& R_E^2 \int_0^{2\pi} \left[ \widetilde D (\tilde \theta,\varphi) \sin (\tilde \theta) \frac{\partial { T}}{\partial { \tilde \theta} } \right]_0^{\frac{h}{2}} \mathrm{d} \varphi \\ =& R_E^2 \int_0^{2\pi} \widetilde D \left( \frac{h}{2} ,\varphi \right) \sin \left( \frac{h}{2} \right) \frac{\partial { T}}{\partial { \tilde \theta} } \bigg\rvert_{\tilde \theta=\frac{h}{2}} \mathrm{d} \varphi. \end{aligned}

As a next step, we make the assumption that L(θ~,φ)L(\tilde \theta,\varphi) is a constant in the polar cell, such that we can approximate the integral on the left-hand side with a mid-point rule,

0h202πL(θ~,φ)RE2sinθ~dφdθ~0h202πL1,iRE2sinθ~dφdθ~=L1,i0h202πRE2sinθ~dφdθ~=L1,i(2πRE2(1cos(Δθ2)))=L1,i(area[1])(4πRE2)\begin{aligned} \int_0^{\frac{h}{2}} \int_0^{2\pi} L(\tilde \theta,\varphi) R_E^2 \sin \tilde \theta \mathrm{d} \varphi \mathrm{d} \tilde \theta \approx& \int_0^{\frac{h}{2}} \int_0^{2\pi} L_{1,i} R_E^2 \sin \tilde \theta \mathrm{d} \varphi \mathrm{d} \tilde \theta \\ =& L_{1,i} \int_0^{\frac{h}{2}} \int_0^{2\pi} R_E^2 \sin \tilde \theta \mathrm{d} \varphi \mathrm{d} \tilde \theta \\ =& L_{1,i} \left( 2 \pi R_E^2 \left(1-\cos \left(\frac{\Delta \theta}{2}\right) \right) \right) \\ =& L_{1,i} (\texttt{area[1]}) (4\pi R_E^2) \end{aligned}

where L1,iL_{1,i} is the nodal value of L(θ~,φ)L(\tilde \theta,\varphi) at θ~j=0\tilde \theta_j=0 (j=1j=1) for any longitude position ii. This is an approximation of the integral that assumes that the nodal value of the mid-point corresponds to the area-average of L(θ~,φ)L(\tilde \theta,\varphi) in the polar cell. Recall that the first entry of the array area\texttt{area} contains the total area of the polar cap normalized with the area of the sphere (see Milestone 3 - Averages).

We then obtain

L1,i(area[1])(4πRE2)=RE202πD~(h2,φ)sin(h2)Tθ~θ~=h2dφ.\begin{aligned} L_{1,i} (\texttt{area[1]}) (4\pi R_E^2) =& R_E^2 \int_0^{2\pi} \widetilde D \left( \frac{h}{2},\varphi \right) \sin \left( \frac{h}{2} \right) \frac{\partial { T}}{\partial { \tilde \theta} } \bigg\rvert_{\tilde \theta=\frac{h}{2}} \mathrm{d} \varphi. \end{aligned}

Now, we approximate the derivative of temperature with respect to colatitude at each discrete longitude, φi\varphi_i, with a central finite-difference approximation of second-order accuracy,

[Tθ~]θ~=h2,iT2,iT1,ih, \left[ \frac{\partial { T}}{\partial { \tilde \theta} } \right]_{\tilde \theta=\frac{h}{2},i} \approx \frac{T_{2,i}-T_{1,i}}{h},

and the diffusion coefficient at θ~=h2\tilde \theta=\frac{h}{2} with a simple average,

[D~(θ~,φ)]θ~=h2,iD~iNP=12(D~1,i+D~2,i). \left[ \widetilde D (\tilde \theta,\varphi)\right]_{\tilde \theta=\frac{h}{2},i} \approx \overline{\widetilde D}_i^{\text{NP}} = \frac{1}{2} \left( \widetilde D_{1,i} + \widetilde D_{2,i} \right).

Remark: Another possibility is to compute an area-weighted average:

D~ˉiNP=area[1]n_longitudeD~1,i+area[2]D~2,iarea[1]n_longitude+area[2]. \bar{\widetilde D}_i^{\text{NP}} = \frac{\frac{\texttt{area[1]}}{\texttt{n\_longitude}} \widetilde D_{1,i} + \texttt{area[2]}\widetilde D_{2,i}}{\frac{\texttt{area[1]}}{\texttt{n\_longitude}} + \texttt{area[2]}}.

Finally, we approximate the integral on the right-hand side of (31) with a rectangular quadrature rule to obtain

L1,i=sin(h/2)4π area[1]k=1n_longitudeD~kNP[T2,kT1,k]. L_{1,i} = \frac{\sin \left( h/2 \right)}{4\pi \, \texttt{area[1]}} \sum_{k=1}^{\texttt{n\_longitude}} \overline{\widetilde D}_k^{\text{NP}} \left[ T_{2,k}-T_{1,k} \right].

Following a similar procedure, we obtain for the south pole

Ln_latitude,i=sin(h/2)4π area[n_latitude]k=1n_longitudeD~kSP[Tn_latitude1,kTn_latitude,k], L_{\texttt{n\_latitude},i} = \frac{\sin \left( h/2 \right)}{4\pi \, \texttt{area[\texttt{n\_latitude}]}} \sum_{k=1}^{\texttt{n\_longitude}} \overline{\widetilde D}_k^{\text{SP}} \left[ T_{\texttt{n\_latitude}-1,k}-T_{\texttt{n\_latitude},k} \right],

with

D~iSP=12(D~n_latitude,i+D~n_latitude1,i). \overline{\widetilde D}_i^{\text{SP}} = \frac{1}{2} \left( \widetilde D_{\texttt{n\_latitude},i} + \widetilde D_{\texttt{n\_latitude}-1,i}\right). % \frac{\frac{\texttt{area[\texttt{n\_latitude}]}}{\texttt{n\_longitude}} \widetilde D_{\texttt{n\_latitude},i} + \texttt{area[\texttt{n\_latitude}-1]}\widetilde D_{\texttt{n\_latitude}-1,i}}{\frac{\texttt{area[\texttt{n\_latitude}]}}{\texttt{n\_longitude}} + \texttt{area[\texttt{n\_latitude}-1]}}.

Semi-Discrete EBM

With the spatial discretization that we derived above, we can rewrite the PDE that describes our 2D2D EBM in spherical coordinates as an ODE for each degree of freedom (j,i)(j,i):

dTj,idt=Lj,iCj,iBCj,iTj,iRj,i(T)+1Cj,i(Ssol,j,i(t)A)Fj,i, \frac{d { T_{j,i}}}{d { t} } = \underbrace{ \frac{L_{j,i}}{C_{j,i}} - \frac{B}{C_{j,i}} T_{j,i} }_{R_{j,i}(T)} + \underbrace{ \frac{1}{C_{j,i}} \left(S_{sol, j, i}(t) - A\right) }_{F_{j,i}},

where we have gathered the temperature-dependent terms under Rj,i(T)R_{j,i}(T) and the sources and sinks under Fj,iF_{j,i}.

In equation (38), Cj,iC_{j,i} is the point-wise heat capacity that depends on the geography (see Milestone 2 - Heat Capacity); Lj,iL_{j,i} is the discrete point-wise heat transfer term computed with (19) for the interior nodes, with (35) for the north pole (j=1j=1), and with (36) for the south pole (j=n_latitudej=\texttt{n\_latitude}); AA and BB are the outgoing longwave radiation parameters (see Milestone 2 - Radiation Modeling); and Ssol,j,i=(1αj,i)Sj,iS_{sol, j, i} = (1 - \alpha_{j,i}) S_{j,i} is the point-wise time-dependent solar forcing term that depends on the point-wise insolation Sj,iS_{j,i} and the point-wise albedo αj,i\alpha_{j,i}.

We can rewrite (38) in matrix form as

T˙=R(T)+F(t), \dot{\underline{\mathbf{ T}}} = \underline{\mathbf{ R}}(\underline{\mathbf{ T}}) + \underline{\mathbf{ F}}(t),

where TRn_latitude×n_longitude\underline{\mathbf{ T}} \in \mathbb R^{\texttt{n\_latitude} \times \texttt{n\_longitude}} is a matrix that contains all point-wise values of temperature, R(T)Rn_latitude×n_longitude\underline{\mathbf{ R}}(\underline{\mathbf{ T}}) \in \mathbb R^{\texttt{n\_latitude} \times \texttt{n\_longitude}} is a matrix operator applied on the temperature matrix, F(t)Rn_latitude×n_longitude\underline{\mathbf{ F}}(t) \in \mathbb R^{\texttt{n\_latitude} \times \texttt{n\_longitude}} is the time-dependent matrix containing the sources and sinks of the method, and we use the dot operator to denote the time derivative term.


Created by Gregor Gassner and Andrés Rueda-Ramírez with contributions by Simone Chiocchetti, Daniel Bach, Sophia Horak, Philipp Baasch, Benjamin Bolm, Erik Faulhaber, and Luca Sommer. Last modified: April 02, 2026. Website built with Franklin.jl and the Julia programming language.