tFrontalMelt.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
HTML git clone git://src.adamsgaard.dk/pism
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tFrontalMelt.hh (2865B)
---
1 // Copyright (C) 2018, 2019 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
26 namespace pism {
27
28 class IceModelVec2S;
29 class Geometry;
30
31 class FrontalMeltInputs {
32 public:
33 FrontalMeltInputs();
34
35 const Geometry *geometry;
36
37 // used by DischargeRouting
38 const IceModelVec2S *subglacial_water_flux;
39
40 };
41
42 //! @brief Frontal melt models and modifiers.
43 namespace frontalmelt {
44
45 //! A very rudimentary PISM frontal melt model.
46 class FrontalMelt : public Component {
47 public:
48 // "modifier" constructor
49 FrontalMelt(IceGrid::ConstPtr g, std::shared_ptr<FrontalMelt> input);
50 // "model" constructor
51 FrontalMelt(IceGrid::ConstPtr g);
52
53 virtual ~FrontalMelt();
54
55 void init(const Geometry &geometry);
56
57 void update(const FrontalMeltInputs &inputs, double t, double dt);
58
59 const IceModelVec2S& frontal_melt_rate() const;
60
61 const IceModelVec2S& retreat_rate() const;
62
63 protected:
64 virtual void init_impl(const Geometry &geometry);
65
66 // provides default (pass-through) implementations for "modifiers"
67 virtual void update_impl(const FrontalMeltInputs &inputs, double t, double dt);
68 virtual MaxTimestep max_timestep_impl(double t) const;
69 virtual void define_model_state_impl(const File &output) const;
70 virtual void write_model_state_impl(const File &output) const;
71
72 virtual DiagnosticList diagnostics_impl() const;
73 virtual TSDiagnosticList ts_diagnostics_impl() const;
74
75 virtual const IceModelVec2S& frontal_melt_rate_impl() const = 0;
76
77 void compute_retreat_rate(const Geometry &geometry, const IceModelVec2S &frontal_melt_rate,
78 IceModelVec2S &result) const;
79
80 protected:
81 std::shared_ptr<FrontalMelt> m_input_model;
82
83 static IceModelVec2S::Ptr allocate_frontal_melt_rate(IceGrid::ConstPtr g,
84 int stencil_width = 0);
85
86 bool apply(const IceModelVec2CellType &M, int i, int j);
87
88 IceModelVec2S m_retreat_rate;
89 bool m_include_floating_ice;
90 };
91
92 } // end of namespace frontalmelt
93 } // end of namespace pism
94
95 #endif // __PISMFrontalMelt_hh