PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
GivenTH.hh
Go to the documentation of this file.
1 // Copyright (C) 2011, 2012, 2014, 2015, 2016, 2017, 2018, 2021, 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 2 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 _POGIVENTH_H_
20 #define _POGIVENTH_H_
21 
22 #include "pism/coupler/ocean/CompleteOceanModel.hh"
23 
24 namespace pism {
25 namespace ocean {
27 {
28 public:
29  GivenTH(std::shared_ptr<const Grid> g);
30  virtual ~GivenTH() = default;
31 
32  class Constants {
33  public:
34  Constants(const Config &config);
35  //! Coefficients for linearized freezing point equation for in situ
36  //! temperature:
37  //!
38  //! Tb(salinity, thickness) = a[0] * salinity + a[1] + a[2] * thickness
39  double a[3];
40  //! Coefficients for linearized freezing point equation for potential
41  //! temperature
42  //!
43  //! Theta_b(salinity, thickness) = b[0] * salinity + b[1] + b[2] * thickness
44  double b[3];
45 
46  //! Turbulent heat transfer coefficient:
47  double gamma_T;
48  //! Turbulent salt transfer coefficient:
49  double gamma_S;
50 
55  double ice_density;
59  };
60 private:
61  void update_impl(const Geometry &geometry, double t, double dt);
62  void init_impl(const Geometry &geometry);
63  MaxTimestep max_timestep_impl(double t) const;
64 
65  std::shared_ptr<array::Forcing> m_theta_ocean;
66  std::shared_ptr<array::Forcing> m_salinity_ocean;
67 
68  void pointwise_update(const Constants &constants,
69  double sea_water_salinity,
70  double sea_water_potential_temperature,
71  double ice_thickness,
72  double *shelf_base_temperature_out,
73  double *shelf_base_melt_rate_out);
74 
75  void subshelf_salinity(const Constants &constants,
76  double sea_water_salinity,
77  double sea_water_potential_temperature,
78  double ice_thickness,
79  double *shelf_base_salinity);
80 
81  void subshelf_salinity_melt(const Constants &constants,
82  double sea_water_salinity,
83  double sea_water_potential_temperature,
84  double ice_thickness,
85  double *shelf_base_salinity);
86 
87  void subshelf_salinity_freeze_on(const Constants &constants,
88  double sea_water_salinity,
89  double sea_water_potential_temperature,
90  double ice_thickness,
91  double *shelf_base_salinity);
92 
93  void subshelf_salinity_diffusion_only(const Constants &constants,
94  double sea_water_salinity,
95  double sea_water_potential_temperature,
96  double ice_thickness,
97  double *shelf_base_salinity);
98 };
99 
100 } // end of namespace ocean
101 } // end of namespace pism
102 
103 #endif /* _POGIVENTH_H_ */
A class for storing and accessing PISM configuration flags and parameters.
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Definition: MaxTimestep.hh:31
Constants(const Config &config)
Definition: GivenTH.cc:33
double gamma_S
Turbulent salt transfer coefficient:
Definition: GivenTH.hh:49
double gamma_T
Turbulent heat transfer coefficient:
Definition: GivenTH.hh:47
GivenTH(std::shared_ptr< const Grid > g)
Definition: GivenTH.cc:60
virtual ~GivenTH()=default
void subshelf_salinity_diffusion_only(const Constants &constants, double sea_water_salinity, double sea_water_potential_temperature, double ice_thickness, double *shelf_base_salinity)
Compute basal salinity in the case of no basal melt and no freeze-on, with the diffusion-only tempera...
Definition: GivenTH.cc:487
void subshelf_salinity_melt(const Constants &constants, double sea_water_salinity, double sea_water_potential_temperature, double ice_thickness, double *shelf_base_salinity)
Definition: GivenTH.cc:370
std::shared_ptr< array::Forcing > m_salinity_ocean
Definition: GivenTH.hh:66
std::shared_ptr< array::Forcing > m_theta_ocean
Definition: GivenTH.hh:65
void subshelf_salinity_freeze_on(const Constants &constants, double sea_water_salinity, double sea_water_potential_temperature, double ice_thickness, double *shelf_base_salinity)
Definition: GivenTH.cc:427
MaxTimestep max_timestep_impl(double t) const
Definition: GivenTH.cc:189
void pointwise_update(const Constants &constants, double sea_water_salinity, double sea_water_potential_temperature, double ice_thickness, double *shelf_base_temperature_out, double *shelf_base_melt_rate_out)
Compute temperature and melt rate at the base of the shelf. Based on [HellmerOlbers1989] and [Holland...
Definition: GivenTH.cc:231
void subshelf_salinity(const Constants &constants, double sea_water_salinity, double sea_water_potential_temperature, double ice_thickness, double *shelf_base_salinity)
Compute the basal salinity and make sure that it is consistent with the basal melt rate.
Definition: GivenTH.cc:290
void update_impl(const Geometry &geometry, double t, double dt)
Definition: GivenTH.cc:139
void init_impl(const Geometry &geometry)
Definition: GivenTH.cc:96
bool ocean(int M)
An ocean cell (floating ice or ice-free).
Definition: Mask.hh:40
static const double g
Definition: exactTestP.cc:36