Models API Reference¶
The models module provides specialized functions for climate model analysis and radiative-convective equilibrium calculations.
Overview¶
The models module contains:
RCE (Radiative-Convective Equilibrium): Functions for calculating RCE states
RE (Radiative Equilibrium): Functions for calculating RE states
RCE Module¶
- climate_diagnostics.models.rce.create_rce_model(num_lev=60, water_depth=5.0, integrate_years=5, gas_vmr=None, savgol_window=15, savgol_order=3, return_array=False)[source]¶
Simulates single-column Radiative-Convective Equilibrium (RCE).
This function sets up and runs a single-column atmospheric model until it reaches RCE. It uses the CAM3 radiation scheme and a simple Convective Adjustment scheme, which is climlab’s default.
The final temperature profile is smoothed using a Savitzky-Golay filter and plotted.
- Parameters:
num_lev (int) – The number of vertical levels in the atmosphere.
water_depth (float) – The depth of the slab ocean surface model (in meters), which determines the heat capacity of the surface.
integrate_years (float) – The number of years to run the simulation to approach equilibrium.
gas_vmr (dict, optional) – A dictionary to override default greenhouse gas volume mixing ratios (e.g., {‘CO2’: 400e-6}). If None, climlab defaults are used.
savgol_window (int) – The window size for the Savitzky-Golay filter. Must be an odd integer.
savgol_order (int) – The polynomial order for the Savitzky-Golay filter. Must be less than savgol_window.
return_array (bool) – If True, also returns the smoothed temperature profile as a numpy array. Defaults to False.
- Returns:
The model object after the integration is complete. If return_array is True, a tuple (model, T_smooth) is returned, where T_smooth is the smoothed temperature profile as a numpy array.
- Return type:
climlab.TimeDependentProcess or tuple
- climate_diagnostics.models.rce.create_re_model(num_lev=60, water_depth=5.0, integrate_years=5, gas_vmr=None, savgol_window=15, savgol_order=3, return_array=False)[source]¶
Simulates single-column Radiative Equilibrium (RE).
This function sets up and runs a single-column atmospheric model until it reaches RE. It uses the CAM3 radiation scheme without any convective adjustment.
The final temperature profile is smoothed using a Savitzky-Golay filter and plotted.
- Parameters:
num_lev (int) – The number of vertical levels in the atmosphere.
water_depth (float) – The depth of the slab ocean surface model (in meters), which determines the heat capacity of the surface.
integrate_years (float) – The number of years to run the simulation to approach equilibrium.
gas_vmr (dict, optional) – A dictionary to override default greenhouse gas volume mixing ratios (e.g., {‘CO2’: 400e-6}). If None, climlab defaults are used.
savgol_window (int) – The window size for the Savitzky-Golay filter. Must be an odd integer.
savgol_order (int) – The polynomial order for the Savitzky-Golay filter. Must be less than savgol_window.
return_array (bool) – If True, also returns the smoothed temperature profile as a numpy array. Defaults to False.
- Returns:
The model object after the integration is complete. If return_array is True, a tuple (model, T_smooth) is returned, where T_smooth is the smoothed temperature profile as a numpy array.
- Return type:
climlab.TimeDependentProcess or tuple
Available Functions¶
- climate_diagnostics.models.rce.create_rce_model(num_lev=60, water_depth=5.0, integrate_years=5, gas_vmr=None, savgol_window=15, savgol_order=3, return_array=False)[source]
Simulates single-column Radiative-Convective Equilibrium (RCE).
This function sets up and runs a single-column atmospheric model until it reaches RCE. It uses the CAM3 radiation scheme and a simple Convective Adjustment scheme, which is climlab’s default.
The final temperature profile is smoothed using a Savitzky-Golay filter and plotted.
- Parameters:
num_lev (int) – The number of vertical levels in the atmosphere.
water_depth (float) – The depth of the slab ocean surface model (in meters), which determines the heat capacity of the surface.
integrate_years (float) – The number of years to run the simulation to approach equilibrium.
gas_vmr (dict, optional) – A dictionary to override default greenhouse gas volume mixing ratios (e.g., {‘CO2’: 400e-6}). If None, climlab defaults are used.
savgol_window (int) – The window size for the Savitzky-Golay filter. Must be an odd integer.
savgol_order (int) – The polynomial order for the Savitzky-Golay filter. Must be less than savgol_window.
return_array (bool) – If True, also returns the smoothed temperature profile as a numpy array. Defaults to False.
- Returns:
The model object after the integration is complete. If return_array is True, a tuple (model, T_smooth) is returned, where T_smooth is the smoothed temperature profile as a numpy array.
- Return type:
climlab.TimeDependentProcess or tuple
- climate_diagnostics.models.rce.create_re_model(num_lev=60, water_depth=5.0, integrate_years=5, gas_vmr=None, savgol_window=15, savgol_order=3, return_array=False)[source]
Simulates single-column Radiative Equilibrium (RE).
This function sets up and runs a single-column atmospheric model until it reaches RE. It uses the CAM3 radiation scheme without any convective adjustment.
The final temperature profile is smoothed using a Savitzky-Golay filter and plotted.
- Parameters:
num_lev (int) – The number of vertical levels in the atmosphere.
water_depth (float) – The depth of the slab ocean surface model (in meters), which determines the heat capacity of the surface.
integrate_years (float) – The number of years to run the simulation to approach equilibrium.
gas_vmr (dict, optional) – A dictionary to override default greenhouse gas volume mixing ratios (e.g., {‘CO2’: 400e-6}). If None, climlab defaults are used.
savgol_window (int) – The window size for the Savitzky-Golay filter. Must be an odd integer.
savgol_order (int) – The polynomial order for the Savitzky-Golay filter. Must be less than savgol_window.
return_array (bool) – If True, also returns the smoothed temperature profile as a numpy array. Defaults to False.
- Returns:
The model object after the integration is complete. If return_array is True, a tuple (model, T_smooth) is returned, where T_smooth is the smoothed temperature profile as a numpy array.
- Return type:
climlab.TimeDependentProcess or tuple
Basic Example¶
from climate_diagnostics.models.rce import create_rce_model, create_re_model
# Create and run RCE model
rce_model = create_rce_model(
num_lev=40,
water_depth=5.0,
integrate_years=3
)
# Create and run RE model
re_model = create_re_model(
num_lev=40,
water_depth=5.0,
integrate_years=3
)
See Also¶
Time Series Analysis API Reference - Time series analysis methods
Trend Analysis API Reference - Trend analysis methods