PISM, A Parallel Ice Sheet Model  stable v2.0.4 committed by Constantine Khrulev on 2022-05-25 12:02:27 -0800
Geometry.hh
Go to the documentation of this file.
1 /* Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021 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 GEOMETRY_H
21 #define GEOMETRY_H
22 
23 #include "pism/util/IceGrid.hh"
24 #include "pism/util/iceModelVec.hh"
25 #include "pism/util/IceModelVec2CellType.hh"
26 
27 namespace pism {
28 
29 class Geometry {
30 private:
31  const int m_stencil_width;
32 public:
33  Geometry(const IceGrid::ConstPtr &grid);
34 
35  /*!
36  * Ensures consistency of ice geometry by re-computing cell type, cell grounded fraction, and ice
37  * surface elevation.
38  */
39  void ensure_consistency(double ice_free_thickness_threshold);
40 
41  // This is grid information, which is not (strictly speaking) ice geometry, but it should be
42  // available everywhere we use ice geometry.
45 
46  // Part of ice geometry, but managed by the bed model and the ocean model. From the point of view
47  // of the code updating ice geometry, these are inputs. These fields should be filled in before
48  // passing a Geometry instance to the code that uses it.
51 
52  // the minimal "state"
54  IceModelVec2S ice_area_specific_volume; // previously known as Href
55 
56  // redundant fields (can be computed using the ones above)
60 
61  void dump(const char *filename) const;
62 };
63 
64 void ice_bottom_surface(const Geometry &geometry, IceModelVec2S &result);
65 
66 double ice_volume(const Geometry &geometry, double thickness_threshold);
67 double ice_area_floating(const Geometry &geometry, double thickness_threshold);
68 double ice_area_grounded(const Geometry &geometry, double thickness_threshold);
69 double ice_area(const Geometry &geometry, double thickness_threshold);
70 double ice_volume_not_displacing_seawater(const Geometry &geometry,
71  double thickness_threshold);
72 double sea_level_rise_potential(const Geometry &geometry, double thickness_threshold);
73 
74 void set_no_model_strip(const IceGrid &grid, double width, IceModelVec2Int &result);
75 
76 } // end of namespace pism
77 
78 #endif /* GEOMETRY_H */
Geometry(const IceGrid::ConstPtr &grid)
Definition: Geometry.cc:34
IceModelVec2S ice_surface_elevation
Definition: Geometry.hh:59
IceModelVec2S latitude
Definition: Geometry.hh:43
IceModelVec2S longitude
Definition: Geometry.hh:44
void ensure_consistency(double ice_free_thickness_threshold)
Definition: Geometry.cc:122
IceModelVec2S cell_grounded_fraction
Definition: Geometry.hh:58
IceModelVec2CellType cell_type
Definition: Geometry.hh:57
IceModelVec2S bed_elevation
Definition: Geometry.hh:49
const int m_stencil_width
Definition: Geometry.hh:31
IceModelVec2S ice_area_specific_volume
Definition: Geometry.hh:54
void dump(const char *filename) const
Definition: Geometry.cc:199
IceModelVec2S sea_level_elevation
Definition: Geometry.hh:50
IceModelVec2S ice_thickness
Definition: Geometry.hh:53
std::shared_ptr< const IceGrid > ConstPtr
Definition: IceGrid.hh:233
Describes the PISM grid and the distribution of data across processors.
Definition: IceGrid.hh:228
"Cell type" mask. Adds convenience methods to IceModelVec2Int.
A simple class "hiding" the fact that the mask is stored as floating-point scalars (instead of intege...
Definition: iceModelVec.hh:389
double ice_volume_not_displacing_seawater(const Geometry &geometry, double thickness_threshold)
Definition: Geometry.cc:292
double ice_area(const Geometry &geometry, double thickness_threshold)
Computes ice area, in m^2.
Definition: Geometry.cc:330
double ice_area_floating(const Geometry &geometry, double thickness_threshold)
Computes floating ice area, in m^2.
Definition: Geometry.cc:371
double sea_level_rise_potential(const Geometry &geometry, double thickness_threshold)
Computes the sea level rise that would result if all the ice were melted.
Definition: Geometry.cc:393
double ice_volume(const Geometry &geometry, double thickness_threshold)
Computes the ice volume, in m^3.
Definition: Geometry.cc:259
void set_no_model_strip(const IceGrid &grid, double width, IceModelVec2Int &result)
Set no_model_mask variable to have value 1 in strip of width 'strip' m around edge of computational d...
Definition: Geometry.cc:415
void ice_bottom_surface(const Geometry &geometry, IceModelVec2S &result)
Definition: Geometry.cc:223
double ice_area_grounded(const Geometry &geometry, double thickness_threshold)
Computes grounded ice area, in m^2.
Definition: Geometry.cc:350