PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
Delta_T.hh
Go to the documentation of this file.
1 // Copyright (C) 2011--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_T
20 #define PISM_ATMOSPHERE_DELTA_T
21 
22 #include "pism/coupler/AtmosphereModel.hh"
23 
24 namespace pism {
25 
26 class ScalarForcing;
27 
28 namespace atmosphere {
29 
30 class Delta_T : public AtmosphereModel {
31 public:
32  Delta_T(std::shared_ptr<const Grid> g, std::shared_ptr<AtmosphereModel> in);
33  virtual ~Delta_T() = 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& air_temperature_impl() const;
43 
44  void init_timeseries_impl(const std::vector<double> &ts) const;
45  void temp_time_series_impl(int i, int j, std::vector<double> &values) 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_temperature;
54 };
55 
56 } // end of namespace atmosphere
57 } // end of namespace pism
58 
59 #endif /* PISM_ATMOSPHERE_DELTA_T */
A purely virtual class defining the interface of a PISM Atmosphere Model.
const array::Scalar & air_temperature_impl() const
Definition: Delta_T.cc:141
std::shared_ptr< array::Scalar > m_temperature
Definition: Delta_T.hh:53
void temp_time_series_impl(int i, int j, std::vector< double > &values) const
Definition: Delta_T.cc:145
virtual ~Delta_T()=default
std::shared_ptr< ScalarForcing > m_1d_offsets
Definition: Delta_T.hh:49
void init_impl(const Geometry &geometry)
Definition: Delta_T.cc:72
void end_pointwise_access_impl() const
Definition: Delta_T.cc:108
void begin_pointwise_access_impl() const
Definition: Delta_T.cc:100
std::shared_ptr< array::Forcing > m_2d_offsets
Definition: Delta_T.hh:51
void update_impl(const Geometry &geometry, double t, double dt)
Definition: Delta_T.cc:116
std::vector< double > m_offset_values
Definition: Delta_T.hh:47
void init_timeseries_impl(const std::vector< double > &ts) const
Definition: Delta_T.cc:84
Delta_T(std::shared_ptr< const Grid > g, std::shared_ptr< AtmosphereModel > in)
Definition: Delta_T.cc:29
static const double g
Definition: exactTestP.cc:36