albedo¶
digraph inheritance652e39c20e { bgcolor=transparent; rankdir=LR; ratio=expand; size=""; "ConstantAlbedo" [URL="#climlab.surface.albedo.ConstantAlbedo",dirType=back,fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A class for constant albedo values at all spatial points of the domain."]; "DiagnosticProcess" -> "ConstantAlbedo" [arrowsize=0.5,dirType=back,style="setlinewidth(0.5)"]; "DiagnosticProcess" [URL="climlab.process.diagnostic.html#climlab.process.diagnostic.DiagnosticProcess",dirType=back,fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A parent class for all processes that are strictly diagnostic,"]; "TimeDependentProcess" -> "DiagnosticProcess" [arrowsize=0.5,dirType=back,style="setlinewidth(0.5)"]; "Iceline" [URL="#climlab.surface.albedo.Iceline",dirType=back,fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A class for an Iceline subprocess."]; "DiagnosticProcess" -> "Iceline" [arrowsize=0.5,dirType=back,style="setlinewidth(0.5)"]; "P2Albedo" [URL="#climlab.surface.albedo.P2Albedo",dirType=back,fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A class for parabolic distributed albedo values across the domain"]; "DiagnosticProcess" -> "P2Albedo" [arrowsize=0.5,dirType=back,style="setlinewidth(0.5)"]; "Process" [URL="climlab.process.process.html#climlab.process.process.Process",dirType=back,fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A generic parent class for all climlab process objects."]; "StepFunctionAlbedo" [URL="#climlab.surface.albedo.StepFunctionAlbedo",dirType=back,fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A step function albedo suprocess."]; "DiagnosticProcess" -> "StepFunctionAlbedo" [arrowsize=0.5,dirType=back,style="setlinewidth(0.5)"]; "TimeDependentProcess" [URL="climlab.process.time_dependent_process.html#climlab.process.time_dependent_process.TimeDependentProcess",dirType=back,fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A generic parent class for all time-dependent processes."]; "Process" -> "TimeDependentProcess" [arrowsize=0.5,dirType=back,style="setlinewidth(0.5)"]; }- class climlab.surface.albedo.ConstantAlbedo(albedo=0.33, **kwargs)[source]¶
Bases:
DiagnosticProcess
A class for constant albedo values at all spatial points of the domain.
Initialization parameters
- Parameters:
albedo (float) – albedo values [default: 0.33]
Object attributes
Additional to the parent class
DiagnosticProcess
following object attributes are generated and updated during initialization:- Variables:
albedo (Field) – attribute to store the albedo value. During initialization the
albedo()
setter is called.- Example:
Creation of a constant albedo subprocess on basis of an EBM domain:
>>> import climlab >>> from climlab.surface.albedo import ConstantAlbedo >>> # model creation >>> model = climlab.EBM() >>> sfc = model.domains['Ts'] >>> # subprocess creation >>> const_alb = ConstantAlbedo(albedo=0.3, domains=sfc, **model.param)
- Attributes:
depth
Depth at grid centers (m)
depth_bounds
Depth at grid interfaces (m)
diagnostics
Dictionary access to all diagnostic variables
input
Dictionary access to all input variables
lat
Latitude of grid centers (degrees North)
lat_bounds
Latitude of grid interfaces (degrees North)
lev
Pressure levels at grid centers (hPa or mb)
lev_bounds
Pressure levels at grid interfaces (hPa or mb)
lon
Longitude of grid centers (degrees)
lon_bounds
Longitude of grid interfaces (degrees)
timestep
The amount of time over which
step_forward()
is integrating in unit seconds.
Methods
add_diagnostic
(name[, value])Create a new diagnostic variable called
name
for this process and initialize it with the givenvalue
.add_input
(name[, value])Create a new input variable called
name
for this process and initialize it with the givenvalue
.add_subprocess
(name, proc)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
inputlist
to the list of diagnostics.declare_input
(inputlist)Add the variable names in
inputlist
to 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.diagnostic
dictionary 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
name
to a new statevalue
.set_timestep
([timestep, num_steps_per_year])Calculates the timestep in unit seconds and calls the setter function of
timestep()
step_forward
()Updates state variables with computed tendencies.
to_xarray
([diagnostics])Convert process variables to
xarray.Dataset
format.Uniform prescribed albedo.
- Attributes:
depth
Depth at grid centers (m)
depth_bounds
Depth at grid interfaces (m)
diagnostics
Dictionary access to all diagnostic variables
input
Dictionary access to all input variables
lat
Latitude of grid centers (degrees North)
lat_bounds
Latitude of grid interfaces (degrees North)
lev
Pressure levels at grid centers (hPa or mb)
lev_bounds
Pressure levels at grid interfaces (hPa or mb)
lon
Longitude of grid centers (degrees)
lon_bounds
Longitude of grid interfaces (degrees)
timestep
The amount of time over which
step_forward()
is integrating in unit seconds.
Methods
add_diagnostic
(name[, value])Create a new diagnostic variable called
name
for this process and initialize it with the givenvalue
.add_input
(name[, value])Create a new input variable called
name
for this process and initialize it with the givenvalue
.add_subprocess
(name, proc)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
inputlist
to the list of diagnostics.declare_input
(inputlist)Add the variable names in
inputlist
to 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.diagnostic
dictionary 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
name
to a new statevalue
.set_timestep
([timestep, num_steps_per_year])Calculates the timestep in unit seconds and calls the setter function of
timestep()
step_forward
()Updates state variables with computed tendencies.
to_xarray
([diagnostics])Convert process variables to
xarray.Dataset
format.
- class climlab.surface.albedo.Iceline(Tf=-10.0, **kwargs)[source]¶
Bases:
DiagnosticProcess
A class for an Iceline subprocess.
Depending on a freezing temperature it calculates where on the domain the surface is covered with ice, where there is no ice and on which latitude the ice-edge is placed.
Initialization parameters
- Parameters:
Tf (float) –
freezing temperature where sea water freezes and surface is covered with ice
unit: \(^{\circ} \textrm{C}\)
default value:
-10
Object attributes
Additional to the parent class
DiagnosticProcess
following object attributes are generated and updated during initialization:- Variables:
- Attributes:
depth
Depth at grid centers (m)
depth_bounds
Depth at grid interfaces (m)
diagnostics
Dictionary access to all diagnostic variables
input
Dictionary access to all input variables
lat
Latitude of grid centers (degrees North)
lat_bounds
Latitude of grid interfaces (degrees North)
lev
Pressure levels at grid centers (hPa or mb)
lev_bounds
Pressure levels at grid interfaces (hPa or mb)
lon
Longitude of grid centers (degrees)
lon_bounds
Longitude of grid interfaces (degrees)
timestep
The amount of time over which
step_forward()
is integrating in unit seconds.
Methods
add_diagnostic
(name[, value])Create a new diagnostic variable called
name
for this process and initialize it with the givenvalue
.add_input
(name[, value])Create a new input variable called
name
for this process and initialize it with the givenvalue
.add_subprocess
(name, proc)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
inputlist
to the list of diagnostics.declare_input
(inputlist)Add the variable names in
inputlist
to the list of necessary inputs.Finds iceline according to the surface temperature.
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.diagnostic
dictionary 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
name
to a new statevalue
.set_timestep
([timestep, num_steps_per_year])Calculates the timestep in unit seconds and calls the setter function of
timestep()
step_forward
()Updates state variables with computed tendencies.
to_xarray
([diagnostics])Convert process variables to
xarray.Dataset
format.- find_icelines()[source]¶
Finds iceline according to the surface temperature.
This method is called by the private function
_compute()
and updates following attributes according to the freezing temperatureself.param['Tf']
and the surface temperatureself.param['Ts']
:Object attributes
- Variables:
noice (Field) – a Field of booleans which are
True
where \(T_s \ge T_f\)ice (Field) – a Field of booleans which are
True
where \(T_s < T_f\)icelat (array) – an array with two elements indicating the ice-edge latitudes
ice_area (float) – fractional area covered by ice (0 - 1)
diagnostics (dict) – keys
'icelat'
and'ice_area'
are updated
- class climlab.surface.albedo.P2Albedo(a0=0.33, a2=0.25, **kwargs)[source]¶
Bases:
DiagnosticProcess
A class for parabolic distributed albedo values across the domain on basis of the second order Legendre Polynomial.
Calculates the latitude dependent albedo values as
\[\alpha(\varphi) = a_0 + a_2 P_2(x)\]where \(P_2(x) = \frac{1}{2} (3x^2 - 1)\) is the second order Legendre Polynomial and \(x=sin(\varphi)\).
Initialization parameters
- Parameters:
Object attributes
Additional to the parent class
DiagnosticProcess
following object attributes are generated and updated during initialization:- Variables:
a0 (float) – attribute to store the albedo parameter a0. During initialization the
a0()
setter is called.a2 (float) – attribute to store the albedo parameter a2. During initialization the
a2()
setter is called.diagnostics (dict) – key
'albedo'
initializedalbedo (Field) – the subprocess attribute
self.albedo
is created with correct dimensions (according toself.lat
)
- Example:
Creation of a parabolic albedo subprocess on basis of an EBM domain:
>>> import climlab >>> from climlab.surface.albedo import P2Albedo >>> # model creation >>> model = climlab.EBM() >>> # modify a0 and a2 values in model parameter dictionary >>> model.param['a0']=0.35 >>> model.param['a2']= 0.10 >>> # subprocess creation >>> p2_alb = P2Albedo(domains=model.domains['Ts'], **model.param) >>> p2_alb.a0 0.33 >>> p2_alb.a2 0.1
- Attributes:
a0
Property of albedo parameter a0.
a2
Property of albedo parameter a2.
depth
Depth at grid centers (m)
depth_bounds
Depth at grid interfaces (m)
diagnostics
Dictionary access to all diagnostic variables
input
Dictionary access to all input variables
lat
Latitude of grid centers (degrees North)
lat_bounds
Latitude of grid interfaces (degrees North)
lev
Pressure levels at grid centers (hPa or mb)
lev_bounds
Pressure levels at grid interfaces (hPa or mb)
lon
Longitude of grid centers (degrees)
lon_bounds
Longitude of grid interfaces (degrees)
timestep
The amount of time over which
step_forward()
is integrating in unit seconds.
Methods
add_diagnostic
(name[, value])Create a new diagnostic variable called
name
for this process and initialize it with the givenvalue
.add_input
(name[, value])Create a new input variable called
name
for this process and initialize it with the givenvalue
.add_subprocess
(name, proc)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
inputlist
to the list of diagnostics.declare_input
(inputlist)Add the variable names in
inputlist
to 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.diagnostic
dictionary 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
name
to a new statevalue
.set_timestep
([timestep, num_steps_per_year])Calculates the timestep in unit seconds and calls the setter function of
timestep()
step_forward
()Updates state variables with computed tendencies.
to_xarray
([diagnostics])Convert process variables to
xarray.Dataset
format.- property a0¶
Property of albedo parameter a0.
- Getter:
Returns the albedo parameter value which is stored in attribute
self._a0
- Setter:
sets albedo parameter which is addressed as
self._a0
to the new valueupdates the parameter dictionary
self.param['a0']
calls method
_compute_fixed()
- Type:
- class climlab.surface.albedo.StepFunctionAlbedo(Tf=-10.0, a0=0.3, a2=0.078, ai=0.62, **kwargs)[source]¶
Bases:
DiagnosticProcess
A step function albedo suprocess.
This class itself defines three subprocesses that are created during initialization:
'iceline'
-Iceline
'warm_albedo'
-P2Albedo
'cold_albedo'
-ConstantAlbedo
Initialization parameters
- Parameters:
Tf (float) –
freezing temperature for Iceline subprocess
unit: \(^{\circ} \textrm{C}\)
default value:
-10
a0 (float) – basic parameter for P2Albedo subprocess [default: 0.3]
a2 (float) – factor for second legendre polynominal term in P2Albedo subprocess [default: 0.078]
ai (float) – ice albedo value for ConstantAlbedo subprocess [default: 0.62]
Additional to the parent class
DiagnosticProcess
following object attributes are generated/updated during initialization:- Variables:
param (dict) – The parameter dictionary is updated with a couple of the initatilzation input arguments, namely
'Tf'
,'a0'
,'a2'
and'ai'
.topdown (bool) – is set to
False
to call subprocess compute method firstdiagnostics (dict) – key
'albedo'
initializedalbedo (Field) – the subprocess attribute
self.albedo
is created
- Example:
Creation of a step albedo subprocess on basis of an EBM domain:
>>> import climlab >>> from climlab.surface.albedo import StepFunctionAlbedo >>> >>> model = climlab.EBM(a0=0.29, a2=0.1, ai=0.65, Tf=-2) >>> >>> step_alb = StepFunctionAlbedo(state= model.state, **model.param) >>> >>> print step_alb climlab Process of type <class 'climlab.surface.albedo.StepFunctionAlbedo'>. State variables and domain shapes: Ts: (90, 1) The subprocess tree: top: <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'>
- Attributes:
depth
Depth at grid centers (m)
depth_bounds
Depth at grid interfaces (m)
diagnostics
Dictionary access to all diagnostic variables
input
Dictionary access to all input variables
lat
Latitude of grid centers (degrees North)
lat_bounds
Latitude of grid interfaces (degrees North)
lev
Pressure levels at grid centers (hPa or mb)
lev_bounds
Pressure levels at grid interfaces (hPa or mb)
lon
Longitude of grid centers (degrees)
lon_bounds
Longitude of grid interfaces (degrees)
timestep
The amount of time over which
step_forward()
is integrating in unit seconds.
Methods
add_diagnostic
(name[, value])Create a new diagnostic variable called
name
for this process and initialize it with the givenvalue
.add_input
(name[, value])Create a new input variable called
name
for this process and initialize it with the givenvalue
.add_subprocess
(name, proc)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
inputlist
to the list of diagnostics.declare_input
(inputlist)Add the variable names in
inputlist
to 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.diagnostic
dictionary 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
name
to a new statevalue
.set_timestep
([timestep, num_steps_per_year])Calculates the timestep in unit seconds and calls the setter function of
timestep()
step_forward
()Updates state variables with computed tendencies.
to_xarray
([diagnostics])Convert process variables to
xarray.Dataset
format.