PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
Formulas.cc
Go to the documentation of this file.
1/* Copyright (C) 2014, 2015, 2016, 2017, 2018, 2019, 2023, 2025 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
57std::set<VariableMetadata> PSFormulas::state_impl() 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 return array::metadata({ m_mass_flux.get(), m_temperature.get() });
61}
62
63void PSFormulas::write_state_impl(const OutputFile &output) const {
64 // these are *not* model state, but I want to be able to re-start from a file produced using this
65 // class
66 m_mass_flux->write(output);
67 m_temperature->write(output);
68}
69
70} // end of namespace surface
71} // end of namespace pism
std::shared_ptr< const Grid > grid() const
Definition Component.cc:107
void write(const OutputFile &file) const
Definition Array.cc:859
std::shared_ptr< array::Scalar > m_temperature
Definition Formulas.hh:50
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 std::set< VariableMetadata > state_impl() const
Definition Formulas.cc:57
const array::Scalar & runoff_impl() const
Definition Formulas.cc:53
const array::Scalar & accumulation_impl() const
Definition Formulas.cc:45
virtual void write_state_impl(const OutputFile &output) const
The default (empty implementation).
Definition Formulas.cc:63
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.
std::set< VariableMetadata > metadata(std::initializer_list< const Array * > vecs)
Definition Array.cc:1244