PISM, A Parallel Ice Sheet Model  stable v2.0.6 committed by Constantine Khrulev on 2023-01-23 15:14:38 -0900
Formulas.cc
Go to the documentation of this file.
1 /* Copyright (C) 2014, 2015, 2016, 2017, 2018, 2019 PISM Authors
2  *
3  * This file is part of PISM.
4  *
5  * PISM is free software; you can redistribute it and/or modify it under the
6  * terms of the GNU General Public License as published by the Free Software
7  * Foundation; either version 3 of the License, or (at your option) any later
8  * version.
9  *
10  * PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with PISM; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #include "Formulas.hh"
21 #include "pism/coupler/AtmosphereModel.hh"
22 #include "pism/util/pism_utilities.hh"
23 
24 namespace pism {
25 namespace surface {
26 
28  : SurfaceModel(grid) {
29 
35 }
36 
38  return *m_mass_flux;
39 }
40 
42  return *m_temperature;
43 }
44 
46  return *m_accumulation;
47 }
48 
50  return *m_melt;
51 }
52 
54  return *m_runoff;
55 }
56 
57 void PSFormulas::define_model_state_impl(const File &output) const {
58  // these are *not* model state, but I want to be able to re-start from a file produced using this
59  // class
60  m_mass_flux->define(output);
61  m_temperature->define(output);
62 }
63 
64 void PSFormulas::write_model_state_impl(const File &output) const {
65  // these are *not* model state, but I want to be able to re-start from a file produced using this
66  // class
67  m_mass_flux->write(output);
68  m_temperature->write(output);
69 }
70 
71 } // end of namespace surface
72 } // end of namespace pism
IceGrid::ConstPtr grid() const
Definition: Component.cc:105
High-level PISM I/O class.
Definition: File.hh:51
std::shared_ptr< const IceGrid > ConstPtr
Definition: IceGrid.hh:233
const IceModelVec2S & accumulation_impl() const
Definition: Formulas.cc:45
IceModelVec2S::Ptr m_mass_flux
Definition: Formulas.hh:50
const IceModelVec2S & runoff_impl() const
Definition: Formulas.cc:53
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
Definition: Formulas.cc:64
PSFormulas(IceGrid::ConstPtr g)
Definition: Formulas.cc:27
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
Definition: Formulas.cc:57
const IceModelVec2S & mass_flux_impl() const
Definition: Formulas.cc:37
const IceModelVec2S & temperature_impl() const
Definition: Formulas.cc:41
const IceModelVec2S & melt_impl() const
Definition: Formulas.cc:49
IceModelVec2S::Ptr m_temperature
Definition: Formulas.hh:51
static IceModelVec2S::Ptr allocate_mass_flux(IceGrid::ConstPtr grid)
Definition: SurfaceModel.cc:76
IceModelVec2S::Ptr m_melt
static IceModelVec2S::Ptr allocate_melt(IceGrid::ConstPtr grid)
IceModelVec2S::Ptr m_accumulation
static IceModelVec2S::Ptr allocate_temperature(IceGrid::ConstPtr grid)
Definition: SurfaceModel.cc:93
static IceModelVec2S::Ptr allocate_accumulation(IceGrid::ConstPtr grid)
static IceModelVec2S::Ptr allocate_runoff(IceGrid::ConstPtr grid)
IceModelVec2S::Ptr m_runoff
The interface of PISM's surface models.
Definition: SurfaceModel.hh:45