PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
Delta_SL.cc
Go to the documentation of this file.
1// Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2021, 2023, 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/coupler/ocean/sea_level/Delta_SL.hh"
20#include "pism/util/ScalarForcing.hh"
21#include "pism/util/Logger.hh"
22
23namespace pism {
24namespace ocean {
25namespace sea_level {
26
27Delta_SL::Delta_SL(std::shared_ptr<const Grid> grid, std::shared_ptr<SeaLevel> in)
28 : SeaLevel(grid, in) {
29
30 m_forcing.reset(new ScalarForcing(*grid->ctx(),
31 "ocean.delta_sl", "delta_SL",
32 "m", "m",
33 "sea level elevation offsets"));
34}
35
37 // empty
38}
39
40void Delta_SL::init_impl(const Geometry &geometry) {
41
42 m_input_model->init(geometry);
43
44 m_log->message(2, "* Initializing scalar sea level forcing...\n");
45}
46
47void Delta_SL::update_impl(const Geometry &geometry, double t, double dt) {
48 m_input_model->update(geometry, t, dt);
49
51 m_sea_level.shift(m_forcing->value(t + 0.5 * dt));
52}
53
54} // end of namespace sea_level
55} // end of namespace ocean
56} // end of namespace pism
std::shared_ptr< const Grid > grid() const
Definition Component.cc:107
std::shared_ptr< const Logger > m_log
logger (for easy access)
Definition Component.hh:164
void copy_from(const Array2D< T > &source)
Definition Array2D.hh:101
void shift(double alpha)
Result: v[j] <- v[j] + alpha for all j. Calls VecShift.
Definition Array.cc:219
Delta_SL(std::shared_ptr< const Grid > grid, std::shared_ptr< SeaLevel > in)
Definition Delta_SL.cc:27
void update_impl(const Geometry &geometry, double t, double dt)
Definition Delta_SL.cc:47
std::unique_ptr< ScalarForcing > m_forcing
Definition Delta_SL.hh:40
void init_impl(const Geometry &geometry)
Definition Delta_SL.cc:40
std::shared_ptr< SeaLevel > m_input_model
Definition SeaLevel.hh:61
void init(const Geometry &geometry)
Definition SeaLevel.cc:48
bool ocean(int M)
An ocean cell (floating ice or ice-free).
Definition Mask.hh:40