Gill Model: Kelvin Wave

This example simulates the Kelvin-wave experiment. The horizontal snapshot shows its equatorially trapped circulation, while the cross sections show the associated vertical structure.

import numpy as np
from easyclimate.field.simulation.gill import (
    simulate,
    plot_snapshot,
    plot_cross_sections,
)

Run the Kelvin-wave experiment.

<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 0.0 0.0
    eta          (y, x) float64 62kB 8.858e-08 1.089e-07 ... 3.859e-08 6.483e-08
    u            (y, x) float64 62kB 1.978e-08 4.136e-08 ... -2.569e-09
    v            (y, x) float64 62kB 1.065e-08 1.007e-08 ... -1.083e-08
    v_staggered  (y_staggered, x) float64 61kB 2.131e-08 ... -2.165e-08
Attributes: (12/17)
    case:        kelvin_wave
    case_label:  Kelvin wave
    short_name:  KelvinWave
    t:           10.0
    nt:          100
    nx:          128
    ...          ...
    damping:     0.0
    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_kelvin_wave,
    quiver_kwargs={"scale": 8},
    contourf_kwargs = {"levels": np.linspace(-1, 1, 21)}
)
Kelvin wave t = 10.00
<Axes: title={'center': 'Kelvin wave\nt = 10.00'}, xlabel='x', ylabel='y'>

Plot the derived vertical cross-section diagnostics.

plot_cross_sections(
    result_kelvin_wave,
    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.1, 0.1, 21)}
)
Kelvin wave t = 10.00 u-w, v-w, u
<Figure size 800x800 with 6 Axes>

Total running time of the script: (0 minutes 5.792 seconds)