PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
FrontalMelt.hh
Go to the documentation of this file.
1// Copyright (C) 2018, 2019, 2021, 2022, 2023, 2025 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
67 virtual std::set<VariableMetadata> state_impl() const;
68 virtual void write_state_impl(const OutputFile &output) const;
69
72
73 virtual const array::Scalar& frontal_melt_rate_impl() const = 0;
74
76 array::Scalar &result) const;
77
78 std::shared_ptr<FrontalMelt> m_input_model;
79
80 bool apply(const array::CellType1 &M, int i, int j) const;
81
84};
85
86} // end of namespace frontalmelt
87} // end of namespace pism
88
89#endif // __PISMFrontalMelt_hh
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
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)
virtual void write_state_impl(const OutputFile &output) const
The default (empty implementation).
virtual std::set< VariableMetadata > state_impl() const
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 TSDiagnosticList scalar_diagnostics_impl() const
virtual DiagnosticList spatial_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
const array::Scalar & frontal_melt_rate() const
virtual void init_impl(const Geometry &geometry)
virtual const array::Scalar & frontal_melt_rate_impl() const =0
virtual ~FrontalMelt()=default
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