netxsimdg
Loading...
Searching...
No Matches
Nextsim::PrognosticData Class Reference

#include <PrognosticData.hpp>

Inheritance diagram for Nextsim::PrognosticData:
Inheritance graph
Collaboration diagram for Nextsim::PrognosticData:
Collaboration graph

Public Member Functions

void configure () override
 The configuration function.
 
std::string getName () const override
 Returns the name of the component.
 
void setData (const ModelState::DataMap &ms) override
 Set the initial data of the component from the passed ModelState.
 
ModelState getState () const override
 Returns a ModelState from this component.
 
ModelState getState (const OutputLevel &lvl) const override
 Returns a ModelState from this component at a specified level.
 
ModelState getStateRecursive (const OutputSpec &os) const override
 Returns the state of the ModelComponent and any ModelComponents it depends on.
 
std::unordered_set< std::string > hFields () const override
 Returns the names of all Type::H ModelArrays defined in this component.
 
std::unordered_set< std::string > uFields () const override
 Returns the names of all Type::U ModelArrays defined in this component.
 
std::unordered_set< std::string > vFields () const override
 Returns the names of all Type::V ModelArrays defined in this component.
 
std::unordered_set< std::string > zFields () const override
 Returns the names of all Type::Z ModelArrays defined in this component.
 
void update (const TimestepTime &tsTime)
 Updates the state of the prognostic data for this timestep.
 
const HField & iceThickness ()
 Returns a const reference to the cell-averaged ice thickness field.
 
const HField & iceConcentration ()
 Returns a reference to the ice concentration field.
 
const HField & snowThickness ()
 Returns a const reference to the cell-averaged snow thickness field.
 
const ZField & iceTemperature ()
 Returns a const reference to the (three dimensional) ice temperature field.
 
- Public Member Functions inherited from Nextsim::ModelComponent
- Public Member Functions inherited from Nextsim::Configured< PrognosticData >
const std::map< int, std::string > keyMap
 
const std::map< int, std::string > keyMap
 
const std::map< int, std::string > keyMap
 
const std::map< int, std::string > keyMap
 
virtual ConfigMap getConfiguration () const
 Returns the current configuration of the object.
 
- Public Member Functions inherited from Nextsim::ConfiguredBase

Static Public Member Functions

static HelpMap & getHelpText (HelpMap &map, bool getAll)
 
static HelpMap & getHelpRecursive (HelpMap &map, bool getAll)
 
- Static Public Member Functions inherited from Nextsim::ModelComponent
static void setAllModuleData (const ModelState &stateIn)
 
static ModelState getAllModuleState ()
 
static void unregisterAllModules ()
 
static void getAllFieldNames (std::unordered_set< std::string > &uF, std::unordered_set< std::string > &vF, std::unordered_set< std::string > &zF)
 
static void registerExternalSharedArray (SharedArray type, ModelArray *addr)
 Registers a ModelArray into a SharedArray slot from outside any ModelComponent object. Intended for testing and debugging.
 
static void registerExternalProtectedArray (ProtectedArray type, ModelArray *addr)
 Registers a ModelArray into a ProtectedArray slot from outside any ModelComponent object. Intended for testing and debugging.
 
static const MARBackingStore & getSharedArray ()
 Returns a const reference to the store for SharedArray fields.
 
static const MARConstBackingStore & getProtectedArray ()
 Returns a const reference to the store for ProtectedArray fields.
 
- Static Public Member Functions inherited from Nextsim::Configured< PrognosticData >
static T getConfiguration (const std::string &name, const T &defaultValue)
 Gets the value of the configuration with a given name from the default Configurator.
 
static void tryConfigure (T &ref)
 Template function for conditionally configuring references.
 
static void tryConfigure (T *ptr)
 Template function for conditionally configuring classes via a pointer.
 
static ConfigMap tryGetConfiguration (T &ref)
 Template function for conditionally retrieving class configuration via a reference.
 
static ConfigMap tryGetConfiguration (T *ptr)
 Template function for conditionally retrieving class configuration via a pointer.
 
