inputs: "All these traveling weather systems tend to move warm, moist air poleward and cold, dry air equatorward. There is thus a net poleward energy transport.
A model like this needs to simulate the weather in order to model the heat transport.  
A simpler statistical approach
Let’s emphasize: the most important role for heat transport by winds and ocean currents is to more energy from where it’s WARM to where it’s COLD, thereby reducing the temperature gradient (equator to pole) from what it would be if the planet were in radiative-convective equilibrium everywhere with no north-south motion.
This is the basis for the parameterization of heat transport often used in simple climate models.
Discuss analogy with molecular heat conduction: metal rod with one end in the fire.
Define carefully temperature gradient dTs / dy
Measures how quickly the temperature  decreases as we move northward
(negative in NH, positive in SH)
In any conduction or diffusion process, the flux (transport) of a quantity is always DOWN-gradient  (from WARM to COLD).
So our parameterization will look like
$$ \mathcal{H} = -K ~ dT / dy $$
Where $K$ is some positive number “diffusivity of the climate system”.

<a id='section2'></a>
2. The temperature diffusion parameterization

Last time we wrote down an energy budget for a thin zonal band centered at latitude $\phi$:
$$ \frac{\partial E(\phi)}{\partial t} = \text{ASR}(\phi) - \text{OLR}(\phi) - \frac{1}{2 \pi a^2  \cos⁡\phi } \frac{\partial \mathcal{H}}{\partial \phi} $$
where we have written every term as an explicit function of latitude to remind ourselves that this is a local budget, unlike the zero-dimensional global budget we considered at the start of the course.
Let’s now formally introduce a parameterization that approximates the heat transport as a down-gradient diffusion process:
$$ \mathcal{H}(\phi) \approx -2 \pi a^2  \cos⁡\phi ~ D ~ \frac{\partial T_s}{\partial \phi} $$
With $D$ a parameter for the diffusivity or thermal conductivity of the climate system, a number in W m$^{-2}$..."
Please write code following the instructions in jupyter notebook style.

targets: 
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import climlab
from climlab import constants as const

#  First define an initial temperature field
#   that is warm at the equator and cold at the poles
#   and varies smoothly with latitude in between

from climlab.utils import legendre
sfc = climlab.domain.zonal_mean_surface(num_lat=90, water_depth=10.)
lat = sfc.lat.points
initial = 12. - 40. * legendre.P2(np.sin(np.deg2rad(lat)))

fig, ax = plt.subplots()
ax.plot(lat, initial)
ax.set_xlabel('Latitude')
ax.set_ylabel('Temperature (deg C)')

##  Set up the climlab diffusion process

# make a copy of initial so that it remains unmodified
Ts = climlab.Field(np.array(initial), domain=sfc)
# thermal diffusivity in W/m**2/degC
D = 0.55
# create the climlab diffusion process
#  setting the diffusivity and a timestep of ONE MONTH
d = climlab.dynamics.MeridionalHeatDiffusion(name='Diffusion', 
            state=Ts, D=D, timestep=const.seconds_per_month)
print( d)

#  We are going to step forward one month at a time
#  and store the temperature each time
niter = 5
temp = np.zeros((Ts.size, niter+1))
temp[:, 0] = np.squeeze(Ts)
for n in range(niter):
    d.step_forward()
    temp[:, n+1] = np.squeeze(Ts)

#  Now plot the temperatures
fig,ax = plt.subplots()
ax.plot(lat, temp)
ax.set_xlabel('Latitude')
ax.set_ylabel('Temperature (deg C)')
ax.legend(range(niter+1))