PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
IBSurfaceModel.cc
Go to the documentation of this file.
1// Copyright (C) 2008-2016, 2023, 2024, 2025 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#include "pism/util/MaxTimestep.hh"
20#include "pism/util/io/File.hh"
21#include "pism/icebin/IBSurfaceModel.hh"
22#include "pism/util/Logger.hh"
23
24namespace pism {
25namespace icebin {
26
27IBSurfaceModel::IBSurfaceModel(std::shared_ptr<const pism::Grid> grid)
28 : SurfaceModel(grid),
29 massxfer(grid, "massxfer"),
30 enthxfer(grid, "enthxfer"),
31 deltah(grid, "deltah"),
32 ice_top_bc_temp(grid, "ice_top_bc_temp"),
33 ice_top_bc_wc(grid, "ice_top_bc_wc") {
34
36 .long_name("Mass of ice being transferred Stieglitz --> Icebin")
37 .units("kg m^-2 s^-1")
38 .standard_name("land_ice_surface_specific_mass_balance");
39
41 .long_name("Enthalpy of ice being transferred Stieglitz --> Icebin")
42 .units("W m^-2");
43
44 // ------- Used only for mass/energy budget
46 .long_name(
47 "enthalpy of constant-in-time ice-equivalent surface mass balance (accumulation/ablation) rate")
48 .units("W m^-2");
49
50 // ------- Dirichlet Bondary condition derived from deltah
51 ice_top_bc_temp.metadata(0).long_name("Temperature of the Dirichlet B.C.").units("kelvin");
52 ice_top_bc_wc.metadata(0).long_name("Water content of the Dirichlet B.C.").units("1");
53}
54
55void IBSurfaceModel::init_impl(const Geometry &geometry) {
56 (void)geometry;
57
58 m_log->message(2, "* Initializing the IceBin interface surface model IBSurfaceModel.\n"
59 " IceBin changes its state when surface conditions change.\n");
60
61 for (auto *v : {&massxfer, &enthxfer, &deltah, &ice_top_bc_temp, &ice_top_bc_wc}) {
62 v->set(0.0);
63 }
64}
65
67 (void)t;
68 return {};
69}
70
71void IBSurfaceModel::update_impl(const Geometry &geometry, double t, double dt) {
72 (void)geometry;
73 (void)t;
74 (void)dt;
75
76 // compute naive estimates of accumulation, melt, and runoff
80}
81
85
89
93
97
99 return *m_melt;
100}
101
103 return *m_runoff;
104}
105
106std::set<VariableMetadata> IBSurfaceModel::state_impl() const {
108}
109
111 for (const auto *v : { &massxfer, &enthxfer, &deltah, &ice_top_bc_temp, &ice_top_bc_wc }) {
112 v->write(output);
113 }
114}
115
116} // namespace icebin
117} // namespace pism
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...
VariableMetadata & long_name(const std::string &input)
VariableMetadata & units(const std::string &input)
VariableMetadata & standard_name(const std::string &input)
void write(const OutputFile &file) const
Definition Array.cc:859
VariableMetadata & metadata(unsigned int N=0)
Returns a reference to the VariableMetadata object containing metadata for the compoment N.
Definition Array.cc:467
pism::array::Scalar enthxfer
MaxTimestep max_timestep_impl(double t) const
const array::Scalar & liquid_water_fraction_impl() const
pism::array::Scalar massxfer
pism::array::Scalar ice_top_bc_wc
const array::Scalar & melt_impl() const
const array::Scalar & accumulation_impl() const
const array::Scalar & mass_flux_impl() const
void update_impl(const Geometry &geometry, double my_t, double my_dt)
std::set< VariableMetadata > state_impl() const
void init_impl(const Geometry &geometry)
pism::array::Scalar ice_top_bc_temp
void write_state_impl(const OutputFile &output) const
The default (empty implementation).
const array::Scalar & runoff_impl() const
const array::Scalar & temperature_impl() const
IBSurfaceModel(std::shared_ptr< const pism::Grid > grid)
void dummy_accumulation(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_melt
std::shared_ptr< array::Scalar > m_runoff
void dummy_melt(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_accumulation
void dummy_runoff(const array::Scalar &smb, array::Scalar &result)
std::set< VariableMetadata > metadata(std::initializer_list< const Array * > vecs)
Definition Array.cc:1244