netxsimdg
Loading...
Searching...
No Matches
PrognosticData.hpp
Go to the documentation of this file.
1
8#ifndef PROGNOSTICDATA_HPP
9#define PROGNOSTICDATA_HPP
10
11#include "ModelComponent.hpp"
13#include "include/IAtmosphereBoundary.hpp"
14#include "include/IDynamics.hpp"
15#include "include/IOceanBoundary.hpp"
16#include "include/IceGrowth.hpp"
17#include "include/Time.hpp"
18
19namespace Nextsim {
20
26class PrognosticData : public ModelComponent, public Configured<PrognosticData> {
27public:
29 virtual ~PrognosticData() = default;
30
31 void configure() override;
32
33 std::string getName() const override { return "PrognosticData"; };
34
35 void setData(const ModelState::DataMap& ms) override;
36 ModelState getState() const override;
37 ModelState getState(const OutputLevel& lvl) const override { return getState(); }
38 ModelState getStateRecursive(const OutputSpec& os) const override;
39
40 static HelpMap& getHelpText(HelpMap& map, bool getAll);
41 static HelpMap& getHelpRecursive(HelpMap& map, bool getAll);
42
43 std::unordered_set<std::string> hFields() const override
44 {
45 return { "h_ice", "c_cice", "h_snow" };
46 };
47 std::unordered_set<std::string> uFields() const override { return { "u" }; }
48 std::unordered_set<std::string> vFields() const override { return { "v" }; }
49 std::unordered_set<std::string> zFields() const override { return { "tice" }; }
50
56 void update(const TimestepTime& tsTime);
57
59 const HField& iceThickness() { return m_thick; }
60
62 const HField& iceConcentration() { return m_conc; }
63
65 const HField& snowThickness() { return m_snow; }
66
68 const ZField& iceTemperature() { return m_tice; }
69
70private:
71 HField m_thick;
72 HField m_conc;
73 ZField m_tice;
74 HField m_snow;
75 double m_dt;
76
77 IAtmosphereBoundary* pAtmBdy;
78 IOceanBoundary* pOcnBdy;
79 IDynamics* pDynamics;
80 IceGrowth iceGrowth;
81
82 void updatePrognosticFields();
83};
84
85} /* namespace Nextsim */
86
87#endif /* PROGNOSTICDATA_HPP */
const HField & iceThickness()
Returns a const reference to the cell-averaged ice thickness field.
ModelState getStateRecursive(const OutputSpec &os) const override
Returns the state of the ModelComponent and any ModelComponents it depends on.
void update(const TimestepTime &tsTime)
Updates the state of the prognostic data for this timestep.
const HField & iceConcentration()
Returns a reference to the ice concentration field.
void setData(const ModelState::DataMap &ms) override
Set the initial data of the component from the passed ModelState.
std::unordered_set< std::string > vFields() const override
Returns the names of all Type::V ModelArrays defined in this component.
const HField & snowThickness()
Returns a const reference to the cell-averaged snow thickness field.
std::unordered_set< std::string > zFields() const override
Returns the names of all Type::Z ModelArrays defined in this component.
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::string getName() const override
Returns the name of the component.
const ZField & iceTemperature()
Returns a const reference to the (three dimensional) ice temperature field.
void configure() override
The configuration function.
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.