# Main Index¶

## Week 1¶

### Day 1 – Jan. 3¶

- Day 1 assignment:
- Read Lohmann et al Chapter 1
- Install miniconda following Python notes and download and work through IPython notebook basics

### Day 2 – Jan. 5¶

sync your atsc405 repository to download the adiabatic_box.ipynb notebook:

$ git fetch origin $ git reset --hard origin/master

Start problem 1 in class, complete problems 1 and 2 over the weekend send me a url where I can download your notebook before class on Monday.

For Monday: Read through page 14/Section 1.9 in Adrian Thompkins notes and my temperature notes (for the same material without calculus, see the Stull thermo chapter from Practical meteorology)

## Week 2¶

### Day 3 – Jan. 8¶

- Go over the adiabatic_box_solution_html
- Introduce my review of the relationship between temperature and molecular kinetic energy: temperature notes
- Introduce my review of the first law of thermodynamics: internal energy notes
- For Wednesday:
- Add a cell to the dry_les notebook that uses pcolormesh to plot the temperature perturbation for the last timestep at z=800 meters for ensemble member 3.
- For discussion on Wednesday: how can we integrate \(\int_0^{Tfinal} du = \int c_v dT\) to get \(u = c_v Tfinal\) if air liquifies at 80 K?

### Day 4 – Jan. 10¶

- For Friday, read to page 18 in the Adrian Thompkins notes and my Entropy notes
- Hand in a notebook that solves the \(\theta\) inverse problem in rootfind_ipynb

### Day 5 – Jan. 12¶

- Read through page 22 of the Adrian Thompkins notes
- For Monday do the following problem on paper (link to a png file) or in a notebook (link to the notebook):
- Consider two compartments, each with a volume of 1 \(m^3\), separated by a rigid, perfectly insulating membrane.
- Initially \(T_A\) = 300 K and \(p_A\) = \(10^5\) Pa, and \(T_B\) = 100 K and \(p_B\) = \(10^3\) Pa. Suppose the membrane breaks. Find the final temperature and pressure in the 2 \(m^3\) compartment. Does the total entropy change? By how much?

## Week 3¶

### Day 6 – Jan. 15¶

- Go over the solution to the Day 5 two compartment problem: two_compartment_solution_html
- Introduce the wyominglib.py module, which reads data from the Wyoming upperair website
- For Wednesday, read Adrian Thompkins notes through page 31.
- To hand in: add cells to the skew_coords_html that use the functions in wyoming_html notebook to download a sounding and plot the temperature and dewpoint as a function of pressure on a skewT diagram. We will be using some of the simpler features of the pandas module, which is describe in more detail in the Jake Vanderplas pandas chapter

### Day 7 – Jan. 17¶

python idiom: keyword and argument unpacking

Try this in a notebook cell:

```
def tryme(a,b,c,d):
print(f'tryme got values {a}, {b}, {c}, {d}')
def tryme2(a=1,b=2):
print(f'tryme2 got values {a}, {b}')
tryme(1,2,3,4)
onestep=[1,2,3,4]
#
# argument unpacking
#
tryme(*onestep)
onedict=dict(a=5,b=6)
tryme2()
tryme2(b=7)
#
# keyword argument onpacking
#
tryme2(**onedict)
begin, *middle, end = (0, 1, 2, 3, 4, 5)
print(f'begin={begin}, middle={middle}, end={end}')
```

Review the first part of my notes on the Maxwell relations

Introduce my notes on the Clausius-Clapeyron equation and the equivalent potential temperature

For Friday read Adrian Thompkins notes through p. 38 and my Clausius-Clapeyron notes and equivalent potential temperature notes. Answer the question at the end of my equivalent potential temperature notes:

Note that this result is slightly different from the result from Thompkins. What is the difference, and where have the two derivations diverged? (i.e. what approximation does Thompkins make that the current derivation avoids?)

