15PrognosticData::PrognosticData()
17 , m_thick(ModelArray::Type::H)
18 , m_conc(ModelArray::Type::H)
19 , m_snow(ModelArray::Type::H)
20 , m_tice(ModelArray::Type::Z)
26 registerProtectedArray(ProtectedArray::H_ICE, &m_thick);
27 registerProtectedArray(ProtectedArray::C_ICE, &m_conc);
28 registerProtectedArray(ProtectedArray::H_SNOW, &m_snow);
29 registerProtectedArray(ProtectedArray::T_ICE, &m_tice);
32void PrognosticData::configure()
34 pAtmBdy = &Module::getImplementation<IAtmosphereBoundary>();
37 pOcnBdy = &Module::getImplementation<IOceanBoundary>();
40 pDynamics = &Module::getImplementation<IDynamics>();
46void PrognosticData::setData(
const ModelState::DataMap& ms)
49 if (ms.count(
"mask")) {
50 setOceanMask(ms.at(
"mask"));
55 m_thick = ms.at(
"hice");
56 m_conc = ms.at(
"cice");
57 m_tice = ms.at(
"tice");
58 m_snow = ms.at(
"hsnow");
62 pDynamics->setData(ms);
63 iceGrowth.setData(ms);
73 pOcnBdy->updateBefore(tst);
77 iceGrowth.initializeThicknesses();
78 pDynamics->update(tst);
79 updatePrognosticFields();
83 iceGrowth.update(tst);
84 updatePrognosticFields();
86 pOcnBdy->updateAfter(tst);
89void PrognosticData::updatePrognosticFields()
97 HField hiceUpd = hiceTrueUpd * ciceUpd;
98 HField hsnowUpd = hsnowTrueUpd * ciceUpd;
100 m_thick.setData(hiceUpd);
101 m_conc.setData(ciceUpd);
102 m_snow.setData(hsnowUpd);
103 m_tice.setData(ticeUpd);
110 {
"hice", mask(m_thick) },
111 {
"cice", mask(m_conc) },
112 {
"hsnow", mask(m_snow) },
113 {
"tice", mask(m_tice) },
114 {
"sst", mask(*getProtectedArray().at(
static_cast<size_t>(ProtectedArray::SST))) },
115 {
"sss", mask(*getProtectedArray().at(
static_cast<size_t>(ProtectedArray::SSS))) },
120ModelState PrognosticData::getStateRecursive(
const OutputSpec& os)
const
123 state.merge(pAtmBdy->getStateRecursive(os));
124 state.merge(iceGrowth.getStateRecursive(os));
129PrognosticData::HelpMap& PrognosticData::getHelpText(HelpMap& map,
bool getAll) {
return map; }
130PrognosticData::HelpMap& PrognosticData::getHelpRecursive(HelpMap& map,
bool getAll)
132 Module::getHelpRecursive<IAtmosphereBoundary>(map, getAll);
133 Module::getHelpRecursive<IOceanBoundary>(map, getAll);
134 Module::getHelpRecursive<IDynamics>(map, getAll);
135 IceGrowth::getHelpRecursive(map, getAll);
A class that holds the array data for the model.
A class which provides indirect access to ModelArray.