PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
SIAFD.hh
Go to the documentation of this file.
1 // Copyright (C) 2004--2019, 2021, 2022 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(std::shared_ptr<const Grid> g);
54 
55  virtual ~SIAFD();
56 
57  virtual void init();
58 
59  virtual void update(const array::Vector &sliding_velocity,
60  const Inputs &inputs,
61  bool full_update);
62 
63  const BedSmoother& bed_smoother() const;
64 
65  const array::Staggered& surface_gradient_x() const;
66  const array::Staggered& surface_gradient_y() const;
67  const array::Staggered1& diffusivity() const;
68 
69 protected:
70  virtual DiagnosticList diagnostics_impl() const;
71 
72  virtual void compute_surface_gradient(const Inputs &inputs,
73  array::Staggered1 &h_x,
74  array::Staggered1 &h_y);
75 
76  virtual void surface_gradient_eta(const array::Scalar2 &ice_thickness,
77  const array::Scalar2 &bed_elevation,
78  array::Staggered1 &h_x,
79  array::Staggered1 &h_y);
80  virtual void surface_gradient_haseloff(const array::Scalar2 &ice_surface_elevation,
81  const array::CellType2 &cell_type,
82  array::Staggered1 &h_x,
83  array::Staggered1 &h_y);
84  virtual void surface_gradient_mahaffy(const array::Scalar &ice_surface_elevation,
85  array::Staggered1 &h_x,
86  array::Staggered1 &h_y);
87 
88  virtual void compute_diffusivity(bool full_update,
89  const Geometry &geometry,
90  const array::Array3D *enthalpy,
91  const array::Array3D *age,
92  const array::Staggered1 &h_x,
93  const array::Staggered1 &h_y,
94  array::Staggered1 &result);
95 
96  virtual void compute_diffusive_flux(const array::Staggered &h_x, const array::Staggered &h_y,
98  array::Staggered &result);
99 
100  virtual void compute_3d_horizontal_velocity(const Geometry &geometry,
101  const array::Staggered &h_x,
102  const array::Staggered &h_y,
103  const array::Vector &vel_input,
104  array::Array3D &u_out, array::Array3D &v_out);
105 
106  virtual void compute_I(const Geometry &geometry);
107 
108  bool interglacial(double accumulation_time) const;
109 
110  const unsigned int m_stencil_width;
111 
112  //! temporary storage for eta, theta and the smoothed thickness
115  //! temporary storage for the surface gradient and the diffusivity
117  //! temporary storage for delta on the staggered grid
120  //! temporary storage used to store I and strain_heating on the staggered grid
123 
125 
126  // profiling
128 
129  // unit conversion
131  // enhancement factor-age coupling parameters
134  double m_eemian_end;
135 
136  double m_e_factor;
138 };
139 
140 } // end of namespace stressbalance
141 } // end of namespace pism
142 
143 #endif /* _SIAFD_H_ */
A virtual class collecting methods common to ice and bedrock 3D fields.
Definition: Array3D.hh:33
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
Definition: Staggered.hh:35
PISM bed smoother, plus bed roughness parameterization, based on Schoof (2003).
Definition: BedSmoother.hh:85
virtual void compute_diffusivity(bool full_update, const Geometry &geometry, const array::Array3D *enthalpy, const array::Array3D *age, const array::Staggered1 &h_x, const array::Staggered1 &h_y, array::Staggered1 &result)
Compute the SIA diffusivity. If full_update, also store delta on the staggered grid.
Definition: SIAFD.cc:529
virtual void compute_surface_gradient(const Inputs &inputs, array::Staggered1 &h_x, array::Staggered1 &h_y)
Compute the ice surface gradient for the SIA.
Definition: SIAFD.cc:188
array::Staggered1 m_D
Definition: SIAFD.hh:116
virtual void surface_gradient_eta(const array::Scalar2 &ice_thickness, const array::Scalar2 &bed_elevation, array::Staggered1 &h_x, array::Staggered1 &h_y)
Compute the ice surface gradient using the eta-transformation.
Definition: SIAFD.cc:215
virtual void update(const array::Vector &sliding_velocity, const Inputs &inputs, bool full_update)
Do the update; if full_update == false skip the update of 3D velocities and strain heating.
Definition: SIAFD.cc:124
array::Staggered1 m_h_y
Definition: SIAFD.hh:116
const unsigned int m_stencil_width
Definition: SIAFD.hh:110
array::Scalar2 m_work_2d_0
temporary storage for eta, theta and the smoothed thickness
Definition: SIAFD.hh:113
const array::Staggered & surface_gradient_x() const
Definition: SIAFD.cc:933
bool interglacial(double accumulation_time) const
Determine if accumulation_time corresponds to an interglacial period.
Definition: SIAFD.cc:921
virtual void surface_gradient_haseloff(const array::Scalar2 &ice_surface_elevation, const array::CellType2 &cell_type, array::Staggered1 &h_x, array::Staggered1 &h_y)
Compute the ice surface gradient using a modification of Marianne Haseloff's approach.
Definition: SIAFD.cc:360
array::Staggered1 m_h_x
temporary storage for the surface gradient and the diffusivity
Definition: SIAFD.hh:116
const BedSmoother & bed_smoother() const
Definition: SIAFD.cc:945
array::Array3D m_work_3d_1
Definition: SIAFD.hh:122
virtual void compute_3d_horizontal_velocity(const Geometry &geometry, const array::Staggered &h_x, const array::Staggered &h_y, const array::Vector &vel_input, array::Array3D &u_out, array::Array3D &v_out)
Compute horizontal components of the SIA velocity (in 3D).
Definition: SIAFD.cc:861
const array::Staggered1 & diffusivity() const
Definition: SIAFD.cc:941
virtual void surface_gradient_mahaffy(const array::Scalar &ice_surface_elevation, array::Staggered1 &h_x, array::Staggered1 &h_y)
Compute the ice surface gradient using the Mary Anne Mahaffy method; see [Mahaffy].
Definition: SIAFD.cc:287
array::Array3D m_work_3d_0
temporary storage used to store I and strain_heating on the staggered grid
Definition: SIAFD.hh:121
array::Array3D m_delta_0
temporary storage for delta on the staggered grid
Definition: SIAFD.hh:118
double m_e_factor_interglacial
Definition: SIAFD.hh:137
BedSmoother * m_bed_smoother
Definition: SIAFD.hh:124
virtual void init()
Initialize the SIA module.
Definition: SIAFD.cc:103
array::Array3D m_delta_1
Definition: SIAFD.hh:119
virtual void compute_I(const Geometry &geometry)
Compute I.
Definition: SIAFD.cc:781
array::Scalar2 m_work_2d_1
Definition: SIAFD.hh:114
virtual void compute_diffusive_flux(const array::Staggered &h_x, const array::Staggered &h_y, const array::Staggered &diffusivity, array::Staggered &result)
Definition: SIAFD.cc:747
SIAFD(std::shared_ptr< const Grid > g)
Definition: SIAFD.cc:41
virtual DiagnosticList diagnostics_impl() const
const array::Staggered & surface_gradient_y() const
Definition: SIAFD.cc:937
Shallow stress balance modifier (such as the non-sliding SIA).
Definition: SSB_Modifier.hh:39
static const double g
Definition: exactTestP.cc:36
std::map< std::string, Diagnostic::Ptr > DiagnosticList
Definition: Diagnostic.hh:125