PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
Frac_P.hh
Go to the documentation of this file.
1 // Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020, 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_FRAC_P
20 #define PISM_ATMOSPHERE_FRAC_P
21 
22 #include "pism/coupler/AtmosphereModel.hh"
23 
24 namespace pism {
25 
26 class ScalarForcing;
27 
28 namespace atmosphere {
29 
30 class Frac_P : public AtmosphereModel {
31 public:
32  Frac_P(std::shared_ptr<const Grid> g, std::shared_ptr<AtmosphereModel> in);
33  virtual ~Frac_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 init_timeseries_impl(const std::vector<double> &ts) const;
40  void begin_pointwise_access_impl() const;
41  void end_pointwise_access_impl() const;
42 
43  const array::Scalar& precipitation_impl() const;
44 
45  void precip_time_series_impl(int i, int j, std::vector<double> &values) const;
46 
47  mutable std::vector<double> m_scaling_values;
48 
49  std::shared_ptr<ScalarForcing> m_1d_scaling;
50 
51  std::shared_ptr<array::Forcing> m_2d_scaling;
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_FRAC_P */
A purely virtual class defining the interface of a PISM Atmosphere Model.
Frac_P(std::shared_ptr< const Grid > g, std::shared_ptr< AtmosphereModel > in)
Definition: Frac_P.cc:30
std::shared_ptr< array::Forcing > m_2d_scaling
Definition: Frac_P.hh:51
void precip_time_series_impl(int i, int j, std::vector< double > &values) const
Definition: Frac_P.cc:142
void begin_pointwise_access_impl() const
Definition: Frac_P.cc:97
void update_impl(const Geometry &geometry, double t, double dt)
Definition: Frac_P.cc:113
std::shared_ptr< ScalarForcing > m_1d_scaling
Definition: Frac_P.hh:49
void init_impl(const Geometry &geometry)
Definition: Frac_P.cc:70
std::vector< double > m_scaling_values
Definition: Frac_P.hh:47
virtual ~Frac_P()=default
const array::Scalar & precipitation_impl() const
Definition: Frac_P.cc:138
void init_timeseries_impl(const std::vector< double > &ts) const
Definition: Frac_P.cc:81
void end_pointwise_access_impl() const
Definition: Frac_P.cc:105
std::shared_ptr< array::Scalar > m_precipitation
Definition: Frac_P.hh:53
static const double g
Definition: exactTestP.cc:36