DirectInputCloud¶
- class konrad.cloud.DirectInputCloud(*args, **kwargs)[source]¶
To be used with cloud_optical_properties=’direct_input’ in climt/RRTMG.
- __init__(numlevels, cloud_fraction, lw_optical_thickness, sw_optical_thickness, coupling='convective_top', forward_scattering_fraction=0, asymmetry_parameter=0.85, single_scattering_albedo=0.9, norm_index=None)[source]
Define a cloud based on properties that are directly used by the radiation scheme, namely cloud optical depth and scattering parameters.
- Parameters
numlevels (int) – Number of atmospheric levels.
coupling (str) –
Mechanism with which the cloud is coupled to the atmospheric profile:
’convective_top’: Coupling to the convective top
’freezing_level’: Coupling to the freezing level
’subsidence_divergence’: Coupling to the level of maximum subsidence divergence
’pressure’: Fixed at pressure (no coupling)
cloud_fraction (float / ndarray / DataArray) – cloud area fraction
lw_optical_thickness (float / DataArray) – longwave optical thickness of the cloud
sw_optical_thickness (float / DataArray) – shortwave optical thickness of the cloud
forward_scattering_fraction (float / DataArray) – cloud forward scattering fraction (for the shortwave component of RRTMG) This is a scaling factor for the other shortwave parameters, if it is set to 0, no scaling is applied.
asymmetry_parameter (float / DataArray) – cloud asymmetry parameter (for the shortwave component of RRTMG)
single_scattering_albedo (float / DataArray) – single scattering albedo due to cloud (for the shortwave component of RRTMG)
norm_index (int / None) – model level index for coupling the cloud
Methods
__init__
(numlevels, cloud_fraction, ...[, ...])Define a cloud based on properties that are directly used by the radiation scheme, namely cloud optical depth and scattering parameters.
create_variable
(name[, data, dims])Create a variable in the model component.
from_atmosphere
(atmosphere, **kwargs)Initialize a cloud component matching the given atmosphere.
from_netcdf
(ncfile[, timestep])Load a model component from a netCDF file.
get
(variable[, default, keepdims])Get values of a given variable.
get_p_data_array
(values[, units])Return a DataArray of values.
get_waveband_data_array
(values[, units, sw])Return a DataArray of values.
Create a hash from all hashable component attributes.
interpolation_function
(cloud_parameter)Calculate the interpolation function, to be used to maintain the cloud optical properties and keep the cloud attached to a normalisation level (self._norm_index).
overcast
()Set cloud fraction in cloud layers to
1
(full overcast).set
(variable, value)Set the values of a variable.
shift_cloud_profile
(norm_new)shift_property
(cloud_parameter, ...)Shift the cloud area fraction according to a normalisation level.
Convert model component into an xarray.Dataset.
update_cloud_profile
(atmosphere, convection, ...)Keep the cloud profile fixed with model level (pressure).
Attributes
attrs
Dictionary containing all attributes.
data_vars
Dictionary containing all data variables and their dimensions.
direct_input_parameters
netcdf_subgroups
Define subgroups used when storing to netCDF file.
num_longwave_bands
number of longwave bands used in the radiation scheme
num_shortwave_bands
number of shortwave bands used in the radiation scheme