Let us start with a simple climt model which is not very useful, but helps illustrate how to use climt:

In [1]: import climt

# Create some components
In [2]: radiation = climt.GrayLongwaveRadiation()

In [3]: surface = climt.SlabSurface()

# Get a state dictionary filled with required quantities
# for the components to run
In [4]: state = climt.get_default_state([radiation, surface])

# Run components
In [5]: tendencies, diagnostics = radiation(state)

# See output
In [6]: tendencies.keys()
Out[6]: dict_keys(['air_temperature'])

In [7]: tendencies['air_temperature']
<xarray.DataArray (mid_levels: 28, lat: 1, lon: 1)>




















Dimensions without coordinates: mid_levels, lat, lon
    units:    degK s^-1

Here, all the essential aspects of creating and running a model in climt are present:

  • Import the climt package
  • Create one or many components
  • Create a state dictionary using get_default_state
  • Run the components
  • Do something with the output

Variables radiation and surface are two components that we create. All climt components take a lot of optional arguments: However, by design, the default options (which are used if you don’t specify any arguments) are meant to be scientifically meaningful.

The variables state, tendencies and diagnostics are dictionaries which contain quantities which act either as inputs to components or outputs from components.

The function get_default_state(), if called only with a list of components, will provide a set of quantities which represent a single column of the atmosphere. These default values may or may not be meaningful in your context, so it is best to see what they are and change them according to your needs.


The square brackets are required in the call to get_default_state, even if it is one component: climt.get_default_state([radiation]) is the correct syntax.

Building more sophisticated models and running them is merely an extended version of the above simple example. climt makes heavy use of Sympl, and knowledge of Sympl is necessary to use climt to its full capabilities. So, do go through Sympl’s docs!