Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ok-landscape
GitHub Repository: Ok-landscape/computational-pipeline
Path: blob/main/latex-templates/templates/atmospheric-science/atmospheric_dynamics.tex
75 views
unlisted
1
\documentclass[11pt,a4paper]{article}
2
\usepackage[utf8]{inputenc}
3
\usepackage[T1]{fontenc}
4
\usepackage{amsmath,amssymb}
5
\usepackage{graphicx}
6
\usepackage{booktabs}
7
\usepackage{siunitx}
8
\usepackage{geometry}
9
\geometry{margin=1in}
10
\usepackage{pythontex}
11
\usepackage{hyperref}
12
\usepackage{float}
13
14
\title{Atmospheric Dynamics\\Geostrophic Wind and Thermal Balance}
15
\author{Department of Atmospheric Sciences}
16
\date{\today}
17
18
\begin{document}
19
\maketitle
20
21
\begin{abstract}
22
Analysis of atmospheric dynamics including geostrophic balance, thermal wind, and jet stream formation.
23
\end{abstract}
24
25
26
\section{Introduction}
27
28
Atmospheric dynamics governs weather and climate through pressure, temperature, and wind relationships.
29
30
\begin{pycode}
31
import numpy as np
32
import matplotlib.pyplot as plt
33
plt.rcParams['text.usetex'] = True
34
plt.rcParams['font.family'] = 'serif'
35
36
# Constants
37
Omega = 7.292e-5 # Earth rotation rate
38
R = 287 # Gas constant for air
39
g = 9.81 # Gravity
40
\end{pycode}
41
42
\section{Geostrophic Wind}
43
44
$u_g = -\frac{1}{f\rho}\frac{\partial p}{\partial y}$, $v_g = \frac{1}{f\rho}\frac{\partial p}{\partial x}$
45
46
\begin{pycode}
47
lat = np.linspace(10, 80, 100)
48
f = 2 * Omega * np.sin(np.radians(lat))
49
50
# Pressure gradient (typical mid-latitude)
51
dp_dy = 1e-3 # Pa/m
52
rho = 1.2 # kg/m^3
53
54
u_g = -dp_dy / (f * rho)
55
56
fig, ax = plt.subplots(figsize=(10, 6))
57
ax.plot(lat, u_g, 'b-', linewidth=2)
58
ax.set_xlabel('Latitude (degrees)')
59
ax.set_ylabel('Geostrophic Wind Speed (m/s)')
60
ax.set_title('Geostrophic Wind vs Latitude')
61
ax.grid(True, alpha=0.3)
62
plt.tight_layout()
63
plt.savefig('geostrophic_wind.pdf', dpi=150, bbox_inches='tight')
64
plt.close()
65
\end{pycode}
66
67
\begin{figure}[H]
68
\centering
69
\includegraphics[width=0.85\textwidth]{geostrophic_wind.pdf}
70
\caption{Geostrophic wind speed dependence on latitude.}
71
\end{figure}
72
73
\section{Thermal Wind}
74
75
\begin{pycode}
76
p_levels = np.array([1000, 850, 700, 500, 300, 200])
77
T_profile = np.array([288, 278, 268, 253, 228, 218])
78
79
# Temperature gradient
80
dT_dy = -2e-6 # K/m (typical)
81
phi = 45 # Latitude
82
f_45 = 2 * Omega * np.sin(np.radians(phi))
83
84
# Thermal wind shear
85
du_dz = -(g / (f_45 * T_profile)) * dT_dy
86
z = np.array([0, 1.5, 3, 5.5, 9, 12]) # km
87
88
fig, ax = plt.subplots(figsize=(10, 6))
89
ax.plot(du_dz * 1000, z, 'b-o', linewidth=1.5, markersize=8)
90
ax.set_xlabel('Wind Shear (m/s per km)')
91
ax.set_ylabel('Altitude (km)')
92
ax.set_title('Thermal Wind Shear Profile')
93
ax.grid(True, alpha=0.3)
94
plt.tight_layout()
95
plt.savefig('thermal_wind.pdf', dpi=150, bbox_inches='tight')
96
plt.close()
97
\end{pycode}
98
99
\begin{figure}[H]
100
\centering
101
\includegraphics[width=0.85\textwidth]{thermal_wind.pdf}
102
\caption{Thermal wind shear as function of altitude.}
103
\end{figure}
104
105
\section{Rossby Number}
106
107
$Ro = \frac{U}{fL}$
108
109
\begin{pycode}
110
U = 10 # Typical wind speed m/s
111
L = np.logspace(3, 7, 100) # Length scales
112
113
Ro_30 = U / (2 * Omega * np.sin(np.radians(30)) * L)
114
Ro_60 = U / (2 * Omega * np.sin(np.radians(60)) * L)
115
116
fig, ax = plt.subplots(figsize=(10, 6))
117
ax.loglog(L/1000, Ro_30, label='30$^\\circ$N', linewidth=1.5)
118
ax.loglog(L/1000, Ro_60, label='60$^\\circ$N', linewidth=1.5)
119
ax.axhline(y=1, color='r', linestyle='--', label='Ro = 1')
120
ax.set_xlabel('Length Scale (km)')
121
ax.set_ylabel('Rossby Number')
122
ax.set_title('Rossby Number vs Length Scale')
123
ax.legend()
124
ax.grid(True, alpha=0.3, which='both')
125
plt.tight_layout()
126
plt.savefig('rossby_number.pdf', dpi=150, bbox_inches='tight')
127
plt.close()
128
\end{pycode}
129
130
\begin{figure}[H]
131
\centering
132
\includegraphics[width=0.85\textwidth]{rossby_number.pdf}
133
\caption{Rossby number for different latitudes and scales.}
134
\end{figure}
135
136
\section{Jet Stream}
137
138
\begin{pycode}
139
lat_jet = np.linspace(20, 70, 100)
140
z_jet = np.linspace(0, 15, 50)
141
LAT, Z = np.meshgrid(lat_jet, z_jet)
142
143
# Simplified jet stream model
144
U_jet = 40 * np.exp(-((LAT - 45)**2/100)) * np.exp(-((Z - 10)**2/10))
145
146
fig, ax = plt.subplots(figsize=(12, 6))
147
cs = ax.contourf(LAT, Z, U_jet, levels=20, cmap='jet')
148
plt.colorbar(cs, label='Wind Speed (m/s)')
149
ax.set_xlabel('Latitude (degrees)')
150
ax.set_ylabel('Altitude (km)')
151
ax.set_title('Jet Stream Wind Speed')
152
plt.tight_layout()
153
plt.savefig('jet_stream.pdf', dpi=150, bbox_inches='tight')
154
plt.close()
155
\end{pycode}
156
157
\begin{figure}[H]
158
\centering
159
\includegraphics[width=0.9\textwidth]{jet_stream.pdf}
160
\caption{Cross-section of jet stream wind speed.}
161
\end{figure}
162
163
\section{Potential Vorticity}
164
165
\begin{pycode}
166
theta = np.linspace(280, 350, 100) # Potential temperature
167
f_pv = 1e-4
168
dtheta_dp = -0.1 # K/Pa
169
170
PV = -g * f_pv * dtheta_dp * np.ones_like(theta)
171
172
fig, ax = plt.subplots(figsize=(10, 6))
173
ax.plot(theta, PV * 1e6, 'b-', linewidth=2)
174
ax.set_xlabel('Potential Temperature (K)')
175
ax.set_ylabel('PV (PVU)')
176
ax.set_title('Potential Vorticity')
177
ax.grid(True, alpha=0.3)
178
plt.tight_layout()
179
plt.savefig('potential_vorticity.pdf', dpi=150, bbox_inches='tight')
180
plt.close()
181
\end{pycode}
182
183
\begin{figure}[H]
184
\centering
185
\includegraphics[width=0.85\textwidth]{potential_vorticity.pdf}
186
\caption{Potential vorticity on isentropic surfaces.}
187
\end{figure}
188
189
\section{Ekman Spiral}
190
191
\begin{pycode}
192
z_ek = np.linspace(0, 2000, 100)
193
K = 10 # Eddy diffusivity
194
f_ek = 1e-4
195
delta = np.sqrt(2 * K / f_ek)
196
197
u_ek = 10 * (1 - np.exp(-z_ek/delta) * np.cos(z_ek/delta))
198
v_ek = 10 * np.exp(-z_ek/delta) * np.sin(z_ek/delta)
199
200
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
201
ax1.plot(u_ek, z_ek, 'b-', linewidth=2, label='u')
202
ax1.plot(v_ek, z_ek, 'r-', linewidth=2, label='v')
203
ax1.set_xlabel('Wind Speed (m/s)')
204
ax1.set_ylabel('Height (m)')
205
ax1.set_title('Ekman Layer Wind Profile')
206
ax1.legend()
207
ax1.grid(True, alpha=0.3)
208
209
ax2.plot(u_ek, v_ek, 'b-', linewidth=1.5)
210
ax2.plot(u_ek[0], v_ek[0], 'go', markersize=10)
211
ax2.set_xlabel('u (m/s)')
212
ax2.set_ylabel('v (m/s)')
213
ax2.set_title('Ekman Spiral')
214
ax2.grid(True, alpha=0.3)
215
ax2.axis('equal')
216
plt.tight_layout()
217
plt.savefig('ekman_spiral.pdf', dpi=150, bbox_inches='tight')
218
plt.close()
219
\end{pycode}
220
221
\begin{figure}[H]
222
\centering
223
\includegraphics[width=0.95\textwidth]{ekman_spiral.pdf}
224
\caption{Ekman layer wind profile and spiral.}
225
\end{figure}
226
227
\section{Results}
228
229
\begin{pycode}
230
print(r'\begin{table}[H]')
231
print(r'\centering')
232
print(r'\caption{Atmospheric Parameters at 45$^\circ$N}')
233
print(r'\begin{tabular}{@{}lc@{}}')
234
print(r'\toprule')
235
print(r'Parameter & Value \\')
236
print(r'\midrule')
237
print(f'Coriolis parameter & {f_45:.2e} s$^{{-1}}$ \\\\')
238
print(f'Ekman depth & {delta:.0f} m \\\\')
239
print(f'Rossby deformation radius & $\\sim$1000 km \\\\')
240
print(r'\bottomrule')
241
print(r'\end{tabular}')
242
print(r'\end{table}')
243
\end{pycode}
244
245
\section{Conclusions}
246
247
Atmospheric dynamics is governed by the balance between pressure gradient, Coriolis, and frictional forces.
248
249
250
\end{document}
251
252