CloudEnsemble

class konrad.cloud.CloudEnsemble(*args, **kwargs)[source]

Wrapper to combine several clouds into a cloud ensemble.

Warning: For now, overlapping clouds are handled very poorly!

A cloud ensemble can consist of an arbitrary number of clouds. After its initialization it is handled like a normal Cloud:

>>> cloud1 = HighCloud(...)
>>> cloud2 = LowCloud(...)
>>> cloud_ensemble = CloudEnsemble(cloud1, cloud2)
>>> cloud_ensemble.cloud_area_fraction_in_atmosphere_layer
__init__(*args)[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__(*args)

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_combinations()

Get all combinations of overlapping cloud layers.

get_p_data_array(values[, units])

Return a DataArray of values.

get_waveband_data_array(values[, units, sw])

Return a DataArray of values.

hash_attributes()

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.

superpose()

Update the superposed cloud profile.

to_dataset()

Convert model component into an xarray.Dataset.

update_cloud_profile(*args, **kwargs)

Update every cloud in the cloud ensemble.

Attributes

attrs

Dictionary containing all attributes.

data_vars

Dictionary containing all data variables and their dimensions.

direct_input_parameters

netcdf_subgroups

Dynamically create a netCDF subgroup for each cloud.

num_longwave_bands

number of longwave bands used in the radiation scheme

num_shortwave_bands

number of shortwave bands used in the radiation scheme