Note
Go to the end to download the full example code.
Gill Model: Delta Heating at y = 1¶
This example applies an idealized delta-function heating source at y = 1.
The horizontal and vertical diagnostics highlight the circulation forced by
this narrowly localized meridional heating.
import numpy as np
from easyclimate.field.simulation.gill import (
simulate,
plot_snapshot,
plot_cross_sections,
)
Run the delta-heating experiment at y = 1.
result_delta_y1 = simulate(case = "gill_delta_y1")
result_delta_y1
<xarray.Dataset> Size: 313kB
Dimensions: (y: 61, x: 128, y_staggered: 60, z: 20)
Coordinates:
* y (y) float64 488B -7.725 -7.468 -7.21 ... 7.21 7.468 7.725
* x (x) float64 1kB -12.57 -12.27 -11.98 ... 24.25 24.54 24.84
* y_staggered (y_staggered) float64 480B -7.725 -7.468 -7.21 ... 7.21 7.468
* z (z) float64 160B 0.0 0.1653 0.3307 0.496 ... 2.811 2.976 3.142
Data variables:
q (y, x) float64 62kB 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0
eta (y, x) float64 62kB 3.855e-05 3.848e-05 ... -4.069e-05
u (y, x) float64 62kB 2.131e-05 2.13e-05 ... -1.813e-05
v (y, x) float64 62kB -9.746e-05 -9.746e-05 ... 6.98e-05 6.98e-05
v_staggered (y_staggered, x) float64 61kB -0.0001949 ... 0.0001396
Attributes: (12/17)
case: gill_delta_y1
case_label: Gill: delta heating at y = 1
short_name: Gill_sym_delta
t: 50.0
nt: 500
nx: 128
... ...
damping: 0.1
kernel: reyon
dt: 0.1
dx: 0.2945243112740431
dy: 0.25750759455654043
dz: 0.16534698176788384xarray.Dataset
- y: 61
- x: 128
- y_staggered: 60
- z: 20
- y(y)float64-7.725 -7.468 -7.21 ... 7.468 7.725
array([-7.725228, -7.46772 , -7.210213, -6.952705, -6.695197, -6.43769 , -6.180182, -5.922675, -5.665167, -5.407659, -5.150152, -4.892644, -4.635137, -4.377629, -4.120122, -3.862614, -3.605106, -3.347599, -3.090091, -2.832584, -2.575076, -2.317568, -2.060061, -1.802553, -1.545046, -1.287538, -1.03003 , -0.772523, -0.515015, -0.257508, 0. , 0.257508, 0.515015, 0.772523, 1.03003 , 1.287538, 1.545046, 1.802553, 2.060061, 2.317568, 2.575076, 2.832584, 3.090091, 3.347599, 3.605106, 3.862614, 4.120122, 4.377629, 4.635137, 4.892644, 5.150152, 5.407659, 5.665167, 5.922675, 6.180182, 6.43769 , 6.695197, 6.952705, 7.210213, 7.46772 , 7.725228]) - x(x)float64-12.57 -12.27 ... 24.54 24.84
array([-12.566371, -12.271846, -11.977322, -11.682798, -11.388273, -11.093749, -10.799225, -10.5047 , -10.210176, -9.915652, -9.621128, -9.326603, -9.032079, -8.737555, -8.44303 , -8.148506, -7.853982, -7.559457, -7.264933, -6.970409, -6.675884, -6.38136 , -6.086836, -5.792311, -5.497787, -5.203263, -4.908739, -4.614214, -4.31969 , -4.025166, -3.730641, -3.436117, -3.141593, -2.847068, -2.552544, -2.25802 , -1.963495, -1.668971, -1.374447, -1.079922, -0.785398, -0.490874, -0.19635 , 0.098175, 0.392699, 0.687223, 0.981748, 1.276272, 1.570796, 1.865321, 2.159845, 2.454369, 2.748894, 3.043418, 3.337942, 3.632467, 3.926991, 4.221515, 4.516039, 4.810564, 5.105088, 5.399612, 5.694137, 5.988661, 6.283185, 6.57771 , 6.872234, 7.166758, 7.461283, 7.755807, 8.050331, 8.344855, 8.63938 , 8.933904, 9.228428, 9.522953, 9.817477, 10.112001, 10.406526, 10.70105 , 10.995574, 11.290099, 11.584623, 11.879147, 12.173672, 12.468196, 12.76272 , 13.057244, 13.351769, 13.646293, 13.940817, 14.235342, 14.529866, 14.82439 , 15.118915, 15.413439, 15.707963, 16.002488, 16.297012, 16.591536, 16.886061, 17.180585, 17.475109, 17.769633, 18.064158, 18.358682, 18.653206, 18.947731, 19.242255, 19.536779, 19.831304, 20.125828, 20.420352, 20.714877, 21.009401, 21.303925, 21.598449, 21.892974, 22.187498, 22.482022, 22.776547, 23.071071, 23.365595, 23.66012 , 23.954644, 24.249168, 24.543693, 24.838217]) - y_staggered(y_staggered)float64-7.725 -7.468 -7.21 ... 7.21 7.468
array([-7.725228, -7.46772 , -7.210213, -6.952705, -6.695197, -6.43769 , -6.180182, -5.922675, -5.665167, -5.407659, -5.150152, -4.892644, -4.635137, -4.377629, -4.120122, -3.862614, -3.605106, -3.347599, -3.090091, -2.832584, -2.575076, -2.317568, -2.060061, -1.802553, -1.545046, -1.287538, -1.03003 , -0.772523, -0.515015, -0.257508, 0. , 0.257508, 0.515015, 0.772523, 1.03003 , 1.287538, 1.545046, 1.802553, 2.060061, 2.317568, 2.575076, 2.832584, 3.090091, 3.347599, 3.605106, 3.862614, 4.120122, 4.377629, 4.635137, 4.892644, 5.150152, 5.407659, 5.665167, 5.922675, 6.180182, 6.43769 , 6.695197, 6.952705, 7.210213, 7.46772 ]) - z(z)float640.0 0.1653 0.3307 ... 2.976 3.142
array([0. , 0.165347, 0.330694, 0.496041, 0.661388, 0.826735, 0.992082, 1.157429, 1.322776, 1.488123, 1.65347 , 1.818817, 1.984164, 2.149511, 2.314858, 2.480205, 2.645552, 2.810899, 2.976246, 3.141593])
- q(y, x)float640.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
array([[0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], ..., [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.]], shape=(61, 128)) - eta(y, x)float643.855e-05 3.848e-05 ... -4.069e-05
array([[ 3.85479618e-05, 3.84824133e-05, 3.84139904e-05, ..., 3.87294870e-05, 3.86714163e-05, 3.86110306e-05], [-5.04926462e-05, -5.06005507e-05, -5.07175281e-05, ..., -5.02141594e-05, -5.02998973e-05, -5.03922544e-05], [ 5.89632809e-06, 5.63969893e-06, 5.35941604e-06, ..., 6.54804073e-06, 6.34927699e-06, 6.13322108e-06], ..., [ 7.74408809e-05, 7.71842518e-05, 7.69039689e-05, ..., 7.80925936e-05, 7.78938298e-05, 7.76777739e-05], [ 4.40436694e-05, 4.39357649e-05, 4.38187875e-05, ..., 4.43221562e-05, 4.42364184e-05, 4.41440613e-05], [-4.07521661e-05, -4.08177146e-05, -4.08861375e-05, ..., -4.05706410e-05, -4.06287116e-05, -4.06890973e-05]], shape=(61, 128)) - u(y, x)float642.131e-05 2.13e-05 ... -1.813e-05
array([[ 2.13051537e-05, 2.13002977e-05, 2.12916094e-05, ..., 2.13018434e-05, 2.13056635e-05, 2.13070165e-05], [ 1.49175023e-05, 1.48346052e-05, 1.47428906e-05, ..., 1.51219593e-05, 1.50606899e-05, 1.49929485e-05], [-6.15688516e-06, -6.39082524e-06, -6.64674098e-06, ..., -5.56664971e-06, -5.74597024e-06, -5.94176400e-06], ..., [ 4.11964276e-05, 4.09624875e-05, 4.07065718e-05, ..., 4.17866631e-05, 4.16073425e-05, 4.14115488e-05], [-1.58811517e-05, -1.59640488e-05, -1.60557634e-05, ..., -1.56766947e-05, -1.57379641e-05, -1.58057055e-05], [-1.81328783e-05, -1.81377344e-05, -1.81464226e-05, ..., -1.81361886e-05, -1.81323685e-05, -1.81310155e-05]], shape=(61, 128)) - v(y, x)float64-9.746e-05 -9.746e-05 ... 6.98e-05
array([[-9.74643460e-05, -9.74624606e-05, -9.74594976e-05, ..., -9.74708377e-05, -9.74685678e-05, -9.74669436e-05], [-1.50306166e-05, -1.50226944e-05, -1.50108471e-05, ..., -1.50569037e-05, -1.50478354e-05, -1.50409981e-05], [ 7.70904780e-05, 7.71128607e-05, 7.71451209e-05, ..., 7.70181841e-05, 7.70428681e-05, 7.70622154e-05], ..., [-3.16645032e-05, -3.16868859e-05, -3.17191461e-05, ..., -3.15922094e-05, -3.16168933e-05, -3.16362406e-05], [ 3.87551343e-05, 3.87472121e-05, 3.87353648e-05, ..., 3.87814213e-05, 3.87723531e-05, 3.87655157e-05], [ 6.97931485e-05, 6.97912631e-05, 6.97883000e-05, ..., 6.97996402e-05, 6.97973703e-05, 6.97957461e-05]], shape=(61, 128)) - v_staggered(y_staggered, x)float64-0.0001949 -0.0001949 ... 0.0001396
array([[-1.94928692e-04, -1.94924921e-04, -1.94918995e-04, ..., -1.94941675e-04, -1.94937136e-04, -1.94933887e-04], [ 1.64867459e-04, 1.64879532e-04, 1.64897301e-04, ..., 1.64827868e-04, 1.64841465e-04, 1.64851891e-04], [-1.06865028e-05, -1.06538110e-05, -1.06070591e-05, ..., -1.07914998e-05, -1.07557285e-05, -1.07274603e-05], ..., [-1.25297806e-06, -1.28566980e-06, -1.33242176e-06, ..., -1.14798104e-06, -1.18375232e-06, -1.21202051e-06], [-6.20760284e-05, -6.20881020e-05, -6.21058705e-05, ..., -6.20364377e-05, -6.20500344e-05, -6.20604607e-05], [ 1.39586297e-04, 1.39582526e-04, 1.39576600e-04, ..., 1.39599280e-04, 1.39594741e-04, 1.39591492e-04]], shape=(60, 128))
- case :
- gill_delta_y1
- case_label :
- Gill: delta heating at y = 1
- short_name :
- Gill_sym_delta
- t :
- 50.0
- nt :
- 500
- nx :
- 128
- ny :
- 60
- nz :
- 20
- lx :
- 37.69911184307752
- ly :
- 15.707963267948966
- lz :
- 3.141592653589793
- damping :
- 0.1
- kernel :
- reyon
- dt :
- 0.1
- dx :
- 0.2945243112740431
- dy :
- 0.25750759455654043
- dz :
- 0.16534698176788384
Plot eta and the horizontal wind vector field.
plot_snapshot(
result_delta_y1,
quiver_kwargs={"scale": 25},
contourf_kwargs = {"levels": np.linspace(-5, 5, 21)}
)

<Axes: title={'center': 'Gill: delta heating at y = 1\nt = 50.00'}, xlabel='x', ylabel='y'>
Plot the derived vertical cross-section diagnostics.
plot_cross_sections(
result_delta_y1,
contourf_uw_kwargs = {"levels": np.linspace(-0.5, 0.5, 21)},
contourf_vw_kwargs = {"levels": np.linspace(-0.5, 0.5, 21)},
contourf_u_kwargs = {"levels": np.linspace(-2, 2, 21)}
)

<Figure size 800x800 with 6 Axes>
Total running time of the script: (0 minutes 9.398 seconds)