API Reference

API Reference#

This page provides an auto-generated summary of multimodemodel’s API

Parameter([g, H, rho_0, a_h, gamma_h, ...])

Class to organise all parameters.

Parameter.f

Getter of the dictionary holding the Coriolis parameter.

Parameter.split(splitter)

Split Parameter's spatially dependent data.

Parameter.merge(others, merger)

Merge Parameter's spatially varying data.

Parameter.__eq__(other)

Return true if other is identical or the same as self.

Variable(data, grid, time)

Variable class consisting of the data, a Grid instance and a time stamp.

Variable.data

Variable.grid

Variable.time

Variable.split(splitter)

Split variable.

Variable.merge(others, merger)

Merge variable.

Variable.copy()

Return a copy.

Variable.as_dataarray

Return variable as xarray.DataArray.

Variable.safe_data

Return data or, if it is None, a zero array of appropriate shape.

Variable.__eq__(other)

Return true if other is identical or the same as self.

Variable.__add__(other)

Add data of to variables.

State(**kwargs)

State class.

State.split(splitter)

Split state.

State.merge(others, merger)

Merge variables.

State.__add__(other)

Add all variables of two states.

StateDeque

Deque of State objects.

StateDeque.split(splitter)

Split StateDeque.

StateDeque.merge(others, merger)

Merge StateDeques.

Domain(state[, history, parameter, id, ...])

Domain classes.

Domain.increment_iteration()

Return incremented iteration from domain.

Domain.split(splitter)

Split domain.

Domain.merge(others, merger)

Merge domains.

Domain.copy()

Return deepcopy of self.

Domain.__eq__(other)

Return true if other is identical or the same as self.

Grid(x, y[, z, mask, dx, dy, dz])

Grid information.

Grid.ndim

Return number of dimensions.

Grid.shape

Return shape tuple of grid.

Grid.dim_x

Return axis of x dimension.

Grid.dim_y

Return axis of x dimension.

Grid.dim_z

Return axis of x dimension.

Grid.cartesian(x, y[, z, mask])

Generate a Cartesian grid.

Grid.regular_lat_lon(lon_start, lon_end, ...)

Generate a regular spherical grid.

Grid.__eq__(other)

Return true if other is identical or the same as self.

StaggeredGrid(eta, u, v, q)

Staggered Grid.

StaggeredGrid.split(splitter)

Split staggered grids.

StaggeredGrid.merge(others, merger)

Merge staggered grids.

StaggeredGrid.cartesian_c_grid([shift])

Generate a Cartesian Arakawa C-Grid.

StaggeredGrid.regular_lat_lon_c_grid([shift])

Generate a Arakawa C-grid for a regular longitude/latitude grid.

GridShift(value[, names, module, qualname, ...])

Direction of shift of staggered grids with respect to the eta-grid.

RegularSplitMerger(parts, dim)

Implements splitting and merging into regular grid.

BorderSplitter(slice, axis)

Implements splitting off stripes along a dimension.

BorderMerger(width, axis)

Merges the borders with a Domain along a dimension.

Border(state, width, dim, iteration[, ...])

Implementation of Border class from API on State class.

Tail()

Implement Tailor class from API.

integrate(initial_state, params, RHS[, ...])

Integrate a system of differential equations.

linearised_SWE(state, params)

Compute RHS of the linearised shallow water equations.

TimeSteppingFunction

alias of TimeSteppingFunctionBase[State, StateDeque]

StateIncrement

alias of State

time_stepping_function(n_rhs, n_state)

Decorate function by adding n_rhs and n_state attributes.

euler_forward

Base class for time stepping function wrapper.

adams_bashforth2

Base class for time stepping function wrapper.

adams_bashforth3

Base class for time stepping function wrapper.

Solver(rhs, ts_schema[, step])

Implement Solver class from API for use with any provided function.

Solver.rhs(state, parameter)

Evaluate right-hand-side function.

Solver.integrate(domain)

Integrate set of PDEs on domain.

Solver.integrate_border(domain, border, ...)

Integrate set of PDEs on a border of a domian.

Solver.get_border_width()

Retuns fixed border width.

coriolis_i(state, params)

Compute the acceleration due to the Coriolis force along the first dimension.

coriolis_j(state, params)

Compute acceleration due to Coriolis force along second dimension.

divergence_j(state, params)

Compute divergence of flow along second dimension with centered differences.

divergence_i(state, params)

Compute divergence of flow along first dimension with centered differences.

pressure_gradient_j(state, params)

Compute the second component of the pressure gradient.

pressure_gradient_i(state, params)

Compute the pressure gradient along the first dimension.

sum_states(states[, keep_time])

Sum states using optimized implementations.

sum_vars(variables[, keep_time])

Sum variables using optimized implementations.

linear_combination(factors, arrays)

Return linear combination of arrays.

CoriolisFunc

alias of Callable[[ndarray], ndarray]

f_constant([f])

Return a closure that returns a constant Coriolis parameter.

beta_plane(f0, beta, y0)

Return a closure that computes the Coriolis parameter on a beta plane.

f_on_sphere([omega])

Return a closure that computes the Coriolis parameter on a sphere.

Workflow(domain, solver)

Run model on a single process.

DaskWorkflow(domain, solver, client, splitter)

Workflow distributed on a Dask cluster.