In this course, I will rely heavily on examples that incorporate scientific programming. Some lecture slides will contain embedded Python and/or R code to help illustrate different concepts. Programming will also be helpful when completing your assignments. However, programming experience is not a prerequisite for this course.
Programming Languages
Just as English, Mandarin, Punjabi, or any other language could be used to explain climate change; Python, R, JavaScript, or any other programming language can all be used to quantify and visualize the scale of the problem. There are a number of different options when it comes to programming languages. Each have their pro’s and cons. In this course, I encourage you to use either Python or R, but if you already know another language (e.g., MATLAB) you could use that instead.
Python
Python is my personal preference. I like python because its very flexible, general-purpose programming language that is fairly easy to read / write. It is well suited for scientific programming and has lots of packages for data analysis and visualization, and it’s completely free! If you want to install Python on your own computer and don’t know where to start, I suggest you go with Anaconda. Its a scientific programming platform that will install python for you along with most of the commonly used extensions.
R
R is also a great option. It is a programming language that was developed specifically for statistical computing and graphics. This means its not a flexible as a langue like Python, but also that it can be a bit easier to use “out of the box” for specific applications, like data visualization. Personally, I find R a bit harder to read/write, but it is still fairly straightforward once you get a handle on the syntax. One advantage R has over python, is that its a bit easier to install. All you need to do to get setup is to install R and RStudio.
Online Access
UBC also provides students with free server space that you can use at https://ubc.syzygy.ca/. This isn’t necessarily a viable long-term option for all your computing needs because it does come withe some storage limitations. However, it already comes with both Python and R installed, and will probably be sufficient for most things we’ll do in this course. So you can use it to try things out without installing anything on your own computer.
List of Equations
A list of important equations used in the course.
- Note these are listed in no particular order - they’re just scarped from the site and collated here for your reference.
Albedo
\[
albedo = \alpha_{SW} = \frac{SW_{\uparrow}}{SW_{\downarrow}}
\tag{1}\]
Beers Law
\[
R_z = R_0 e^{-z\mu}
\tag{2}\]
LE Bowen
\[
LE = \frac{R_n-G}{1+B}
\tag{3}\]
H Bowen
\[
H = \frac{R_n-G}{1+B^{-1}}
\tag{4}\]
Bowen Ratio
\[
B = \frac{H}{LE}
\tag{5}\]
Bulk Transmissivity
\[
SW_\downarrow = I_{ex} \Psi_a^{m}
\tag{6}\]
Conservation Equation Radiation
\[
\zeta_\lambda + \Psi_\lambda + \alpha_\lambda = 1
\tag{7}\]
Conservation Law Scalar 1D
\[
\frac{dc}{dt} = \frac{\partial c}{\partial t} + w \frac{\partial c}{\partial z}
\tag{8}\]
Conservation Law Scalar Homogeneous 2
\[
\frac{dc}{dt} = \frac{\partial c}{\partial t} \color{white}{+ u \frac{\partial c}{\partial x} + v \frac{\partial c}{\partial y}} + w \frac{\partial c}{\partial z}
\tag{9}\]
Conservation Law Scalar Homogeneous
\[
\frac{dc}{dt} = \frac{\partial c}{\partial t} \color{gray}{+ u \frac{\partial c}{\partial x} + v \frac{\partial c}{\partial y}} + w \frac{\partial c}{\partial z}
\tag{10}\]
Conservation Law Scalar
\[
\frac{dc}{dt} = \frac{\partial c}{\partial t} + u \frac{\partial c}{\partial x} + v \frac{\partial c}{\partial y} + w \frac{\partial c}{\partial z}
\tag{11}\]
Conservation Law Simplified
\[
In - Out = \Delta S
\tag{12}\]
Cosine Law of Illumination
\[
R_s = R_p cos(Z)
\tag{13}\]
Damping Depth
\[
D = \sqrt{\small\frac{2K}{\omega}} = \sqrt{\small\frac{KP}{\pi}}
\tag{14}\]
Energy of Photon
\[
e = hv
\tag{15}\]
Adjusted Constant
\[
\begin{eqnarray}(\frac{R_{av}}{R})^2 = & 1.00011+0.034221\cos(\gamma)+0.001280\sin(\gamma)+\\ &0.000819\cos(2\gamma)+0.000077\sin(2\gamma)\end{eqnarray}
\tag{17}\]
Fouriers Law
\[
H_G = -k \small\frac{T_2 - T_1}{z_2 - z_1}
\tag{18}\]
Frequency
\[
v=\frac{c}{\lambda}
\tag{19}\]
Heat Capacity Soil
\[
C_{s}=C_{m}\theta_{m}+C_{o}\theta_{o}+C_{w}\theta_{w}+C_{a}\theta_{a}
\tag{20}\]
Heat Sharing
\[
\frac{H_g}{H} = \frac{\mu_g}{\mu_a}
\tag{21}\]
Ideal Gas Law
\[
PV=nRT
\tag{22}\]
Kelvin
\[
T(K) = T(\deg C) + 273.15
\tag{23}\]
Kirchhoffs Law
\[
\zeta_{\lambda} = \epsilon_{\lambda}
\tag{24}\]
Longwave Radiation Balance
\[
\zeta_{LW} + \alpha_{LW} = 1
\tag{25}\]
Longwave Reflectivity
\[
\alpha_{LW} = 1 - \epsilon_{LW}
\tag{26}\]
Latent Heat Vaporization
\[
L_v = 2500.8-2.36T-0.0016T^2-0.00006T^3
\tag{27}\]
Log Wind Law Non Neutral
\[
\frac{\Delta\bar{u_z}}{\Delta z}=\frac{u_*}{k}\Phi_M
\tag{28}\]
Phi
\[
\Phi_M = \begin{cases} \zeta > 0 , 1 + 4.7 \zeta \\ \zeta = 0 , 1 \\ \zeta < 0 , (1 - 15 \zeta)^{-0.25}\end{cases}
\tag{29}\]
Log Wind Law
\[
\bar{u_z}=\frac{u_*}{k}ln(\frac{z}{z_0})
\tag{30}\]
Long wave Flux Density Stefan Boltzman
\[
LW^* = LW\downarrow - \epsilon_{LW}\sigma_b T_s^4 -(1-\epsilon_{LW})LW\downarrow
\tag{31}\]
Long wave Flux Density
\[
LW^* = LW\downarrow - LW\uparrow
\tag{32}\]
NDVI
\[
NDVI = \frac{NIR-Red}{NIR+Red}
\tag{33}\]
Absorbed SW
\[
SW^* = SW \downarrow (1 - \alpha)
\tag{34}\]
Net Absorbed Emitted LW
\[
LW^* = \epsilon LW \downarrow - \epsilon \sigma_b T_s^4
\tag{35}\]
Net Radiation Energy Balance
\[
R_n = SW \downarrow (1 - \alpha) + \epsilon LW \downarrow - \epsilon \sigma_b T_s^4
\tag{36}\]
Net Radiation Short
\[
R_n = SW^* + LW^*
\tag{37}\]
Net Radiation
\[
R_n = (SW \downarrow - SW \uparrow) + (LW \downarrow - LW \uparrow)
\tag{38}\]
Obukhov Length
\[
\begin{align}& \zeta = \frac{z}{L} \\ \nonumber& L = - \frac{\bar{\theta_v} u_*^3}{kg\overline{w^{\prime}\theta_v^{\prime}}} = - \frac{\bar{\rho c_a \theta_v} u_*^3}{kgH}\end{align}
\tag{39}\]
Phase Shifted Sinusoidal Temperature Wave
\[
T_{(z,t)}=\overline{T_o}+\Delta T_o e^{-z(\small\frac{\omega}{2K})^{1/2}} \sin(\omega t - (\small\frac{\omega}{2K})^{1/2}z)
\tag{40}\]
Planks Law
\[
E = \frac{2*h*c}{\lambda^{5}}*\frac{1}{e^{\frac{h*c}{\lambda*\sigma_b*T}}-1}
\tag{41}\]
Potential Temperature
\[
\theta = T_z + DALR z
\tag{42}\]
Prata
\[
\epsilon_a = [1-(1+zeta)\exp{-(a+b\zeta)^{0.5}}]
\tag{43}\]
Radiation Balance Air.qmd
\[
\Delta R_{n(\Delta z)}=R_{n(z+\Delta z)}-R_{n(z)}=C_a(\frac{\Delta T_a}{\Delta t})_R \Delta z
\tag{44}\]
Reflectivity
\[
\alpha_\lambda = \frac{\lambda_{reflected}}{\lambda_{incident}}
\tag{45}\]
Reflectance Coefficient
\[
\alpha_{\lambda_1 \rightarrow \lambda_2} = \frac{\int_{\lambda_1}^{\lambda_2}\alpha_\lambda I_\lambda d_\lambda}{\int_{\lambda_1}^{\lambda_2}I_\lambda d_\lambda}
\tag{46}\]
Relative Humidity
\[
RH=\frac{P_v}{P_v^*}
\tag{47}\]
Reynolds Decomposition
\[
\begin{align}\bar{a^{\prime}} = 0 \nonumber \\\bar{a }\times \bar{b^{\prime}} = 0 \nonumber \\\overline{a \times b} =\overline{(\bar{a}+a^{\prime})\times(\bar{b}+b^{\prime})} = \bar{a}\times\bar{b} + \overline{a^{\prime}\times b^{\prime}}\end{align}
\tag{48}\]
Reynolds Decomposition
\[
a(t) = \bar{a} + a^{\prime}(t)
\tag{49}\]
Mean
\[
\bar{a} = \small\frac{1}{N}\sum_{i=0}^{N-1}a(t_i)
\tag{50}\]
Shear Stress
\[
\tau = \mu\small\frac{\delta u}{\delta z}
\tag{51}\]
Sinusoidal Temperature Wave
\[
T_{(o,t)}=\overline{T_o}+\Delta T_o \sin(\omega t)
\tag{52}\]
Soil Heat Flux Divergence
\[
\small\frac{\Delta T_s}{\Delta t} = -\small\frac{1}{C_s}\small\frac{\Delta H_g}{\Delta z}
\tag{53}\]
Soil Heat Flux
\[
\frac{H_g}{z} = C_{s} \frac{\Delta T_{s}}{\Delta t}
\tag{54}\]
Soil Volume Fractions
\[
\theta_a+\theta_w+\theta_g = 1
\tag{55}\]
Soil Volume Fractions
\[
\theta_P = \theta_a + \theta_w = 1 - \theta_g
\tag{56}\]
Organic Mineral
\[
\theta_g = \theta_m + \theta_o
\tag{57}\]
Solar Declination
\[
\begin{eqnarray}\delta = & 0.006918 - 0.399912 \cos( \gamma)+0.070257 \sin( \gamma) \\ & -0.006758 \cos(2 \gamma) + 0.000907\sin(2\gamma) \nonumber \\ & -0.002697\cos(3\gamma)+0.00148 \sin(3\gamma) \nonumber \end{eqnarray}
\tag{58}\]
Fractional Year
\[
\gamma = \frac{2 \pi }{365} (DOY-1)
\tag{59}\]
Solar Zenith
\[
\cos(Z) = \sin(\beta) = \sin(\Phi)\sin(\delta)+\cos(\Phi)\cos(\delta)\cos(h)
\tag{60}\]
Hour Angle
\[
h = 15^{\circ}(12-LAT)
\tag{61}\]
Stefan Boltzman Law Grey Body Adjusted
\[
E_g = \epsilon\sigma_b T^4 + (1-\epsilon) * (SW\downarrow+LW\downarrow)
\tag{62}\]
Stefan Boltzman Law Grey Body
\[
E_g = \epsilon\sigma_b T^4
\tag{63}\]
Stefan Boltzman Law
\[
E_b = \sigma_b T^4
\tag{64}\]
Surface Energy Balance Ice
\[
\color{orange}{R_n} = \color{red}{H} + \color{blue}{LE} + \color{green}{\Delta S} + \color{grey}{\Delta M}
\tag{65}\]
Surface Energy Balance No Mass
\[
\color{orange}{R_n} = \color{red}{H} + \color{blue}{LE} + \color{purple}{G}
\tag{66}\]
Surface Energy Balance Storage
\[
\color{orange}{R_n} = \color{red}{H} + \color{blue}{LE} + \color{purple}{G} + \color{green}{\Delta S}
\tag{67}\]
Surface Energy Balance
\[
R_n = H + LE + G + \Delta S
\tag{68}\]
Tetens
\[
P_v^* = 6.112\exp{17.62\frac{T_a}{243.12+T_a}}
\tag{69}\]
Thermal Admittance v Temperature
\[
\Delta T_s = \frac{\Delta H_g}{\mu}
\tag{70}\]
Thermal Admittance
\[
\mu = \sqrt{k C}
\tag{71}\]
Thermal Diffusivity
\[
K = \frac{k}{C}
\tag{72}\]
LMST
\[
LMST = (TZ) + (\lambda-TZ_{m})\frac{4}{60}
\tag{73}\]
LAT
\[
LAT = LMST-\Delta LAT
\tag{74}\]
Delta LAT
\[
\begin{eqnarray}\Delta LAT = & 229.18[0.000075+0.001868\cos(\gamma)-0.032077\sin(\gamma) \\ & -0.014615\cos(2\gamma)-0.040849\sin(2\gamma)]\end{eqnarray}
\tag{75}\]
MKE
\[
\frac{MKE}{m}=\frac{1}{2}(\overline{u^2}+\overline{v^2}+\overline{w^2})
\tag{76}\]
TKE
\[
e=\frac{1}{2}(u^{\prime2}+v^{\prime2}+w^{\prime2}) \nonumber
\tag{77}\]
Turbulence Intensities
\[
\begin{align}I_u = \small\frac{\sigma_u}{M} \nonumber \\ I_v = \small\frac{\sigma_v}{M} \nonumber \\ I_w = \small\frac{\sigma_w}{M} \nonumber \\ M = \sqrt{\bar{u^2} + \bar{v^2} + \bar{w^2}}\end{align}
\tag{78}\]
Variances
\[
\overline{a^{\prime2}} = \frac{1}{N}\sum_{i=0}^{N-1}a^{\prime2}(t_i)
\tag{79}\]
std
\[
\sigma_a=\sqrt{\overline{a^{\prime2}}}
\tag{80}\]
Virtual Temperature
\[
T_v = (1 + 0.61 r_v - r_l) T
\tag{81}\]
Weins Law
\[
\lambda_{max} = \frac{b}{T}
\tag{82}\]
Wind Power
\[
U = \frac{\pi}{2}\rho E R^2 \bar{u}^3
\tag{83}\]