PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
PrescribedRetreat.hh
Go to the documentation of this file.
1 /* Copyright (C) 2019, 2022, 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 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 
20 #ifndef PRESCRIBED_RETREAT_H
21 #define PRESCRIBED_RETREAT_H
22 
23 #include "pism/util/Component.hh"
24 #include "pism/util/MaxTimestep.hh"
25 
26 namespace pism {
27 
28 /*! Implementation of the ISMIP6 parameterized retreat.
29  *
30  * Reads a space-and-time-dependent ice extent mask from a file. This mask contains values
31  * from 0 to 1. Zero corresponds to "ice-free", one to "ice covered", values in between
32  * correspond to cells that are partially covered.
33  *
34  * Each time update() is called, this module gets the mask corresponding to the provided
35  * model time. Then, for each grid cell, if the mask is zero, ice is removed (updating ice
36  * thickness and area specific volume). If the mask is between 0 and 1, remove the
37  * corresponding fraction of ice volume in this cell. If the mask is 1 ice thickness is
38  * not modified.
39  */
40 class PrescribedRetreat : public Component {
41 public:
42  PrescribedRetreat(std::shared_ptr<const Grid> grid);
43  virtual ~PrescribedRetreat() = default;
44 
45  void init();
46 
47  void update(double t, double dt,
48  array::Scalar &ice_thickness,
49  array::Scalar &ice_area_specific_volume);
50 
51 protected:
52  MaxTimestep max_timestep_impl(double t) const;
53 
54  std::shared_ptr<array::Forcing> m_retreat_mask;
55 };
56 
57 } // end of namespace pism
58 
59 #endif /* PRESCRIBED_RETREAT_H */
std::shared_ptr< const Grid > grid() const
Definition: Component.cc:105
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:118
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Definition: MaxTimestep.hh:31
std::shared_ptr< array::Forcing > m_retreat_mask
PrescribedRetreat(std::shared_ptr< const Grid > grid)
void update(double t, double dt, array::Scalar &ice_thickness, array::Scalar &ice_area_specific_volume)
MaxTimestep max_timestep_impl(double t) const
virtual ~PrescribedRetreat()=default