Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GeometryEvolution.hh
Go to the documentation of this file.
1/* Copyright (C) 2016, 2017, 2019, 2020, 2022, 2023, 2024, 2025 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#ifndef GEOMETRYEVOLUTION_H
21#define GEOMETRYEVOLUTION_H
22
23#include "pism/geometry/Geometry.hh"
24#include "pism/util/Component.hh"
25#include "pism/util/array/Scalar.hh"
26
27namespace pism {
28
29/*!
30 * NB! Write this in a way that does not use ghosts of input fields (copy to temp. storage and
31 * communicate).
32 *
33 * The promise:
34 *
35 * H_change + Href_change = dt * (SMB_rate + BMB_rate - flux_divergence) + conservation_error
36 *
37 * Href == 0 if H > 0
38 */
40public:
41 GeometryEvolution(std::shared_ptr<const Grid> grid);
43
44 void init(const InputOptions &opts);
45
46 void reset();
47
48 void flow_step(const Geometry &ice_geometry, double dt,
49 const array::Vector &advective_velocity,
50 const array::Staggered &diffusive_flux,
51 const array::Scalar &thickness_bc_mask);
52
53 void source_term_step(const Geometry &geometry, double dt,
54 const array::Scalar &thickness_bc_mask,
55 const array::Scalar &surface_mass_balance_rate,
56 const array::Scalar &basal_melt_rate);
57
58 void apply_flux_divergence(Geometry &geometry) const;
59 void apply_mass_fluxes(Geometry &geometry) const;
60
63
66
67 const array::Scalar& conservation_error() const;
68
69 // diagnostic
70 const array::Staggered1& flux_staggered() const;
71 const array::Scalar& flux_divergence() const;
72
73 // "regional" setup
74 virtual void set_no_model_mask(const array::Scalar &mask);
75protected:
76 std::map<std::string,Diagnostic::Ptr> diagnostics_impl() const;
77
78 virtual void init_impl(const InputOptions &opts);
79
80 void update_in_place(double dt,
81 const array::Scalar& bed_topography,
82 const array::Scalar& sea_level,
84 array::Scalar& ice_thickness,
85 array::Scalar& area_specific_volume);
86
87 void residual_redistribution_iteration(const array::Scalar &bed_topography,
88 const array::Scalar &sea_level,
89 array::Scalar1 &ice_surface_elevation,
90 array::Scalar &ice_thickness,
91 array::CellType1 &cell_type,
92 array::Scalar &area_specific_volume,
93 array::Scalar &residual,
94 bool &done);
95
96 virtual void compute_interface_fluxes(const array::CellType1 &cell_type,
97 const array::Scalar &ice_thickness,
98 const array::Vector &velocity,
99 const array::Staggered &diffusive_flux,
100 array::Staggered &output);
101
102 virtual void compute_flux_divergence(double dt,
103 const array::Staggered1 &flux,
104 const array::Scalar &thickness_bc_mask,
106 array::Scalar &output);
107
108 virtual void ensure_nonnegativity(const array::Scalar &ice_thickness,
109 const array::Scalar &area_specific_volume,
110 array::Scalar &thickness_change,
111 array::Scalar &area_specific_volume_change,
113
114 virtual void set_no_model_mask_impl(const array::Scalar &mask);
115
116 // note: cells with area_specific_volume > 0 do not experience changes due to surface and basal
117 // mass balance sources
118 virtual void compute_surface_and_basal_mass_balance(double dt,
119 const array::Scalar &thickness_bc_mask,
120 const array::Scalar &ice_thickness,
121 const array::CellType &cell_type,
122 const array::Scalar &surface_mass_flux,
123 const array::Scalar &basal_melt_rate,
124 array::Scalar &effective_SMB,
125 array::Scalar &effective_BMB);
126
127 struct Impl;
129};
130
132public:
133 RegionalGeometryEvolution(std::shared_ptr<const Grid> grid);
134
135protected:
136 void set_no_model_mask_impl(const array::Scalar &mask);
137
138 void compute_interface_fluxes(const array::CellType1 &cell_type,
139 const array::Scalar &ice_thickness,
140 const array::Vector &velocity,
141 const array::Staggered &diffusive_flux,
142 array::Staggered &output);
143
144 void compute_surface_and_basal_mass_balance(double dt, const array::Scalar &thickness_bc_mask,
145 const array::Scalar &ice_thickness,
146 const array::CellType &cell_type,
147 const array::Scalar &surface_mass_flux,
148 const array::Scalar &basal_melt_rate,
149 array::Scalar &effective_SMB,
150 array::Scalar &effective_BMB);
151
152private:
154};
155
156/*!
157 * Compute the ice flow rate across the grounding line over a time step, adding to
158 * `output` to accumulate contributions from multiple time steps.
159 *
160 * The units of `output` are "kg".
161 *
162 * Negative flux corresponds to ice moving into the ocean, i.e. from grounded to floating
163 * areas. (This convention makes it easier to compare this quantity to the surface mass
164 * balance or calving fluxes.)
165 */
167 const array::Staggered1 &flux,
168 double unit_conversion_factor, array::Scalar &output);
169
170
171/*!
172 * Compute the total grounding line flux over a time step, in kg.
173 */
174double total_grounding_line_flux(const array::CellType1 &cell_type,
175 const array::Staggered1 &flux,
176 double dt);
177} // end of namespace pism
178
179#endif /* GEOMETRYEVOLUTION_H */
std::shared_ptr< const Grid > grid() const
Definition Component.cc:105
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
const array::Scalar & thickness_change_due_to_flow() const
virtual void set_no_model_mask(const array::Scalar &mask)
virtual void init_impl(const InputOptions &opts)
virtual void compute_surface_and_basal_mass_balance(double dt, const array::Scalar &thickness_bc_mask, const array::Scalar &ice_thickness, const array::CellType &cell_type, const array::Scalar &surface_mass_flux, const array::Scalar &basal_melt_rate, array::Scalar &effective_SMB, array::Scalar &effective_BMB)
const array::Scalar & bottom_surface_mass_balance() const
void apply_mass_fluxes(Geometry &geometry) const
virtual void set_no_model_mask_impl(const array::Scalar &mask)
void source_term_step(const Geometry &geometry, double dt, const array::Scalar &thickness_bc_mask, const array::Scalar &surface_mass_balance_rate, const array::Scalar &basal_melt_rate)
const array::Scalar & flux_divergence() const
void update_in_place(double dt, const array::Scalar &bed_topography, const array::Scalar &sea_level, const array::Scalar &flux_divergence, array::Scalar &ice_thickness, array::Scalar &area_specific_volume)
virtual void ensure_nonnegativity(const array::Scalar &ice_thickness, const array::Scalar &area_specific_volume, array::Scalar &thickness_change, array::Scalar &area_specific_volume_change, array::Scalar &conservation_error)
virtual void compute_interface_fluxes(const array::CellType1 &cell_type, const array::Scalar &ice_thickness, const array::Vector &velocity, const array::Staggered &diffusive_flux, array::Staggered &output)
void flow_step(const Geometry &ice_geometry, double dt, const array::Vector &advective_velocity, const array::Staggered &diffusive_flux, const array::Scalar &thickness_bc_mask)
const array::Scalar & top_surface_mass_balance() const
void apply_flux_divergence(Geometry &geometry) const
const array::Scalar & area_specific_volume_change_due_to_flow() const
virtual void compute_flux_divergence(double dt, const array::Staggered1 &flux, const array::Scalar &thickness_bc_mask, array::Scalar &conservation_error, array::Scalar &output)
void residual_redistribution_iteration(const array::Scalar &bed_topography, const array::Scalar &sea_level, array::Scalar1 &ice_surface_elevation, array::Scalar &ice_thickness, array::CellType1 &cell_type, array::Scalar &area_specific_volume, array::Scalar &residual, bool &done)
Perform one iteration of the residual mass redistribution.
const array::Scalar & conservation_error() const
const array::Staggered1 & flux_staggered() const
void init(const InputOptions &opts)
std::map< std::string, Diagnostic::Ptr > diagnostics_impl() const
void compute_surface_and_basal_mass_balance(double dt, const array::Scalar &thickness_bc_mask, const array::Scalar &ice_thickness, const array::CellType &cell_type, const array::Scalar &surface_mass_flux, const array::Scalar &basal_melt_rate, array::Scalar &effective_SMB, array::Scalar &effective_BMB)
void compute_interface_fluxes(const array::CellType1 &cell_type, const array::Scalar &ice_thickness, const array::Vector &velocity, const array::Staggered &diffusive_flux, array::Staggered &output)
void set_no_model_mask_impl(const array::Scalar &mask)
"Cell type" mask. Adds convenience methods to array::Scalar.
Definition CellType.hh:30
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
Definition Staggered.hh:37
double total_grounding_line_flux(const array::CellType1 &cell_type, const array::Staggered1 &flux, double dt)
void ice_flow_rate_across_grounding_line(const array::CellType1 &cell_type, const array::Staggered1 &flux, double unit_conversion_factor, array::Scalar &output)