static HelpMap & getHelpText (HelpMap &map, bool getAll)
 Gets the text to be printed as the help text for this configuration.
 
static HelpMap & getHelpRecursive (HelpMap &map, bool getAll)
 Gets the configuration help text for the current class as well as any classes used herein.
 
static void clearConfigurationMap ()
 Clear the configuration map. Usually used only in test suites.
 

Additional Inherited Members

- Public Types inherited from Nextsim::ModelComponent
enum class  ProtectedArray {
  H_ICE , C_ICE , H_SNOW , T_ICE ,
  T_AIR , DEW_2M , P_AIR , MIXRAT ,
  SW_IN , LW_IN , MLD , SNOW ,
  SSS , SST , EXT_SSS , EXT_SST ,
  EVAP_MINUS_PRECIP , ML_BULK_CP , TF , WIND_SPEED ,
  WIND_U , WIND_V , HTRUE_ICE , HTRUE_SNOW ,
  OCEAN_U , OCEAN_V , ICE_U , ICE_V ,
  SLAB_SST , SLAB_SSS , SLAB_QDW , SLAB_FDW ,
  COUNT
}
 
enum class  SharedArray {
  H_ICE = SharedArrayOffset , C_ICE , H_SNOW , T_ICE ,
  Q_IA , Q_IC , Q_IO , Q_OW ,
  DQIA_DT , Q_PEN_SW , HSNOW_MELT , SUBLIM ,
  DELTA_HICE , DELTA_CICE , NEW_ICE , COUNT
}
 
typedef Logged::level OutputLevel
 
typedef std::function< void(size_t, const TimestepTime &)> IteratedFn
 
- Public Types inherited from Nextsim::Configured< PrognosticData >
typedef ConfigurationHelp::HelpMap HelpMap
 
using ConfigType
 
- Static Public Attributes inherited from Nextsim::ModelComponent
static const size_t SharedArrayOffset = 0
 
- Static Public Attributes inherited from Nextsim::Configured< PrognosticData >
static const std::map< int, std::string > keyMap
 A per-class static map to provide compile-time checking of configuration keys.
 
- Protected Member Functions inherited from Nextsim::ModelComponent
void registerModule ()
 
- Protected Member Functions inherited from Nextsim::Configured< PrognosticData >
void addOption (const std::string &name, const T &defaultValue)
 Adds an option to the per-class option map.
 
retrieveValue (const std::string &name)
 Retrieves a configured value of a single option.
 
- Static Protected Member Functions inherited from Nextsim::ModelComponent
static void registerSharedArray (SharedArray type, ModelArray *addr)
 
static void registerProtectedArray (ProtectedArray type, const ModelArray *addr)
 
static void overElements (IteratedFn fn, const TimestepTime &tst)
 
static void setOceanMask (const ModelArray &mask)
 Sets the model-wide land-ocean mask (for HField arrays).
 
static void noLandMask ()
 
static ModelArray mask (const ModelArray &data)
 Returns a copy of the provided ModelArray, masked according to the land-ocean mask.
 
static const ModelArrayoceanMask ()
 Returns the ocean mask.
 
- Static Protected Attributes inherited from Nextsim::ModelComponent
static ModelArrayp_oceanMaskH = nullptr
 

Detailed Description

A class defining a configurable ModelComponent that stores the prognostic data values and handles their updates in the timestep, including all calls to the variables those calculations depend on.

Definition at line 26 of file PrognosticData.hpp.

Constructor & Destructor Documentation

◆ PrognosticData()

Nextsim::PrognosticData::PrognosticData ( )

Definition at line 15 of file PrognosticData.cpp.

Member Function Documentation

◆ configure()

void Nextsim::PrognosticData::configure ( )
overridevirtual

The configuration function.

Implements Nextsim::Configured< PrognosticData >.

Definition at line 32 of file PrognosticData.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHelpRecursive()

PrognosticData::HelpMap & Nextsim::PrognosticData::getHelpRecursive ( HelpMap & map,
bool getAll )
static

Definition at line 130 of file PrognosticData.cpp.

◆ getHelpText()

PrognosticData::HelpMap & Nextsim::PrognosticData::getHelpText ( HelpMap & map,
bool getAll )
static

