Note
Go to the end to download the full example code.
Gill Model: Asymmetric Heating¶
This example simulates the response to heating that is asymmetric about the equator. It uses the same horizontal and vertical diagnostics as the symmetric case, making the meridional asymmetry of the circulation easy to inspect.
import numpy as np
from easyclimate.field.simulation.gill import (
simulate,
plot_snapshot,
plot_cross_sections,
)
Run the asymmetric Gill-heating experiment.
result_asymmetric_heating = simulate(case = "gill_asym")
result_asymmetric_heating
<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 -18.85 -18.56 -18.26 ... 17.97 18.26 18.56
* 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
eta (y, x) float64 62kB 4.041e-06 4.161e-06 ... -3.924e-06
u (y, x) float64 62kB -4.045e-06 -4.165e-06 ... 3.928e-06
v (y, x) float64 62kB 8.307e-10 6.453e-10 ... 7.766e-10 1.037e-09
v_staggered (y_staggered, x) float64 61kB 1.661e-09 1.291e-09 ... 2.074e-09
Attributes: (12/17)
case: gill_asym
case_label: Gill: asymmetric heating
short_name: Gill_asym
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-18.85 -18.56 ... 18.26 18.56
array([-18.849556, -18.555032, -18.260507, -17.965983, -17.671459, -17.376934, -17.08241 , -16.787886, -16.493361, -16.198837, -15.904313, -15.609788, -15.315264, -15.02074 , -14.726216, -14.431691, -14.137167, -13.842643, -13.548118, -13.253594, -12.95907 , -12.664545, -12.370021, -12.075497, -11.780972, -11.486448, -11.191924, -10.8974 , -10.602875, -10.308351, -10.013827, -9.719302, -9.424778, -9.130254, -8.835729, -8.541205, -8.246681, -7.952156, -7.657632, -7.363108, -7.068583, -6.774059, -6.479535, -6.185011, -5.890486, -5.595962, -5.301438, -5.006913, -4.712389, -4.417865, -4.12334 , -3.828816, -3.534292, -3.239767, -2.945243, -2.650719, -2.356194, -2.06167 , -1.767146, -1.472622, -1.178097, -0.883573, -0.589049, -0.294524, 0. , 0.294524, 0.589049, 0.883573, 1.178097, 1.472622, 1.767146, 2.06167 , 2.356194, 2.650719, 2.945243, 3.239767, 3.534292, 3.828816, 4.12334 , 4.417865, 4.712389, 5.006913, 5.301438, 5.595962, 5.890486, 6.185011, 6.479535, 6.774059, 7.068583, 7.363108, 7.657632, 7.952156, 8.246681, 8.541205, 8.835729, 9.130254, 9.424778, 9.719302, 10.013827, 10.308351, 10.602875, 10.8974 , 11.191924, 11.486448, 11.780972, 12.075497, 12.370021, 12.664545, 12.95907 , 13.253594, 13.548118, 13.842643, 14.137167, 14.431691, 14.726216, 15.02074 , 15.315264, 15.609788, 15.904313, 16.198837, 16.493361, 16.787886, 17.08241 , 17.376934, 17.671459, 17.965983, 18.260507, 18.555032]) - 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)float64-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)float644.041e-06 4.161e-06 ... -3.924e-06
array([[ 4.04078359e-06, 4.16139888e-06, 4.28581398e-06, ..., 3.70101118e-06, 3.81079755e-06, 3.92399101e-06], [ 1.36723370e-06, 1.40868404e-06, 1.45144041e-06, ..., 1.25237327e-06, 1.28937721e-06, 1.32758433e-06], [ 4.74158968e-07, 4.90074682e-07, 5.06603873e-07, ..., 4.34666871e-07, 4.47076398e-07, 4.60078222e-07], ..., [-4.74158968e-07, -4.90074682e-07, -5.06603873e-07, ..., -4.34666871e-07, -4.47076398e-07, -4.60078222e-07], [-1.36723370e-06, -1.40868404e-06, -1.45144041e-06, ..., -1.25237327e-06, -1.28937721e-06, -1.32758433e-06], [-4.04078359e-06, -4.16139888e-06, -4.28581398e-06, ..., -3.70101118e-06, -3.81079755e-06, -3.92399101e-06]], shape=(61, 128)) - u(y, x)float64-4.045e-06 -4.165e-06 ... 3.928e-06
array([[-4.04507969e-06, -4.16526514e-06, -4.28926267e-06, ..., -3.70482525e-06, -3.81486242e-06, -3.92825848e-06], [-1.37835740e-06, -1.41876154e-06, -1.46032739e-06, ..., -1.26207453e-06, -1.29984652e-06, -1.33862576e-06], [-5.01800399e-07, -5.15154553e-07, -5.28557070e-07, ..., -4.58518293e-07, -4.73019645e-07, -4.87511330e-07], ..., [ 5.01800399e-07, 5.15154553e-07, 5.28557070e-07, ..., 4.58518293e-07, 4.73019645e-07, 4.87511330e-07], [ 1.37835740e-06, 1.41876154e-06, 1.46032739e-06, ..., 1.26207453e-06, 1.29984652e-06, 1.33862576e-06], [ 4.04507969e-06, 4.16526514e-06, 4.28926267e-06, ..., 3.70482525e-06, 3.81486242e-06, 3.92825848e-06]], shape=(61, 128)) - v(y, x)float648.307e-10 6.453e-10 ... 1.037e-09
array([[8.30669144e-10, 6.45295409e-10, 6.84936730e-10, ..., 1.21964897e-09, 7.76580370e-10, 1.03686274e-09], [3.33670738e-09, 2.60727842e-09, 2.62673301e-09, ..., 4.81419195e-09, 3.25382800e-09, 4.12635008e-09], [9.04607576e-09, 7.08653395e-09, 6.84570967e-09, ..., 1.29151312e-08, 9.13789464e-09, 1.11097080e-08], ..., [9.04607580e-09, 7.08653399e-09, 6.84570970e-09, ..., 1.29151313e-08, 9.13789469e-09, 1.11097081e-08], [3.33670735e-09, 2.60727839e-09, 2.62673299e-09, ..., 4.81419191e-09, 3.25382796e-09, 4.12635005e-09], [8.30669103e-10, 6.45295370e-10, 6.84936694e-10, ..., 1.21964894e-09, 7.76580332e-10, 1.03686270e-09]], shape=(61, 128)) - v_staggered(y_staggered, x)float641.661e-09 1.291e-09 ... 2.074e-09
array([[1.66133829e-09, 1.29059082e-09, 1.36987346e-09, ..., 2.43929794e-09, 1.55316074e-09, 2.07372548e-09], [5.01207648e-09, 3.92396602e-09, 3.88359257e-09, ..., 7.18908596e-09, 4.95449526e-09, 6.17897468e-09], [1.30800750e-08, 1.02491019e-08, 9.80782677e-09, ..., 1.86411765e-08, 1.33212940e-08, 1.60404414e-08], ..., [1.30800751e-08, 1.02491019e-08, 9.80782680e-09, ..., 1.86411766e-08, 1.33212941e-08, 1.60404414e-08], [5.01207650e-09, 3.92396605e-09, 3.88359260e-09, ..., 7.18908595e-09, 4.95449526e-09, 6.17897469e-09], [1.66133821e-09, 1.29059074e-09, 1.36987339e-09, ..., 2.43929787e-09, 1.55316066e-09, 2.07372540e-09]], shape=(60, 128))
- case :
- gill_asym
- case_label :
- Gill: asymmetric heating
- short_name :
- Gill_asym
- 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_asymmetric_heating,
quiver_kwargs={"scale": 25},
contourf_kwargs = {"levels": np.linspace(-2, 2, 21)}
)

<Axes: title={'center': 'Gill: asymmetric heating\nt = 50.00'}, xlabel='x', ylabel='y'>
Plot the derived vertical cross-section diagnostics.
plot_cross_sections(
result_asymmetric_heating,
contourf_uw_kwargs = {"levels": np.linspace(-0.01, 0.01, 21)},
contourf_vw_kwargs = {"levels": np.linspace(-0.1, 0.1, 21)},
contourf_u_kwargs = {"levels": np.linspace(-0.4, 0.4, 21)}
)

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