PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
iceCompModel.hh
Go to the documentation of this file.
1 // Copyright (C) 2004-2017, 2023 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 __iceCompModel_hh
20 #define __iceCompModel_hh
21 
22 #include "pism/icemodel/IceModel.hh"
23 
24 namespace pism {
25 
26 class IceCompModel : public IceModel {
27 
28 public:
29  IceCompModel(std::shared_ptr<Grid> g, std::shared_ptr<Context> ctx, int mytest);
30  virtual ~IceCompModel() {}
31 
32  // re-defined steps of init() sequence:
33  virtual void allocate_storage();
34  virtual void allocate_bedrock_thermal_unit();
35  virtual void allocate_bed_deformation();
36  virtual void allocate_couplers();
37  virtual void allocate_energy_model();
38 
39  // NB! not virtual
40  void bootstrap_2d(const File &input_file) __attribute__((noreturn));
41 
42  virtual void initialize_2d();
43 
44  void reportErrors();
45 
46 protected:
47  // related to all (or most) tests
49 
50  virtual void post_step_hook();
51  // all tests except K
52  void computeGeometryErrors(double &gvolexact, double &gareaexact, double &gdomeHexact,
53  double &volerr, double &areaerr,
54  double &gmaxHerr, double &gavHerr, double &gmaxetaerr,
55  double &centerHerr);
56  virtual void print_summary(bool tempAndAge);
57 
58  // related to tests A B C D H
59  void initTestABCDH();
60 
62 
63  // related to test L
65  void initTestL();
66 
67  // related to tests F G; see iCMthermo.cc
68  virtual void energy_step();
69  void initTestFG();
70  void getCompSourcesTestFG();
71 
72  // tests F and G
73  void computeTemperatureErrors(double &gmaxTerr, double &gavTerr);
74  // tests F and G
75  void computeBasalTemperatureErrors(double &gmaxTerr, double &gavTerr, double &centerTerr);
76  // tests F and G
77  void compute_strain_heating_errors(double &gmax_strain_heating_err, double &gav_strain_heating_err);
78 
79  // tests F and G
80  void computeSurfaceVelocityErrors(double &gmaxUerr, double &gavUerr, // 2D vector errors
81  double &gmaxWerr, double &gavWerr); // scalar errors
82 
84 
85  // related to tests K and O; see iCMthermo.cc
86  void initTestsKO();
87 
88  // tests K and O only
89  void computeIceBedrockTemperatureErrors(double &gmaxTerr, double &gavTerr,
90  double &gmaxTberr, double &gavTberr);
91  // test O only
92  void computeBasalMeltRateErrors(double &gmaxbmelterr, double &gminbmelterr);
93 
94  // using Van der Veen's exact solution to test CFBC and the part-grid code
95  void test_V_init();
96 
97 private:
98  double m_f; // ratio of ice density to bedrock density
100 
101  // see iCMthermo.cc
102  static const double m_ST; // K m^-1; surface temperature gradient: T_s = ST * r + Tmin
103  static const double m_Tmin; // K; minimum temperature (at center)
104  static const double m_LforFG; // m; exact radius of tests F&G ice sheet
105  static const double m_ApforG; // m; magnitude A_p of annular perturbation for test G;
106  // period t_p is set internally to 2000 years
107 };
108 
109 } // end of namespace pism
110 
111 #endif /* __iceCompModel_hh */
High-level PISM I/O class.
Definition: File.hh:56
virtual void allocate_bed_deformation()
void compute_strain_heating_errors(double &gmax_strain_heating_err, double &gav_strain_heating_err)
Definition: iCMthermo.cc:381
virtual void post_step_hook()
Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step.
void reset_thickness_test_A()
Tests A and E have a thickness B.C. (ice_thickness == 0 outside a circle of radius 750km).
void bootstrap_2d(const File &input_file) __attribute__((noreturn))
virtual void allocate_couplers()
virtual ~IceCompModel()
Definition: iceCompModel.hh:30
virtual void allocate_bedrock_thermal_unit()
Decide which bedrock thermal unit to use.
array::Array3D m_strain_heating3_comp
Definition: iceCompModel.hh:83
void test_V_init()
Initialize test V.
virtual void initialize_2d()
void computeSurfaceVelocityErrors(double &gmaxUerr, double &gavUerr, double &gmaxWerr, double &gavWerr)
Definition: iCMthermo.cc:438
void getCompSourcesTestFG()
Definition: iCMthermo.cc:154
array::Scalar m_HexactL
Definition: iceCompModel.hh:64
static const double m_ST
static const double m_Tmin
virtual void allocate_energy_model()
void computeIceBedrockTemperatureErrors(double &gmaxTerr, double &gavTerr, double &gmaxTberr, double &gavTberr)
Definition: iCMthermo.cc:236
virtual void allocate_storage()
Allocate all Arrays defined in IceModel.
void computeTemperatureErrors(double &gmaxTerr, double &gavTerr)
Definition: iCMthermo.cc:185
void computeGeometryErrors(double &gvolexact, double &gareaexact, double &gdomeHexact, double &volerr, double &areaerr, double &gmaxHerr, double &gavHerr, double &gmaxetaerr, double &centerHerr)
static const double m_LforFG
virtual void print_summary(bool tempAndAge)
IceCompModel(std::shared_ptr< Grid > g, std::shared_ptr< Context > ctx, int mytest)
Definition: iceCompModel.cc:60
void computeBasalMeltRateErrors(double &gmaxbmelterr, double &gminbmelterr)
Definition: iCMthermo.cc:504
virtual void energy_step()
Manage the solution of the energy equation, and related parallel communication.
Definition: iCMthermo.cc:47
static const double m_ApforG
void computeBasalTemperatureErrors(double &gmaxTerr, double &gavTerr, double &centerTerr)
Definition: iCMthermo.cc:319
std::shared_ptr< Context > ctx() const
Return the context this model is running in.
Definition: utilities.cc:127
A virtual class collecting methods common to ice and bedrock 3D fields.
Definition: Array3D.hh:33
static const double g
Definition: exactTestP.cc:36
#define __attribute__(x)