Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Formulas.cc
Go to the documentation of this file.
1/* Copyright (C) 2014, 2015, 2016, 2017, 2018, 2019, 2023 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 "pism/coupler/surface/Formulas.hh"
21#include "pism/coupler/AtmosphereModel.hh"
22#include "pism/util/pism_utilities.hh"
23
24namespace pism {
25namespace surface {
26
36
38 return *m_mass_flux;
39}
40
44
48
50 return *m_melt;
51}
52
54 return *m_runoff;
55}
56
57void 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
61 m_temperature->define(output, io::PISM_DOUBLE);
62}
63
64void 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
std::shared_ptr< const Grid > grid() const
Definition Component.cc:105
High-level PISM I/O class.
Definition File.hh:55
void define(const File &file, io::Type default_type) const
Define variables corresponding to an Array in a file opened using file.
Definition Array.cc:463
std::shared_ptr< array::Scalar > m_temperature
Definition Formulas.hh:50
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
Definition Formulas.cc:64
const array::Scalar & mass_flux_impl() const
Definition Formulas.cc:37
const array::Scalar & temperature_impl() const
Definition Formulas.cc:41
PSFormulas(std::shared_ptr< const Grid > g)
Definition Formulas.cc:27
const array::Scalar & melt_impl() const
Definition Formulas.cc:49
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
Definition Formulas.cc:57
const array::Scalar & runoff_impl() const
Definition Formulas.cc:53
const array::Scalar & accumulation_impl() const
Definition Formulas.cc:45
std::shared_ptr< array::Scalar > m_mass_flux
Definition Formulas.hh:49
static std::shared_ptr< array::Scalar > allocate_runoff(std::shared_ptr< const Grid > grid)
static std::shared_ptr< array::Scalar > allocate_mass_flux(std::shared_ptr< const Grid > grid)
std::shared_ptr< array::Scalar > m_melt
static std::shared_ptr< array::Scalar > allocate_temperature(std::shared_ptr< const Grid > grid)
static std::shared_ptr< array::Scalar > allocate_accumulation(std::shared_ptr< const Grid > grid)
static std::shared_ptr< array::Scalar > allocate_melt(std::shared_ptr< const Grid > grid)
std::shared_ptr< array::Scalar > m_runoff
std::shared_ptr< array::Scalar > m_accumulation
The interface of PISM's surface models.
@ PISM_DOUBLE
Definition IO_Flags.hh:52