Wrapper for Python Mock Microphysics Scheme

class libs.mock_microphys.microphysics_scheme_wrapper.MicrophysicsSchemeWrapper(nvec, ke, ivstart, dz, qnc)[source]

Bases: object

A class wrapping around Python MicrophysicsScheme for compatibility purposes.

This class wraps around the MicrophysicsScheme class to provide compatibility with the Python run scripts and tests in this project. It initializes a MicrophysicsScheme object and provides wrappers around methods to initialize, finalize, and run the microphysics.

Args:
nvec (int):

Number of horizontal points.

ke (int):

Number of grid points in vertical direction.

ivstart (int):

Start index for horizontal direction.

dz (np.ndarray):

Layer thickness of full levels (m).

qnc (float):

Cloud number concentration.

Attributes:
nvec (int):

Number of horizontal points.

ke (int):

Number of grid points in vertical direction.

ivstart (int):

Start index for horizontal direction.

dz (np.ndarray):

Layer thickness of full levels (m).

qnc (float):

Cloud number concentration.

microphys (MicrophysicsScheme):

instance of Python MicrophysicsScheme.

finalize() int[source]

Finalise the microphysics scheme.

This method calls the microphysics finalisation.

Returns:

int: 0 upon successful finalisation.

initialize() int[source]

Initialise the microphysics scheme.

This method calls the microphysics initialisation

Returns:

int: 0 upon successful initialisation

run(timestep: float, thermo: Thermodynamics) Thermodynamics[source]

Run the microphysics computations.

This method is a wrapper of the MicrophysicsScheme object’s run function to call the microphysics computations in a way that’s compatible with the test and scripts in this project.

Args:
timestep (float):

Time-step for integration of microphysics (s)

thermo (Thermodynamics):

Thermodynamic properties.

Returns:

Thermodynamics: Updated thermodynamic properties after microphysics computations.