Note
Go to the end to download the full example code.
Gill Model: Symmetric and Asymmetric Heating¶
This example combines symmetric and asymmetric heating components. Comparing the horizontal circulation and vertical diagnostics shows the response to the combined forcing.
import numpy as np
from easyclimate.field.simulation.gill import (
simulate,
plot_snapshot,
plot_cross_sections,
)
Run the combined symmetric- and asymmetric-heating experiment.
result_symmetric_asymmetric = simulate(case = "gill_sym_asym")
result_symmetric_asymmetric
<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
eta (y, x) float64 62kB 5.827e-06 6.012e-06 ... -9.329e-06
u (y, x) float64 62kB -6.284e-06 -6.484e-06 ... 8.466e-06
v (y, x) float64 62kB 7.03e-09 8.491e-09 ... -3.818e-08
v_staggered (y_staggered, x) float64 61kB 1.406e-08 ... -7.637e-08
Attributes: (12/17)
case: gill_sym_asym
case_label: Gill: symmetric heating + asymmetric heating
short_name: Gill_sym_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-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)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)float645.827e-06 6.012e-06 ... -9.329e-06
array([[ 5.82715227e-06, 6.01219843e-06, 6.20551318e-06, ..., 5.30919639e-06, 5.47599221e-06, 5.64792736e-06], [ 1.41327207e-06, 1.45684921e-06, 1.51274447e-06, ..., 1.31140939e-06, 1.34191202e-06, 1.37341857e-06], [-9.74609057e-07, -1.01091140e-06, -1.02048447e-06, ..., -8.14938958e-07, -8.73033631e-07, -9.32041905e-07], ..., [-4.62147182e-06, -5.09842781e-06, -5.64942050e-06, ..., -3.47771664e-06, -3.81714945e-06, -4.19025300e-06], [-4.46078198e-06, -4.72016807e-06, -5.01001811e-06, ..., -3.80194569e-06, -4.00392402e-06, -4.22014470e-06], [-9.63476189e-06, -9.95090513e-06, -1.02810657e-05, ..., -8.75375577e-06, -9.03669289e-06, -9.32939940e-06]], shape=(61, 128)) - u(y, x)float64-6.284e-06 -6.484e-06 ... 8.466e-06
array([[-6.28387060e-06, -6.48446224e-06, -6.68513849e-06, ..., -5.70610018e-06, -5.89399760e-06, -6.08784451e-06], [-2.67963809e-06, -2.76663301e-06, -2.84584627e-06, ..., -2.41052710e-06, -2.50015252e-06, -2.59178596e-06], [-2.36545564e-06, -2.44829949e-06, -2.51007506e-06, ..., -2.07699041e-06, -2.17640927e-06, -2.27680791e-06], ..., [-2.20605094e-06, -2.59108726e-06, -3.04114317e-06, ..., -1.31404528e-06, -1.57326748e-06, -1.86445636e-06], [ 1.80956941e-06, 1.73077018e-06, 1.62655420e-06, ..., 1.94937242e-06, 1.91645899e-06, 1.87260974e-06], [ 8.65873042e-06, 8.84961001e-06, 9.03290972e-06, ..., 8.07433951e-06, 8.26987716e-06, 8.46642999e-06]], shape=(61, 128)) - v(y, x)float647.03e-09 8.491e-09 ... -3.818e-08
array([[ 7.03018718e-09, 8.49102107e-09, 3.44858818e-09, ..., 1.14334583e-08, 8.68707003e-09, 1.07351635e-08], [ 3.04449670e-08, 3.47989870e-08, 1.63030922e-08, ..., 4.64820990e-08, 3.68854822e-08, 4.37393722e-08], [ 9.04647182e-08, 9.93742328e-08, 5.34481340e-08, ..., 1.29560686e-07, 1.06872655e-07, 1.22769183e-07], ..., [-5.23239388e-07, -5.59095172e-07, -6.69541781e-07, ..., -3.39555651e-07, -4.11611650e-07, -4.34409635e-07], [-1.90800243e-07, -2.02290630e-07, -2.44481136e-07, ..., -1.22189010e-07, -1.49922145e-07, -1.56742965e-07], [-4.70843646e-08, -4.93943789e-08, -6.03628647e-08, ..., -2.96977335e-08, -3.69839546e-08, -3.81842504e-08]], shape=(61, 128)) - v_staggered(y_staggered, x)float641.406e-08 1.698e-08 ... -7.637e-08
array([[ 1.40603744e-08, 1.69820421e-08, 6.89717635e-09, ..., 2.28669167e-08, 1.73741401e-08, 2.14703270e-08], [ 4.68295597e-08, 5.26159318e-08, 2.57090080e-08, ..., 7.00972812e-08, 5.63968243e-08, 6.60084174e-08], [ 1.34099877e-07, 1.46132534e-07, 8.11872600e-08, ..., 1.89024091e-07, 1.57348486e-07, 1.79529949e-07], ..., [-7.59047021e-07, -8.12397840e-07, -9.70847021e-07, ..., -4.94128750e-07, -5.97346918e-07, -6.31701840e-07], [-2.87431756e-07, -3.05792503e-07, -3.68236542e-07, ..., -1.84982553e-07, -2.25876382e-07, -2.37117430e-07], [-9.41687291e-08, -9.87887578e-08, -1.20725729e-07, ..., -5.93954670e-08, -7.39679091e-08, -7.63685008e-08]], shape=(60, 128))
- case :
- gill_sym_asym
- case_label :
- Gill: symmetric heating + asymmetric heating
- short_name :
- Gill_sym_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_symmetric_asymmetric,
quiver_kwargs={"scale": 25},
contourf_kwargs = {"levels": np.linspace(-3, 3, 21)}
)

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

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