19 #include "pism/coupler/atmosphere/Delta_T.hh"
21 #include "pism/util/ConfigInterface.hh"
22 #include "pism/util/ScalarForcing.hh"
23 #include "pism/coupler/util/options.hh"
24 #include "pism/util/array/Forcing.hh"
27 namespace atmosphere {
29 Delta_T::Delta_T(std::shared_ptr<const Grid> grid, std::shared_ptr<AtmosphereModel> in)
33 prefix =
"atmosphere.delta_T",
34 variable_name =
"delta_T",
35 long_name =
"near-surface air temperature offsets",
37 external_units =
"Kelvin";
46 bool scalar = input.
dimensions(variable_name).size() == 1;
52 units, external_units,
55 unsigned int buffer_size =
m_config->get_number(
"input.forcing.buffer_size");
66 .output_units(external_units);
76 "* Initializing near-surface air temperature offsets...\n");
90 for (
unsigned int k = 0;
k < ts.size(); ++
k) {
133 for (
auto p =
m_grid->points(); p; p.next()) {
134 const int i = p.i(), j = p.j();
136 T(i, j) += delta(i, j);
156 for (
size_t k = 0;
k < result.size(); ++
k) {
std::shared_ptr< const Grid > grid() const
const Config::ConstPtr m_config
configuration database used by this component
const Logger::ConstPtr m_log
logger (for easy access)
const std::shared_ptr< const Grid > m_grid
grid used by this component
std::vector< std::string > dimensions(const std::string &variable_name) const
High-level PISM I/O class.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
virtual void init_timeseries_impl(const std::vector< double > &ts) const
static std::shared_ptr< array::Scalar > allocate_temperature(std::shared_ptr< const Grid > grid)
std::shared_ptr< AtmosphereModel > m_input_model
A purely virtual class defining the interface of a PISM Atmosphere Model.
const array::Scalar & air_temperature_impl() const
std::shared_ptr< array::Scalar > m_temperature
void temp_time_series_impl(int i, int j, std::vector< double > &values) const
std::shared_ptr< ScalarForcing > m_1d_offsets
void init_impl(const Geometry &geometry)
void end_pointwise_access_impl() const
void begin_pointwise_access_impl() const
std::shared_ptr< array::Forcing > m_2d_offsets
void update_impl(const Geometry &geometry, double t, double dt)
std::vector< double > m_offset_values
void init_timeseries_impl(const std::vector< double > &ts) const
Delta_T(std::shared_ptr< const Grid > g, std::shared_ptr< AtmosphereModel > in)
@ PISM_READONLY
open an existing file for reading only