tSIAFD.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
---
tSIAFD.hh (4830B)
---
1 // Copyright (C) 2004--2019 Jed Brown, Ed Bueler and Constantine Khroulev
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 _SIAFD_H_
20 #define _SIAFD_H_
21
22 #include "pism/stressbalance/SSB_Modifier.hh" // derives from SSB_Modifier
23
24 namespace pism {
25
26 class Geometry;
27
28 namespace stressbalance {
29
30 class BedSmoother;
31
32 /** Implements the shallow ice approximation stress balance.
33 *
34 * Inputs:
35 *
36 * - ice geometry (thickness, bed elevation, surface elevation, cell
37 * type mask)
38 * - ice enthalpy
39 * - ice age (could be used to compute the grain size)
40 * - sliding velocity
41 *
42 * Outputs:
43 *
44 * - horizontal velocity (3D fields)
45 * - diffusive ice flux (for use in the geometry update)
46 * - maximum diffusivity (used to determine the maximum allowed time
47 * step length)
48 * - volumetric strain heating
49 */
50 class SIAFD : public SSB_Modifier
51 {
52 public:
53 SIAFD(IceGrid::ConstPtr g);
54
55 virtual ~SIAFD();
56
57 virtual void init();
58
59 virtual void update(const IceModelVec2V &sliding_velocity,
60 const Inputs &inputs,
61 bool full_update);
62
63 const BedSmoother& bed_smoother() const;
64
65 const IceModelVec2Stag& surface_gradient_x() const;
66 const IceModelVec2Stag& surface_gradient_y() const;
67 const IceModelVec2Stag& diffusivity() const;
68
69 protected:
70 virtual DiagnosticList diagnostics_impl() const;
71
72 virtual void compute_surface_gradient(const Inputs &inputs,
73 IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
74
75 virtual void surface_gradient_eta(const IceModelVec2S &ice_thickness,
76 const IceModelVec2S &bed_elevation,
77 IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
78 virtual void surface_gradient_haseloff(const IceModelVec2S &ice_surface_elevation,
79 const IceModelVec2CellType &cell_type,
80 IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
81 virtual void surface_gradient_mahaffy(const IceModelVec2S &ice_surface_elevation,
82 IceModelVec2Stag &h_x, IceModelVec2Stag &h_y);
83
84 virtual void compute_diffusivity(bool full_update,
85 const Geometry &geometry,
86 const IceModelVec3 *enthalpy,
87 const IceModelVec3 *age,
88 const IceModelVec2Stag &h_x,
89 const IceModelVec2Stag &h_y,
90 IceModelVec2Stag &result);
91
92 virtual void compute_diffusive_flux(const IceModelVec2Stag &h_x, const IceModelVec2Stag &h_y,
93 const IceModelVec2Stag &diffusivity,
94 IceModelVec2Stag &result);
95
96 virtual void compute_3d_horizontal_velocity(const Geometry &geometry,
97 const IceModelVec2Stag &h_x,
98 const IceModelVec2Stag &h_y,
99 const IceModelVec2V &vel_input,
100 IceModelVec3 &u_out, IceModelVec3 &v_out);
101
102 virtual void compute_I(const Geometry &geometry);
103
104 bool interglacial(double accumulation_time);
105
106 const unsigned int m_stencil_width;
107
108 //! temporary storage for eta, theta and the smoothed thickness
109 IceModelVec2S m_work_2d_0;
110 IceModelVec2S m_work_2d_1;
111 //! temporary storage for the surface gradient and the diffusivity
112 IceModelVec2Stag m_h_x, m_h_y, m_D;
113 //! temporary storage for delta on the staggered grid
114 IceModelVec3 m_delta_0;
115 IceModelVec3 m_delta_1;
116 //! temporary storage used to store I and strain_heating on the staggered grid
117 IceModelVec3 m_work_3d_0;
118 IceModelVec3 m_work_3d_1;
119
120 BedSmoother *m_bed_smoother;
121
122 // profiling
123 int m_event_sia;
124
125 // unit conversion
126 double m_seconds_per_year;
127 // enhancement factor-age coupling parameters
128 double m_holocene_start;
129 double m_eemian_start;
130 double m_eemian_end;
131 };
132
133 } // end of namespace stressbalance
134 } // end of namespace pism
135
136 #endif /* _SIAFD_H_ */