PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
ConstantPIK.cc
Go to the documentation of this file.
1// Copyright (C) 2008-2019, 2021, 2022, 2023, 2024, 2025 Ed Bueler, Constantine Khroulev, Ricarda Winkelmann,
2// Gudfinna Adalgeirsdottir, Andy Aschwanden and Torsten Albrecht
3//
4// This file is part of PISM.
5//
6// PISM is free software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the Free Software
8// Foundation; either version 3 of the License, or (at your option) any later
9// version.
10//
11// PISM is distributed in the hope that it will be useful, but WITHOUT ANY
12// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14// details.
15//
16// You should have received a copy of the GNU General Public License
17// along with PISM; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
20#include "pism/coupler/ocean/ConstantPIK.hh"
21#include "pism/util/Config.hh"
22#include "pism/util/Grid.hh"
23#include "pism/util/MaxTimestep.hh"
24#include "pism/geometry/Geometry.hh"
25#include "pism/util/Logger.hh"
26
27namespace pism {
28namespace ocean {
29
30PIK::PIK(std::shared_ptr<const Grid> g)
32 // empty
33}
34
35void PIK::init_impl(const Geometry &geometry) {
36 (void) geometry;
37
38 m_log->message(2,
39 "* Initializing the constant (PIK) ocean model...\n");
40
41 double
42 ice_density = m_config->get_number("constants.ice.density"),
43 water_density = m_config->get_number("constants.sea_water.density"),
44 g = m_config->get_number("constants.standard_gravity");
45
46 compute_average_water_column_pressure(geometry, ice_density, water_density, g,
48}
49
51 (void) t;
52 return MaxTimestep("ocean PIK");
53}
54
55void PIK::update_impl(const Inputs &inputs, double t, double dt) {
56 (void) t;
57 (void) dt;
58 const auto &geometry = *inputs.geometry;
59
60 const array::Scalar &H = geometry.ice_thickness;
61
62 // Set shelf base temperature to the melting temperature at the base (depth within the
63 // ice equal to ice thickness).
65
67
68 double
69 ice_density = m_config->get_number("constants.ice.density"),
70 water_density = m_config->get_number("constants.sea_water.density"),
71 g = m_config->get_number("constants.standard_gravity");
72
73 compute_average_water_column_pressure(geometry, ice_density, water_density, g,
75}
76
77/*!
78 * Compute melting temperature at a given depth within the ice.
79 */
81 array::Scalar &result) const {
82 const double
83 T0 = m_config->get_number("constants.fresh_water.melting_point_temperature"), // K
84 beta_CC = m_config->get_number("constants.ice.beta_Clausius_Clapeyron"),
85 g = m_config->get_number("constants.standard_gravity"),
86 ice_density = m_config->get_number("constants.ice.density");
87
88 array::AccessScope list{&depth, &result};
89
90 for (auto p : m_grid->points()) {
91 const int i = p.i(), j = p.j();
92 const double pressure = ice_density * g * depth(i,j); // FIXME task #7297
93 // result is set to melting point at depth
94 result(i,j) = T0 - beta_CC * pressure;
95 }
96}
97
98//! \brief Computes mass flux in [kg m-2 s-1].
99/*!
100 * Assumes that mass flux is proportional to the shelf-base heat flux.
101 */
102void PIK::mass_flux(const array::Scalar &ice_thickness, array::Scalar &result) const {
103 const double
104 melt_factor = m_config->get_number("ocean.pik_melt_factor"),
105 L = m_config->get_number("constants.fresh_water.latent_heat_of_fusion"),
106 sea_water_density = m_config->get_number("constants.sea_water.density"),
107 ice_density = m_config->get_number("constants.ice.density"),
108 c_p_ocean = 3974.0, // J/(K*kg), specific heat capacity of ocean mixed layer
109 gamma_T = 1e-4, // m/s, thermal exchange velocity
110 ocean_salinity = 35.0, // g/kg
111 T_ocean = units::convert(m_sys, -1.7, "degree_Celsius", "kelvin"); //Default in PISM-PIK
112
113 //FIXME: gamma_T should be a function of the friction velocity, not a const
114
115 array::AccessScope list{&ice_thickness, &result};
116
117 for (auto p : m_grid->points()) {
118 const int i = p.i(), j = p.j();
119
120 // compute T_f(i, j) according to beckmann_goosse03, which has the
121 // meaning of the freezing temperature of the ocean water directly
122 // under the shelf, (of salinity 35psu) [this is related to the
123 // Pressure Melting Temperature, see beckmann_goosse03 eq. 2 for
124 // details]
125 double
126 shelfbaseelev = - (ice_density / sea_water_density) * ice_thickness(i,j),
127 T_f = 273.15 + (0.0939 -0.057 * ocean_salinity + 7.64e-4 * shelfbaseelev);
128 // add 273.15 to convert from Celsius to kelvin
129
130 // compute ocean_heat_flux according to beckmann_goosse03
131 // positive, if T_oc > T_ice ==> heat flux FROM ocean TO ice
132 double ocean_heat_flux = melt_factor * sea_water_density * c_p_ocean * gamma_T * (T_ocean - T_f); // in W/m^2
133
134 // TODO: T_ocean -> field!
135
136 // shelfbmassflux is positive if ice is freezing on; here it is always negative:
137 // same sign as ocean_heat_flux (positive if massflux FROM ice TO ocean)
138 result(i,j) = ocean_heat_flux / (L * ice_density); // m s-1
139
140 // convert from [m s-1] to [kg m-2 s-1]:
141 result(i,j) *= ice_density;
142 }
143}
144
145} // end of namespace ocean
146} // end of namespace pism
const units::System::Ptr m_sys
unit system used by this component
Definition Component.hh:162
std::shared_ptr< const Config > m_config
configuration database used by this component
Definition Component.hh:160
const std::shared_ptr< const Grid > m_grid
grid used by this component
Definition Component.hh:158
std::shared_ptr< const Logger > m_log
logger (for easy access)
Definition Component.hh:164
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
Definition Array.hh:66
std::shared_ptr< array::Scalar > m_shelf_base_mass_flux
std::shared_ptr< array::Scalar > m_shelf_base_temperature
std::shared_ptr< array::Scalar > m_water_column_pressure
Definition OceanModel.hh:78
MaxTimestep max_timestep_impl(double t) const
void melting_point_temperature(const array::Scalar &depth, array::Scalar &result) const
PIK(std::shared_ptr< const Grid > g)
void init_impl(const Geometry &geometry)
void mass_flux(const array::Scalar &ice_thickness, array::Scalar &result) const
Computes mass flux in [kg m-2 s-1].
void update_impl(const Inputs &inputs, double my_t, double my_dt)
static const double L
Definition exactTestL.cc:40
static const double beta_CC
Definition exactTestO.c:23
bool ocean(int M)
An ocean cell (floating ice or ice-free).
Definition Mask.hh:40
void compute_average_water_column_pressure(const Geometry &geometry, double ice_density, double water_density, double standard_gravity, array::Scalar &result)
double convert(System::Ptr system, double input, const std::string &spec1, const std::string &spec2)
Convert a quantity from unit1 to unit2.
Definition Units.cc:70
static const double g
Definition exactTestP.cc:36
const Geometry * geometry
Definition OceanModel.hh:34