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
FrontalMelt.hh
Go to the documentation of this file.
1// Copyright (C) 2018, 2019, 2021, 2022, 2023 Constantine Khroulev and Andy Aschwanden
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#ifndef __PISMFrontalMelt_hh
20#define __PISMFrontalMelt_hh
21
22#include <memory>
23
24#include "pism/util/Component.hh"
25
26namespace pism {
27
29public:
31
33
34 // used by DischargeRouting
36
37};
38
39//! @brief Frontal melt models and modifiers.
40namespace frontalmelt {
41
42//! A very rudimentary PISM frontal melt model.
43class FrontalMelt : public Component {
44public:
45 // "modifier" constructor
46 FrontalMelt(std::shared_ptr<const Grid> g, std::shared_ptr<FrontalMelt> input);
47 // "model" constructor
48 FrontalMelt(std::shared_ptr<const Grid> g);
49
50 virtual ~FrontalMelt() = default;
51
52 void init(const Geometry &geometry);
53
54 void update(const FrontalMeltInputs &inputs, double t, double dt);
55
56 const array::Scalar& frontal_melt_rate() const;
57
58 const array::Scalar& retreat_rate() const;
59
60protected:
61 virtual void init_impl(const Geometry &geometry);
62
63 // provides default (pass-through) implementations for "modifiers"
64 virtual void update_impl(const FrontalMeltInputs &inputs, double t, double dt);
65 virtual MaxTimestep max_timestep_impl(double t) const;
66 virtual void define_model_state_impl(const File &output) const;
67 virtual void write_model_state_impl(const File &output) const;
68
69 virtual DiagnosticList diagnostics_impl() const;
71
72 virtual const array::Scalar& frontal_melt_rate_impl() const = 0;
73
75 array::Scalar &result) const;
76
77 std::shared_ptr<FrontalMelt> m_input_model;
78
79 bool apply(const array::CellType1 &M, int i, int j) const;
80
83};
84
85} // end of namespace frontalmelt
86} // end of namespace pism
87
88#endif // __PISMFrontalMelt_hh
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
High-level PISM I/O class.
Definition File.hh:55
const Geometry * geometry
const array::Scalar * subglacial_water_flux
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
virtual MaxTimestep max_timestep_impl(double t) const
void init(const Geometry &geometry)
void update(const FrontalMeltInputs &inputs, double t, double dt)
void compute_retreat_rate(const Geometry &geometry, const array::Scalar &frontal_melt_rate, array::Scalar &result) const
std::shared_ptr< FrontalMelt > m_input_model
virtual DiagnosticList diagnostics_impl() const
virtual void update_impl(const FrontalMeltInputs &inputs, double t, double dt)
const array::Scalar & retreat_rate() const
bool apply(const array::CellType1 &M, int i, int j) const
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
const array::Scalar & frontal_melt_rate() const
virtual TSDiagnosticList ts_diagnostics_impl() const
virtual void init_impl(const Geometry &geometry)
virtual const array::Scalar & frontal_melt_rate_impl() const =0
virtual ~FrontalMelt()=default
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
A very rudimentary PISM frontal melt model.
static const double g
Definition exactTestP.cc:36
std::map< std::string, TSDiagnostic::Ptr > TSDiagnosticList
std::map< std::string, Diagnostic::Ptr > DiagnosticList