This demo steps the grey radiation code forward in time to get a radiative equilibrium profile. In addition, the Simple Physics module is available to add a boundary layer and large scale condensation.
This notebook shows how to configure Simple Physics to only provide those tendency terms that are needed for the simulation. In the first example below, large scale condensation is switched off, and in the second it is switched on. This makes a difference in the final profiles obtained: with large scale condensation, the boundary layer temperatures are warmer, and the vapour profile is significantly changed.
In [1]:
%matplotlib notebook
import numpy as np
import climt
from climt.simple_physics_custom import simple_physics_custom
# Federation
kwargs = {}
kwargs['beta'] = 1.
#Initialise radiation
rad = climt.radiation(scheme='newgreygas', **kwargs)
#Initialise simple physics
kwargs = {}
#kwargs['qflux'] = False
#kwargs['tflux'] = False
#kwargs['lsc'] = False
kwargs['use_ext_ts'] = True
kwargs['dt'] = 1200.
solar_in = 500.
Ts = (solar_in/5.67e-8)**0.25*np.ones((1,1))
kwargs['Ts'] = Ts
phys = simple_physics_custom(**kwargs)
In [2]:
#Initialise federation
kwargs = {}
kwargs['MonitorFields'] = ['T','U','q']
T = np.zeros((1,1,rad.nlev)) + (solar_in/2./5.67e-8)**0.25
U = 10.*np.ones((1,1,rad.nlev))
kwargs['dt'] = 1200.
kwargs['T'] = T
kwargs['U'] = U
kwargs['Ts'] = Ts
print Ts
In [3]:
fed = climt.federation(rad, phys, **kwargs)
for i in range(30000):
fed.step()
In [ ]:
import matplotlib.pyplot as plt
plt.figure()
# Federation
kwargs = {}
#Initialise radiation
rad = climt.radiation(scheme='newgreygas', **kwargs)
#Initialise simple physics
kwargs = {}
#kwargs['qflux'] = False
#kwargs['tflux'] = False
#kwargs['lsc'] = False
kwargs['use_ext_ts'] = True
kwargs['dt'] = 1200.
solar_in = 500.
Ts = (solar_in/5.67e-8)**0.25*np.ones((1,1))
kwargs['Ts'] = Ts
phys = simple_physics_custom(**kwargs)
In [ ]:
# Initialise federation
kwargs = {}
kwargs['MonitorFields'] = ['T','U','q']
T = np.zeros((1,1,rad.nlev)) + (solar_in/2./5.67e-8)**0.25
U = 10.*np.ones((1,1,rad.nlev))
kwargs['dt'] = 1200.
kwargs['T'] = T
kwargs['U'] = U
kwargs['Ts'] = Ts
print Ts
In [ ]:
fed = climt.federation(rad, phys, **kwargs)
for i in range(30000):
fed.step()