Put a image/pdf of your answer in your google drive folder – this one is credit/no credit – i.e. any reasonable attempt counts.

### Day 8 – Jan. 19¶

- Go over the difference between the Thompkins and Emanuel derivations of \(\theta_e\)
- Explain why entropy decreases as pressure increases in the atmosphere (answer added to bottom of equivalent potential temperature notes)
- For Monday:
- upload your version of constant_mixing_ratio_html
- Read Schroeder pp. 159-162: Schroeder pages

## Week 4¶

### Day 9 – Jan. 22¶

Go over the constant_mixing_ratio_solution_html

Install the ncar vapor program following the instructions in vapor_visualizer_html

For Wednesday read Thompkins through p. 50 and my Clausius-Clapeyron equation and the equivalent potential temperature notes. Check in a notebook that adapts the rootfind notebook to solve equation (8) of the Clausius-Clapeyron equation notes:

\[l_v = (\phi_v^* - \phi_l) T\]

For the saturation vapor pressure \(e_{sat}\) and compare with Thompkins 2.13 or 2.15 for 10 temperatures between 0 and 20 degrees C. (Hint: in this case, the temperature \(T\) is fixed, the variable you are trying to guess is the the vapor pressure \(e_{sat}\), which is buried inside \(\phi_v^*\).

### Day 10 – Jan. 24¶

- AMS presentation on python and the google cloud compute engine
- More practice with vapor
- Look at the solution notebook clausius_comparison_html
- Introduce my Scale height notes
- make a full skewT diagram with moist adiabats using moist_tephigram_html and makeSkewWet
- For Friday:
- Derive equation 7 in my Scale height notes (feel free to use the linked indefinite integral).
- Show starting from the first law that the entropy of liquid water is \(\phi_l = c_l \log(T)\), stating all your assumptions.

### Day 11 – Jan. 26¶

- go over Day 10 problems
- introduce my notes on moist static energy and wet bulb thermometer
- go over the hydrostatic_html notebook
- For Monday – do the problems at the bottom of the notebook (if you can’t finish in 3 hours, hand in what you’ve got with a cell explaining where you’re stuck.

## Week 5¶

### Day 12 – Jan. 29¶

Go over the column_vapor_html notebook

Go over my vapor notes

Review Normand’s rule and Thompkins page 37-38 using the moist_sounding_html notebook.

For Wednesday, check in a notebook that puts your sounding on a moist tephigram and draws a moist adiabat through the level of free convection, as in Thompkins Figure 3.18.

Hint: Adapt the moist_tephigram_html notebook using find_Tmoist to calculate the temperatures along the adiabat

### Day 13 – Jan. 31¶

- demo how to loop through multiple soundings on the Wyoming upperair website
- work with my cape_part1_html notebook to draw an adiabat through the LCL and LFC
- review virtual temperature (Thompkins eqn. 2.33)
- Review Normand’s construction (Thompkins Figure 2.19), stability (Thompkins Figure 3.17), CIN and CAPE Thompkins Figure 3.18 and 3.19
- For Friday, calculate the buoyancy defined by Thompkins eq. 1.61 \(B=g \left ( \frac{T_{v,a} - T_{v,env}}{T_{v_env}} \right )\) as a function of height, where \(T_{v,a}\) is the virtual temperature of the pseudoadiabat and \(T_{v,env}\) is the virtual temperature of your particular environmental sounding as a function of height using the lowest level to calculate the \(theta_e\) for the moist adiabat. Check in a notebook that extends cape_part1_html by defining the function (ok to copy code from my library), running it and plotting it vs. height

### Day 14 – Friday, Feb. 2¶

- Go over my cape_part1_solution_html
- For Monday: Read Thompkins to page 60
- Hand in a written solution to taylor_mix.pdf
- For a sounding with positive CAPE: check in a notebook with supporting files
(the hdf sounding, any functions you write) that calculates:
- the total CAPE with units
- the level of neutral buoyancy LNB (where positive area stops, Thompkins Fig. 3.19)
- the maximum updraft velocity at the LNB
- the maximum cloud top height (where positive cape = negative cape)

## Week 6¶

### Day 15 – Monday, Feb 5¶

- Go over the cape_part2_solution_html notebook
- Go over my taylor_answer.pdf
- Go over the mixing_line_calc_html notebook
- For Wednesday:
- hand in your solution to the virtual temperature question
- hand in your version of the mixing_line_calc_html that calculates mixture densities for one pressure level in your sounding
- read entrain.pdf

### Day 16 – Wed., Feb 7¶

- go over the virtual temperature question
- Introduce the entraining_plume_html notebook
- For Friday: add a cell to the entraining_plume_html notebook that plots the default sounding and \(theta_e\) vs. pressure on a skew-T plot for three different entrainment rates (0, \(2 x 10^{-4}\ s^{-1}\), and \(8 x 10^{-4}\ s^{-1}\) ). (i.e. we’re trying to reproduce Tompkins Figure 3.34)

### Day 17 – Fri., Feb 9¶

- work on entraining_plume_solution_part1_html in class
- for Monday
- finish the entraining plume notebook
- Read Thompkins through the end of chapter 3 and Chapter 4 through p. 68

## Week 7¶

### Day 18 – Wed., Feb 14¶

- work on entraining_plume_solution_part2_html in class
- introduce the convec_instability_html notebook
- For Friday – read the carnot cycle review (also see Schneider)

### Day 19 – Fri., Feb 16¶

- Go over carnot refrigerator problem
- mid-term prep
- from http://users.ictp.it/~tompkins/diploma/2011_atmos_physics_exam.pdf
- Q3: wet bulb equation
- Q8: Tephigram

- from http://users.ictp.it/~tompkins/diploma/2012_atmos_physics_exam.pdf
- Q5: convection

- Do the 2012 midterm: mid_2012.pdf

- from http://users.ictp.it/~tompkins/diploma/2011_atmos_physics_exam.pdf

## Week 8¶

### Day 20 – Mon. Feb. 26¶

- Go over the mid_2012_solutions.pdf
- Work on mid_2016.pdf
- Midterm prep – programming and math:

- Programming:
- Be able to explain what the following functions do
- searchsorted
- rootfinding using bisection

- Write a (pseudo-python) program to:
- calculate the liquid water content as a function of temperature along a moist adiabat
- calculate CAPE, updraft velocity, maximum cloud top
- calculate the buoyancy of a range of parcel mixtures

- Given the documentation on one of the a405thermo functions, explain how it works.

- Be able to explain what the following functions do
- Other thermo/math
- prove that the total water mixing ratio of a fractional mixture is the linear combination of the total water mixing ratio of the two original mixtures
- Derive the wet bulb equation starting with the moist static energy
- Explain the difference between absolute, conditional and convective instability
- Define CAPE, CIN, LNB, LFC and draw them on a sounding
- Be able do a 2nd order Taylor series expansion on a polynomial function
- Prove the the moist static energy is conserved for aidabatic ascent/descent in a hydrostatic atmosphere.

in class:

- flowchart a python program that would find the vapor pressure in a 1 liter container filled with 0.25 liters of liquid water at temperatures between 0 deg C and 500 deg C

For Wednesday – hand in a png of a tephigram that traces the following heat engine:

- pseudo-adiabatic ascent in the tropical Pacific, surface pressure = 1000 hPa, where the SST is 300 K and the relative humidity is 80%. Air rises to 400 hPa and loses 80% of its liquid water
- Cooling at a constant pressure of 400 hPa by 20 K, with no change in total water
- Descent to 1000 hPa, conserving water

Find the following:

- The change in enthalpy at the surface and at 400 hPa, including both sensible and latent heat terms.
- Find the total work done by the engine, and its efficiency.
- Find the percentage of the total heat change that is due to addition and remove of water during the cycle.

Do before class (not graded): use our thermodynamic functions to solve the problems in the thompkins_practice_html notebook.

### Day 21 – Wed. Feb. 28¶

- jupterlab announced (and also worth a look: this live demo)
- thompkins_practice_answers_html
- tropical_engine_html
- midterm_2016_sols_html

### Day 22 – Fri. Mar. 2¶

- midterm

## Week 9¶

### Day 23 – Mon. Mar. 5¶

- Review midterm_2018_sols_html
- Review my day 7 slides on Maxwell relations and recall the derivation of the Clausius-Clapeyron equation
- Go over my own kohler notes
- For Wednesday
- Read Adrian Thompkins notes to p. 73 and (same material, slightly different take) optionally Lohmann et al Chapter 6 (Kohler) to page 162
- check in a notebook called kohler.ipynb that:
- plots the Koehler curve (Thompkins equation 4.15) for the aerosol in my kohler notes eq. 6 and 7
- Uses our rootfinder to find the equilibrium radius for a haze particle at a relative humidity of 90% and a temperature of 15 deg C.

### Day 24 – Wed. Mar. 7¶

- Review my day 7 slides on Maxwell relations and recall the derivation of the Clausius-Clapeyron equation. Why does nature want \(g_l = g_v\)?
- Compare my own kohler notes to the Adrian Thompkins notes section 4.2
- Go over the kohler_html solution to the kohler rootfinder problem.
- Calculate the pressure inside a drop: internal pressure notes
- Take another look at the effect of surface tension on the enthalpy of evaporation in the surface energy notes
- For Friday:
- check in a notebook with answers to the questions in kohler_probs_html
- Read Lohmann et al Chapter 5 pp. 115-129 on aerosol size distributions and my size distribution notes

### Day 25 – Fri. Mar. 9¶

Go over kohler_sols_html

Go over the koehler stability notes

Look at Lohmann Figure 6.10 on how a cloud chamber works

For Monday read Thompkins pp. 73-76 on growth by diffusion (also covered in Lohmann Chapter 7 to p. 192)

For Monday upload written solutions to these two problems:

Given the critical supersaturation from the kohler notes:

\[SS=S^* - 1= \left ( \frac{4 a^3}{27b} \right )^{1/2}\]show that this implies, for \((NH_4)_2 SO_4\), density \(\rho_{aer}\) = 1775 \({kg}\,{m^{-3}}\) , van hoft i=3, that:

\[S^* -1 \approx 1.54 \times 10^{-12}~ m_{aer}^{-0.5}\]where \(m_{aer}\) is the ammonium sulphate aerosol mass in kg.

Note that this is why a cloud chamber can get the aerosol mass distribution from a series of saturation and light scattering measurements as smaller and smaller aerosols are pushed over their critical supersaturation and activated.

Show that the expression for second derivative of the thermodynamic potential derived in the kohler stability notes:

\[\frac{\delta ^2G}{\delta r^2} = - 4 \pi R_v T \rho_l \left [ 2 a - r^2 \left ( 1 + \frac{b}{r^3} \right ) \frac{3b}{r^4} \right ] + 8 \pi \sigma\]Changes sign from stable (positive) to unstable (negative) at \(r_{crit}\).

Hint – first show that the second derivative is zero at the critical radius. Then show that the third derivative is negative above and below the critical radius, which means that there has to be a sign change from + to -.

## Week 10¶

### Day 26 – Mon. Mar. 12¶

Go over the day25_aerosol_sol_html notebook

My handwritten solution to the Kohler stability problem (note E=G in my old notation)

My aero_dist_html notebook on aerosol size distriubtions.

For Wednesday:

Read my droplet growth notes

Hand in your version of the aero_dist_html answering the question in the last cell:

“Add a cell to this notebook that makes a plot of \(N(r)\) vs. \(S_{crit}\) for the \(n(r)\) in the previous cell, where:

\(N(r) = \int_r^\infty n(r) dr\) is the number of aerosols with dry radii larger than \(r\) and \(S_{crit}\) is the critical supersaturation at radius r for these ammonium sulphate aerosols. Explain briefly why this is the output you would expect to see from an aerosol size counter based on a cloud chamber with a laser scattering sensor.

### Day 27 – Wed. Mar. 14¶

Introduce my new Koehler equation module in dropgrowA_html

For Friday – read Lohmann pp. Ch 7 top page 197 and my equilibrium supersaturation notes

Hand in a notebook that adds the following plots to dropgrowA_html:

a plot of the ratio \(n_s/n_w\) as a function of equilibrium radius for the 30 aerosols in the mass distribution. Do this twice, once assuming that

\[n_w = 4/3 \pi r^3 \rho_l/M_w\](i.e. that the solution is so dilute that you can neglect the aerosol’s contribution to the volume of the drop.

Repeat making an exact calculation for \(n_w\) – i.e. find the part of the volume that is due to the aerosol (just its mass/(aerosol density)) and subtract that off from the drop volume before calculating \(n_w\) (assuming that the aerosol density is 1775 \(kg/m^3\)).

### Day 28 – Fri. Mar. 16¶

- For Monday, Read – Thompkins Sections 4.4-4.5 on collision coalescence

Hand in either a notebook or an image

- Assuming that cloud condensation nuclei (CCN) are removed from the atmosphere by first serving as the centers on which cloud droplets form, and the droplets subsequently grow to form precipitation particles, estimate the residence time of a CCN in a column extending from the surface of the Earth to an altitude of 5 km. Assume that the annual rainfall is 100 cm and the cloud liquid water content is 0.30 \(g/kg\) .
*Hint: Assume that all drops in the cloud have a radii of 10 microns and that every droplet contains exactly 1 CCN. How many CCN are in 1 kg of air? About how many kg of air are there in a 5 km column? About how many CCN are taken out by a rain rate of 1 m/year? Can you encode this information in a time constant of the form 1/N dN/dt = 1/tau ?* - A drop with an initial radius of 100 µm falls through a cloud containing 100 droplets per cubic centimeter that it collects in a continuous manner with a collection efficiency of 0.800. If all the cloud droplets have a radius of 10 µm, how long will it take for the drop to reach a radius of 1 mm? You may assume that for the drops of the size considered in this problem the terminal fall speed v (in \(m s^{-1}\)) of a drop of radius r (in meters) is given by \(v= 8 x 10^3\;r\). Assume that the cloud droplets are stationary and that the updraft velocity in the cloud is negligible. Hint: Integrate Thompkins equation 4.28

## Week 11¶

### Day 29 – Monday, March 19¶

- Coverage – Thompkins section 4.4 and 4.5
- Important equations/figures: why do warm clouds rain in 15 minutes?
- 4.26, 4.27, 4.29, Figure 4.22, 423

- Important equations/figures: why do warm clouds rain in 15 minutes?
- Go over drizzle flux solutions
- Where does the Marshall-Palmer distribution come from? 2009 article on the origins of the Marshall Palmer distribution Villermaux and Bossa (2009)
- Ice nucleation slides
- For Wednesday – Read Thompkins 4.6 and 4.7
- Add cells to marshallpalmer_html that do the following:
- Confirm that the mean diameter of the Marshall Palmer distribution is \(1/\Lambda\)
- Calculate the precipitation flux (mm/hr) using the Marshall Palmer size distribution and the fall speed of Villermaux and Bossa (2009): \(w = - \sqrt{\rho_l/\rho_{air} * g *D}\) where D is the drop diameter and \(\rho_l,\rho_{air}\) are the liquid and air densities. Show that you get about R=15 mm/hour back if you put in R=15 mm/hour into the size distribution.

### Day 30 – Wed., March 21¶

- Go over the `marshallpalmer_sol`_ notebook
- Start discussion of ice processes in Adrian Thompkins notes pp. 82-98
- Introduce the practice final questions

For Friday -

Read Thompkins pp. 82-98

hand in:

a png file showing your derivation of (6) in the equilibrium supersaturation notes

\[\frac{d r_v}{dt} = \left (1 + SS \right ) \left [ \frac{-\epsilon e_s}{p^2} \left ( \frac{-g p V}{R_d T} \right ) + \frac{\epsilon}{p} \left ( \frac{\epsilon e_s L}{R_d T^2} \right ) \frac{dT}{dt} \right ] + \frac{\epsilon e_s}{p} \frac{dSS}{dt}\]where \(V\) is the vertical velocity.

Add a cell to the bottom of the dropgrow_full_html that defines a function that uses (6) to find dSS/dt. Check your function by showing that it predicts the slope dSS/dt at z=1010 meters in the figure at the bottom of the notebook, given the values of \(dr_v/dt\), \(p\), \(dT/dt\) etc. at 1010 m.

### Day 31 – Fri., March 23¶

Go over Matt’s solution to dropgrow_full_predictSS_html

Introduce: Thompkins parameterization notes on model parameterization

For Monday:

Read Thompkins parameterization notes Sections 4.1 - 4.6 on cloud parameterizations

Modify dropgrow_full_predictSS_html to do the following and hand in the modified notebook:

Add a cell that defines a new version of find_derivs that adds SS as bulk variable number 4, in location deriv_vec[-4]. Note that you will need to increase the size of var_vec in the notebook by 1:

var_vec = np.empty(numrads + 4)

and initialize SS by adding the line:

var_vec[-4] = parcel.SS

where you have calculated the initial SS and added it to input_dict[‘initial_conditions’]

Note that I’ve checked in a new version of rlcalc and rlderiv:

def rlcalc(var_vec,cloud_tup,nvars=3): def rlderiv(var_vec,deriv_vec,cloud_tup,nvars=3):

You will need to call them with nvars=4 to account for the fact that you now have:

SS, temp, press, height

as the last 4 variables in var_vec

Run the model with this new set of equations – does it solve the problem of unstable aerosol activation?

## Week 12¶

### Day 32 – Mon., March 26¶

- Introduce the 2012 final exam
- Go over the explicit SS solution: mine – dropgrow_full_fourvars_html and Matt’s – dropgrow_full_predictSS_FungM_html
- How do we develop and test relative-humidity base cloud fraction parameterizations like those discusses in the Thompkins parameterization notes section 4.6? Look at the CGILS experiment data in the cgilsI_html notebook.
- For Wednesday:
- Read Thompkins chapter 4 parameterization notes through section 4.7.1
- Hand in a notebook that adds cells to cgilsI_html to:
- use pcolormesh to plot a vertical cross section of the relative humidity for along y=2 km, x= 0->5 km
- use plot to plot a vertical profile of the horizontal mean RH in for this cross section as a function of height
- use plot to plot a vertical profile of the horizontal standard deviation of RH as a function of height

### Day 33 – Wed., March 28¶

- Go over the cgilsI-solution_html notebook
- How to study using the practice final questions

### Day 34 – Wed., April 4¶

- Summer project?
- Microsoft machine learning course
- A great stats text: Statistical rethinking

- 2012 final solutions
- 2010 final with solutions
- 2016 final exam
- final_2016_solutions.pdf

### Day 35 – Fri., April 6¶

- Correction: I fixed the Day 24 kohler notes pdf which trailed off at the end. It was missing a link to the Day 25 koehler stability notes about the cloud chamber.
- Correction: The Day 23 link to the midterm_2018_sols_html should now be working.
- Addition: Question D2 in the practice final questions asks: “What is steady about steady state droplet growth?” That question refers to this problem: steady state droplet growth problem
- final_2018_takehome_html
- Three questions (see bottom of notebook)
- Individual work, any code in the course github repo is ok to use
- Due Sunday April 15, midnight.