Definition at line 129 of file PrognosticData.cpp.

◆ getName()

std::string Nextsim::PrognosticData::getName ( ) const
inlineoverridevirtual

Returns the name of the component.

Implements Nextsim::ModelComponent.

Definition at line 33 of file PrognosticData.hpp.

◆ getState() [1/2]

ModelState Nextsim::PrognosticData::getState ( ) const
overridevirtual

Returns a ModelState from this component.

The ModelState is map between field names and ModelArray data arrays. The intention is to merge together different ModelSatates to produce a combined state. The returned ModelState will include the states of any subsidiary components held by the object. This is the default level of output and should include all and only fields to be placed in the restart file.

Implements Nextsim::ModelComponent.

Definition at line 106 of file PrognosticData.cpp.

◆ getState() [2/2]

ModelState Nextsim::PrognosticData::getState ( const OutputLevel & ) const
inlineoverridevirtual

Returns a ModelState from this component at a specified level.

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.

Implements Nextsim::ModelComponent.

Definition at line 37 of file PrognosticData.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStateRecursive()

ModelState Nextsim::PrognosticData::getStateRecursive ( const OutputSpec & os) const
overridevirtual

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

Used to traverse the current tree of ModelComponents and return the overall model state for diagnostic output.

Reimplemented from Nextsim::ModelComponent.

Definition at line 120 of file PrognosticData.cpp.

◆ hFields()

std::unordered_set< std::string > Nextsim::PrognosticData::hFields ( ) const
inlineoverridevirtual

Returns the names of all Type::H ModelArrays defined in this component.

Reimplemented from Nextsim::ModelComponent.

Definition at line 43 of file PrognosticData.hpp.

◆ iceConcentration()

const HField & Nextsim::PrognosticData::iceConcentration ( )
inline

Returns a reference to the ice concentration field.

Definition at line 62 of file PrognosticData.hpp.

◆ iceTemperature()

const ZField & Nextsim::PrognosticData::iceTemperature ( )
inline

Returns a const reference to the (three dimensional) ice temperature field.

Definition at line 68 of file PrognosticData.hpp.

◆ iceThickness()

const HField & Nextsim::PrognosticData::iceThickness ( )
inline

Returns a const reference to the cell-averaged ice thickness field.

Definition at line 59 of file PrognosticData.hpp.

◆ setData()

void Nextsim::PrognosticData::setData ( const ModelState::DataMap & state)
overridevirtual

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

Parameters
stateThe ModelState containing the data to be set.

Implements Nextsim::ModelComponent.

Definition at line 46 of file PrognosticData.cpp.

Here is the caller graph for this function:

◆ snowThickness()

const HField & Nextsim::PrognosticData::snowThickness ( )
inline

Returns a const reference to the cell-averaged snow thickness field.

Definition at line 65 of file PrognosticData.hpp.

◆ uFields()

std::unordered_set< std::string > Nextsim::PrognosticData::uFields ( ) const
inlineoverridevirtual

Returns the names of all Type::U ModelArrays defined in this component.

Reimplemented from Nextsim::ModelComponent.

Definition at line 47 of file PrognosticData.hpp.

◆ update()

void Nextsim::PrognosticData::update ( const TimestepTime & tsTime)

Updates the state of the prognostic data for this timestep.

Parameters
tsInitialTimethe time at the start of the timestep

Definition at line 66 of file PrognosticData.cpp.

Here is the caller graph for this function:

◆ vFields()

std::unordered_set< std::string > Nextsim::PrognosticData::vFields ( ) const
inlineoverridevirtual

Returns the names of all Type::V ModelArrays defined in this component.

Reimplemented from Nextsim::ModelComponent.

Definition at line 48 of file PrognosticData.hpp.

◆ zFields()

std::unordered_set< std::string > Nextsim::PrognosticData::zFields ( ) const
inlineoverridevirtual

Returns the names of all Type::Z ModelArrays defined in this component.

Reimplemented from Nextsim::ModelComponent.

Definition at line 49 of file PrognosticData.hpp.


The documentation for this class was generated from the following files: