<jupyter_start><jupyter_text>Radiative Equilibrium with Simple Physics----------------------------------This demo steps the grey radiation code forward in time to get a radiative equilibriumprofile. In addition, the Simple Physics module is available to add a boundary layer andlarge scale condensation.This notebook shows how to configure Simple Physics to only provide those tendency termsthat are needed for the simulation. In the first example below, large scale condensationis 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 temperaturesare warmer, and the vapour profile is significantly changed.<jupyter_code>%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)
#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
fed = climt.federation(rad, phys, **kwargs)

for i in range(30000):
    fed.step()
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)
# 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
fed = climt.federation(rad, phys, **kwargs)

for i in range(30000):
    fed.step()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16441251056635672, 'fraction_numerical': 0.033389687235841084, 'mean_word_length': 4.9772727272727275, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '481974', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 859, 'n_tokens_neox': 791, 'n_words': 230, 'path': 'lib/examples/CliMT -- Radiative Equilibrium with Simple Physics.ipynb', 'repo_name': 'CliMT/climt-legacy', 'size': '2366'}