20 #include "pism/coupler/atmosphere/WeatherStation.hh"
21 #include "pism/util/ConfigInterface.hh"
22 #include "pism/util/Grid.hh"
23 #include "pism/util/error_handling.hh"
24 #include "pism/util/MaxTimestep.hh"
25 #include "pism/util/ScalarForcing.hh"
28 namespace atmosphere {
34 "* Using the constant-in-space atmosphere model\n"
35 " for use with scalar data from one weather station\n"
36 " combined with lapse rate corrections...\n");
38 auto filename =
m_config->get_string(
"atmosphere.one_station.file");
40 if (filename.empty()) {
42 "atmosphere.one_station.file cannot be empty");
46 " - Reading air temperature and precipitation from '%s'...\n",
49 auto &ctx = *
grid->ctx();
51 bool periodic =
false;
58 "ice-equivalent precipitation rate",
66 "near-surface air temperature",
107 size_t N = ts.size();
112 for (
unsigned int k = 0;
k < N; ++
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)
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
static std::shared_ptr< array::Scalar > allocate_temperature(std::shared_ptr< const Grid > grid)
static std::shared_ptr< array::Scalar > allocate_precipitation(std::shared_ptr< const Grid > grid)
A purely virtual class defining the interface of a PISM Atmosphere Model.
std::shared_ptr< ScalarForcing > m_precipitation_timeseries
std::shared_ptr< array::Scalar > m_temperature
void temp_time_series_impl(int i, int j, std::vector< double > &values) const
void update_impl(const Geometry &geometry, double t, double dt)
WeatherStation(std::shared_ptr< const Grid > g)
void init_impl(const Geometry &geometry)
std::vector< double > m_air_temp_values
void init_timeseries_impl(const std::vector< double > &ts) const
void begin_pointwise_access_impl() const
void end_pointwise_access_impl() const
const array::Scalar & air_temperature_impl() const
const array::Scalar & precipitation_impl() const
MaxTimestep max_timestep_impl(double t) const
std::shared_ptr< ScalarForcing > m_air_temp_timeseries
std::vector< double > m_precip_values
std::shared_ptr< array::Scalar > m_precipitation
void precip_time_series_impl(int i, int j, std::vector< double > &values) const
#define PISM_ERROR_LOCATION