20 #include "pism/coupler/ocean/ConstantPIK.hh"
21 #include "pism/util/ConfigInterface.hh"
22 #include "pism/util/Grid.hh"
23 #include "pism/util/MaxTimestep.hh"
24 #include "pism/geometry/Geometry.hh"
38 "* Initializing the constant (PIK) ocean model...\n");
41 ice_density =
m_config->get_number(
"constants.ice.density"),
42 water_density =
m_config->get_number(
"constants.sea_water.density"),
43 g =
m_config->get_number(
"constants.standard_gravity");
67 ice_density =
m_config->get_number(
"constants.ice.density"),
68 water_density =
m_config->get_number(
"constants.sea_water.density"),
69 g =
m_config->get_number(
"constants.standard_gravity");
81 T0 =
m_config->get_number(
"constants.fresh_water.melting_point_temperature"),
82 beta_CC =
m_config->get_number(
"constants.ice.beta_Clausius_Clapeyron"),
83 g =
m_config->get_number(
"constants.standard_gravity"),
84 ice_density =
m_config->get_number(
"constants.ice.density");
88 for (
auto p =
m_grid->points(); p; p.next()) {
89 const int i = p.i(), j = p.j();
90 const double pressure = ice_density *
g * depth(i,j);
92 result(i,j) = T0 -
beta_CC * pressure;
102 melt_factor =
m_config->get_number(
"ocean.pik_melt_factor"),
103 L =
m_config->get_number(
"constants.fresh_water.latent_heat_of_fusion"),
104 sea_water_density =
m_config->get_number(
"constants.sea_water.density"),
105 ice_density =
m_config->get_number(
"constants.ice.density"),
108 ocean_salinity = 35.0,
115 for (
auto p =
m_grid->points(); p; p.next()) {
116 const int i = p.i(), j = p.j();
124 shelfbaseelev = - (ice_density / sea_water_density) * ice_thickness(i,j),
125 T_f = 273.15 + (0.0939 -0.057 * ocean_salinity + 7.64e-4 * shelfbaseelev);
130 double ocean_heat_flux = melt_factor * sea_water_density * c_p_ocean * gamma_T * (T_ocean - T_f);
136 result(i,j) = ocean_heat_flux / (
L * ice_density);
139 result(i,j) *= ice_density;
const units::System::Ptr m_sys
unit system used by this component
const Config::ConstPtr m_config
configuration database used by this component
const Logger::ConstPtr m_log
logger (for easy access)
const std::shared_ptr< const Grid > m_grid
grid used by this component
array::Scalar2 ice_thickness
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.
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
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 Geometry &geometry, double my_t, double my_dt)
static const double beta_CC
bool ocean(int M)
An ocean cell (floating ice or ice-free).
void compute_average_water_column_pressure(const Geometry &geometry, double ice_density, double water_density, double g, 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.