PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
StressCalving.cc
Go to the documentation of this file.
1 /* Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 PISM Authors
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 
20 #include "pism/frontretreat/calving/StressCalving.hh"
21 
22 namespace pism {
23 namespace calving {
24 
25 StressCalving::StressCalving(std::shared_ptr<const Grid> grid,
26  unsigned int stencil_width)
27  : Component(grid),
28  m_stencil_width(stencil_width),
29  m_strain_rates(m_grid, "strain_rates", array::WITH_GHOSTS, 2),
30  m_calving_rate(m_grid, "calving_rate"),
31  m_cell_type(m_grid, "cell_type")
32 {
33 
34  m_strain_rates.metadata(0).set_name("eigen1");
35  m_strain_rates.metadata(0)
36  .long_name("major principal component of horizontal strain-rate")
37  .units("second-1");
38 
39  m_strain_rates.metadata(1).set_name("eigen2");
40  m_strain_rates.metadata(1)
41  .long_name("minor principal component of horizontal strain-rate")
42  .units("second-1");
43 
45  .long_name("horizontal calving rate")
46  .units("m s-1")
47  .output_units("m year-1");
48 
49  m_cell_type.metadata(0).long_name("cell type mask");
50 }
51 
53  return m_calving_rate;
54 }
55 
56 } // end of namespace calving
57 } // end of namespace pism
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:118
VariableMetadata & long_name(const std::string &input)
VariableMetadata & output_units(const std::string &input)
VariableMetadata & units(const std::string &input)
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
Definition: Array.cc:553
array::Array2D< stressbalance::PrincipalStrainRates > m_strain_rates
const array::Scalar & calving_rate() const
array::CellType1 m_cell_type
StressCalving(std::shared_ptr< const Grid > grid, unsigned int stencil_width)
@ WITH_GHOSTS
Definition: Array.hh:62