24 """Create an idealised 90-level atmosphere up to 20 km."""
26 z = np.linspace(0, 20000, nz)
27 time = np.array([0., 3600.])
29 T = np.broadcast_to(290. - z * 0.0065, (2, nz))
30 qv = np.broadcast_to(0.01 * np.exp(-z / 3000.), (2, nz))
34 tke = np.zeros((2, nz))
38 'Zs': (
'time', np.array([0., 0.])),
39 'zh': ((
'time',
'z'), np.broadcast_to(z, (2, nz))),
40 'orog': (
'time', np.array([0., 0.])),
41 'Ps': (
'time', np.array([101325., 101325.])),
42 'Ts': (
'time', np.array([290., 290.])),
43 'T': ((
'time',
'z'), T),
44 'qv': ((
'time',
'z'), qv),
45 'u': ((
'time',
'z'), u),
46 'v': ((
'time',
'z'), v),
47 'w': ((
'time',
'z'), w),
48 'tke': ((
'time',
'z'), tke),
49 'lat': (
'time', np.array([0., 0.])),
50 'lon': (
'time', np.array([0., 0.])),
51 'ts_forc': (
'time', np.array([290., 290.])),
52 'ps_forc': (
'time', np.array([101325., 101325.])),
53 'zh_forc': ((
'time',
'z'), np.broadcast_to(z, (2, nz))),
55 coords={
'time': time,
'z': z},
72 'surface_forcing_temp':
'ts',
73 'surface_forcing_moisture':
'none',
74 'surface_forcing_wind':
'none',
75 'surface_type':
'ocean',
76 'start_date':
'2000-01-01T00:00:00',
83 """Create overview plots of the simulation."""
85 (
'T.png', [
'T'], {
'y_var':
'P'}),
86 (
'qv.png', [
'qv'], {
'y_var':
'P'}),
87 (
'qc.png', [
'qc'], {
'y_var':
'P',
'vmin': 0.,
'vmax': 5.e-5}),
88 (
'Theta.png', [
'Theta'], {
'y_var':
'P'}),
90 for filename, var_names, options
in plots:
91 fig, ax = plt.subplots()
93 vmin = options.pop(
'vmin',
None)
94 vmax = options.pop(
'vmax',
None)
96 kwargs_contourf[
'vmin'] = vmin
98 kwargs_contourf[
'vmax'] = vmax
100 options[
'kwargs_contourf'] = kwargs_contourf
101 runner.plot_evol(ax, var_names, **options)
102 if options.get(
'y_var',
'X') ==
'P':
104 filepath = os.path.join(output_dir, filename)
105 fig.savefig(filepath)
107 print(f
' Saved {filepath}')