PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
Delta_P.hh
Go to the documentation of this file.
1 // Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2021, 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 #ifndef PISM_ATMOSPHERE_DELTA_P
20 #define PISM_ATMOSPHERE_DELTA_P
21 
22 #include "pism/coupler/AtmosphereModel.hh"
23 
24 namespace pism {
25 
26 class ScalarForcing;
27 
28 namespace atmosphere {
29 
30 class Delta_P : public AtmosphereModel {
31 public:
32  Delta_P(std::shared_ptr<const Grid> g, std::shared_ptr<AtmosphereModel> in);
33  virtual ~Delta_P() = default;
34 
35 private:
36  void init_impl(const Geometry &geometry);
37  void update_impl(const Geometry &geometry, double t, double dt);
38 
39  void begin_pointwise_access_impl() const;
40  void end_pointwise_access_impl() const;
41 
42  const array::Scalar& precipitation_impl() const;
43 
44  void init_timeseries_impl(const std::vector<double> &ts) const;
45  void precip_time_series_impl(int i, int j, std::vector<double> &result) const;
46 
47  mutable std::vector<double> m_offset_values;
48 
49  std::shared_ptr<ScalarForcing> m_1d_offsets;
50 
51  std::shared_ptr<array::Forcing> m_2d_offsets;
52 
53  std::shared_ptr<array::Scalar> m_precipitation;
54 };
55 
56 } // end of namespace atmosphere
57 } // end of namespace pism
58 
59 #endif /* PISM_ATMOSPHERE_DELTA_P */
A purely virtual class defining the interface of a PISM Atmosphere Model.
void precip_time_series_impl(int i, int j, std::vector< double > &result) const
Definition: Delta_P.cc:147
void init_timeseries_impl(const std::vector< double > &ts) const
Definition: Delta_P.cc:86
const array::Scalar & precipitation_impl() const
Definition: Delta_P.cc:143
void end_pointwise_access_impl() const
Definition: Delta_P.cc:110
void init_impl(const Geometry &geometry)
Definition: Delta_P.cc:73
void begin_pointwise_access_impl() const
Definition: Delta_P.cc:102
std::shared_ptr< ScalarForcing > m_1d_offsets
Definition: Delta_P.hh:49
std::vector< double > m_offset_values
Definition: Delta_P.hh:47
virtual ~Delta_P()=default
std::shared_ptr< array::Forcing > m_2d_offsets
Definition: Delta_P.hh:51
void update_impl(const Geometry &geometry, double t, double dt)
Definition: Delta_P.cc:118
Delta_P(std::shared_ptr< const Grid > g, std::shared_ptr< AtmosphereModel > in)
Definition: Delta_P.cc:29
std::shared_ptr< array::Scalar > m_precipitation
Definition: Delta_P.hh:53
static const double g
Definition: exactTestP.cc:36