Class ModelComponent

Inheritance Relationships

Derived Types

Class Documentation

class ModelComponent

A class encapsulating a component of the model. It also provide a method of communicating data between ModelComponents using enums, static arrays of pointers and the ModelArrayAccessor class.

Subclassed by Nextsim::CheckingModelComponent, Nextsim::IDiagnosticOutput, Nextsim::IDynamics, Nextsim::IFreezingPoint, Nextsim::Module1, Nextsim::ModuleRequestAndSupply, Nextsim::ModuleSemiShared, Nextsim::ModuleShared, Nextsim::ModuleSupplyAndWait

Public Types

typedef Logged::level OutputLevel

Public Functions

ModelComponent()
virtual ~ModelComponent() = default
virtual std::string getName() const = 0

Returns the name of the component.

virtual void setData(const ModelState::DataMap &state) = 0

Set the initial data of the component from the passed ModelState.

Parameters:

state – The ModelState containing the data to be set.

inline virtual ModelState getStateDiagnostic() const

Returns all data and configuration from this component.

The state returned by this function contains all available data in this component and all components that it calls.

inline virtual ModelState getStateDiagnostic(const OutputLevel&) const

Returns a ModelState from this component at a specified level of detail.

See the zero argument version for more details. The output levels reuse those defined in the Logged class. The default level is NOTICE, and only levels such as INFO, DEBUG and TRACE should be used, and should provide extra diagnostic fields.

inline virtual ModelState getStatePrognostic() const

Returns the state of the ModelComponent.

Returns the state of the ModelComponent and any ModelComponents it depends on.

The state returned by this function contains all the data necessary to restart this component and all components that it calls.

Public Static Functions

static inline ModelArrayStore &getStore()

Returns the ModelArrayAccessor backing store for column physics fields.

template<typename Fn>
static inline void overElementsAuto(Fn &&fn)
template<typename Fn>
static inline void overElements(Fn fn)

Protected Functions

inline virtual ConfigMap getConfiguration() const

Returns a map of the configuration used by the component.

Protected Static Functions

static void setOceanMask(const ModelArray &mask)

Sets the model-wide land-ocean mask (for HField arrays).

Parameters:

mask – The HField ModelArray containing the mask data. 0/false is land, >0 is sea.

static void noLandMask()

If there is no valid land mask, assume all points are ocean and initialize accordingly.

static ModelArray mask(const ModelArray &data, FloatType missingValue = MissingData::value())

Returns a copy of the provided ModelArray, masked according to the land-ocean mask.

Parameters:
  • data – The data to be masked.

  • missingValue – The mask value to use (defaults to MissingData::value()).

static const ModelArray &oceanMask()

Returns the ocean mask.

static inline ModelArray &oceanMaskSingleton()