AplusBT

- class climlab.radiation.aplusbt.AplusBT(A=200.0, B=2.0, **kwargs)[source]
Bases:
EnergyBudgetThe simplest linear longwave radiation module.
Calculates the Outgoing Longwave Radation (OLR) \(R\uparrow\) as
\[R\uparrow = A + B \cdot T\]where \(T\) is the state variable.
Should be invoked with a single temperature state variable only.
Initialization parameters n
An instance of
AplusBTis initialized with the following arguments:- Parameters:
Object attributes n
Additional to the parent class
EnergyBudgetfollowing object attributes are generated or modified during initialization:- Variables:
Warning
This module currently works only for a single state variable!
- Example:
Simple linear radiation module (stand alone):
>>> import climlab >>> # create a column atmosphere and scalar surface >>> sfc, atm = climlab.domain.single_column() >>> # Create a state variable >>> Ts = climlab.Field(15., domain=sfc) >>> # Make a dictionary of state variables >>> s = {'Ts': Ts} >>> # create process >>> olr = climlab.radiation.AplusBT(state=s) >>> print olr climlab Process of type <class 'climlab.radiation.AplusBT.AplusBT'>. State variables and domain shapes: Ts: (1,) The subprocess tree: top: <class 'climlab.radiation.AplusBT.AplusBT'> >>> # to compute tendencies and diagnostics >>> olr.compute() >>> # or to actually update the temperature >>> olr.step_forward() >>> print olr.state {'Ts': Field([ 5.69123176])}
- Attributes:
AProperty of AplusBT parameter A.
BProperty of AplusBT parameter B.
- current_time
depthDepth at grid centers (m)
depth_boundsDepth at grid interfaces (m)
diagnosticsDictionary access to all diagnostic variables
- elapsed_time
inputDictionary access to all input variables
latLatitude of grid centers (degrees North)
lat_boundsLatitude of grid interfaces (degrees North)
levPressure levels at grid centers (hPa or mb)
lev_boundsPressure levels at grid interfaces (hPa or mb)
lonLongitude of grid centers (degrees)
lon_boundsLongitude of grid interfaces (degrees)
timestepThe amount of time over which
step_forward()is integrating in unit seconds.timestep_in_secondsReturn a float value representing the timestep in units of seconds
Methods
add_diagnostic(name[, value])Create a new diagnostic variable called
namefor this process and initialize it with the givenvalue.add_input(name[, value])Create a new input variable called
namefor this process and initialize it with the givenvalue.add_subprocess(name, proc[, verbose])Adds a single subprocess to this process.
add_subprocesses(procdict)Adds a dictionary of subproceses to this process.
compute()Computes the tendencies for all state variables given current state and specified input.
compute_diagnostics([num_iter])Compute all tendencies and diagnostics, but don't update model state.
declare_diagnostics(diaglist)Add the variable names in
inputlistto the list of diagnostics.declare_input(inputlist)Add the variable names in
inputlistto the list of necessary inputs.integrate_converge([crit, verbose])Integrates the model until model states are converging.
integrate_days([days, verbose])Integrates the model forward for a specified number of days.
integrate_years([years, verbose])Integrates the model by a given number of years.
remove_diagnostic(name)Removes a diagnostic from the
process.diagnosticdictionary and also delete the associated process attribute.remove_subprocess(name[, verbose])Removes a single subprocess from this process.
set_state(name, value)Sets the variable
nameto a new statevalue.step_forward()Updates state variables with computed tendencies.
to_xarray([diagnostics, timeave])Convert process variables to
xarray.Datasetformat.- property A
Property of AplusBT parameter A.
- Getter:
Returns the parameter A which is stored in attribute
self._A- Setter:
sets parameter A which is addressed as
self._Ato the new valueupdates the parameter dictionary
self.param['A']
- Type:
- Example:
>>> import climlab >>> model = climlab.EBM() >>> # getter >>> model.subprocess['LW'].A 210.0 >>> # setter >>> model.subprocess['LW'].A = 220 >>> # getter again >>> model.subprocess['LW'].A 220 >>> # subprocess parameter dictionary >>> model.subprocess['LW'].param['A'] 220
- class climlab.radiation.aplusbt.AplusBT_CO2(CO2=300.0, **kwargs)[source]
Bases:
EnergyBudgetLinear longwave radiation module considering CO2 concentration.
This radiation subprocess is based in the idea to linearize the Outgoing Longwave Radiation (OLR) emitted to space according to the surface temperature (see
AplusBT).To consider a the change of the greenhouse effect through range of \(CO_2\) in the atmosphere, the parameters A and B are computed like the following:
\[\begin{split}A(c) = -326.4 + 9.161 c - 3.164 c^2 + 0.5468 c^3 \\ B(c) = 1.953 - 0.04866 c + 0.01309 c^2 - 0.002577 c^3\end{split}\]where \(c=\log \frac{p}{300}\) and \(p\) represents the concentration of \(CO_2\) in the atmosphere.
For further reading see Caldeira and Kasting [1992].
Initialization parameters
An instance of
AplusBT_CO2is initialized with the following argument:- Parameters:
CO2 (float) – The concentration of \(CO_2\) in the atmosphere. Referred to as \(p\) in the above given formulas. - unit: \(\textrm{ppm}\) (parts per million) - default value:
300.0
Object attributes n
Additional to the parent class
EnergyBudgetfollowing object attributes are generated or updated during initialization:- Variables:
- Example:
Replacing an the regular AplusBT subprocess in an energy balance model:
>>> import climlab >>> from climlab.radiation.AplusBT import AplusBT_CO2 >>> # creating EBM model >>> model = climlab.EBM() >>> print model
climlab Process of type <class 'climlab.model.ebm.EBM'>. State variables and domain shapes: Ts: (90, 1) The subprocess tree: top: <class 'climlab.model.ebm.EBM'> diffusion: <class 'climlab.dynamics.diffusion.MeridionalDiffusion'> LW: <class 'climlab.radiation.AplusBT.AplusBT'> albedo: <class 'climlab.surface.albedo.StepFunctionAlbedo'> iceline: <class 'climlab.surface.albedo.Iceline'> cold_albedo: <class 'climlab.surface.albedo.ConstantAlbedo'> warm_albedo: <class 'climlab.surface.albedo.P2Albedo'> insolation: <class 'climlab.radiation.insolation.P2Insolation'>>>> # creating and adding albedo feedback subprocess >>> LW_CO2 = AplusBT_CO2(CO2=400, state=model.state, **model.param) >>> # overwriting old 'LW' subprocess with same name >>> model.add_subprocess('LW', LW_CO2) >>> print model
climlab Process of type <class 'climlab.model.ebm.EBM'>. State variables and domain shapes: Ts: (90, 1) The subprocess tree: top: <class 'climlab.model.ebm.EBM'> diffusion: <class 'climlab.dynamics.diffusion.MeridionalDiffusion'> LW: <class 'climlab.radiation.AplusBT.AplusBT_CO2'> albedo: <class 'climlab.surface.albedo.StepFunctionAlbedo'> iceline: <class 'climlab.surface.albedo.Iceline'> cold_albedo: <class 'climlab.surface.albedo.ConstantAlbedo'> warm_albedo: <class 'climlab.surface.albedo.P2Albedo'> insolation: <class 'climlab.radiation.insolation.P2Insolation'>- Attributes:
CO2Property of AplusBT_CO2 parameter CO2.
- current_time
depthDepth at grid centers (m)
depth_boundsDepth at grid interfaces (m)
diagnosticsDictionary access to all diagnostic variables
- elapsed_time
inputDictionary access to all input variables
latLatitude of grid centers (degrees North)
lat_boundsLatitude of grid interfaces (degrees North)
levPressure levels at grid centers (hPa or mb)
lev_boundsPressure levels at grid interfaces (hPa or mb)
lonLongitude of grid centers (degrees)
lon_boundsLongitude of grid interfaces (degrees)
timestepThe amount of time over which
step_forward()is integrating in unit seconds.timestep_in_secondsReturn a float value representing the timestep in units of seconds
Methods
add_diagnostic(name[, value])Create a new diagnostic variable called
namefor this process and initialize it with the givenvalue.add_input(name[, value])Create a new input variable called
namefor this process and initialize it with the givenvalue.add_subprocess(name, proc[, verbose])Adds a single subprocess to this process.
add_subprocesses(procdict)Adds a dictionary of subproceses to this process.
compute()Computes the tendencies for all state variables given current state and specified input.
compute_diagnostics([num_iter])Compute all tendencies and diagnostics, but don't update model state.
declare_diagnostics(diaglist)Add the variable names in
inputlistto the list of diagnostics.declare_input(inputlist)Add the variable names in
inputlistto the list of necessary inputs.integrate_converge([crit, verbose])Integrates the model until model states are converging.
integrate_days([days, verbose])Integrates the model forward for a specified number of days.
integrate_years([years, verbose])Integrates the model by a given number of years.
remove_diagnostic(name)Removes a diagnostic from the
process.diagnosticdictionary and also delete the associated process attribute.remove_subprocess(name[, verbose])Removes a single subprocess from this process.
set_state(name, value)Sets the variable
nameto a new statevalue.step_forward()Updates state variables with computed tendencies.
to_xarray([diagnostics, timeave])Convert process variables to
xarray.Datasetformat.