19#include "pism/coupler/atmosphere/CosineYearlyCycle.hh"
20#include "pism/util/Config.hh"
21#include "pism/util/Grid.hh"
23#include "pism/util/error_handling.hh"
24#include "pism/util/MaxTimestep.hh"
26#include "pism/util/ScalarForcing.hh"
27#include "pism/util/Logger.hh"
28#include "pism/util/io/IO_Flags.hh"
36 auto scaling_file =
m_config->get_string(
"atmosphere.yearly_cycle.scaling.file");
38 if (not scaling_file.empty()) {
40 "atmosphere.yearly_cycle.scaling",
43 "temperature amplitude scaling"));
51 "* Initializing the 'cosine yearly cycle' atmosphere model...\n");
53 auto input_file =
m_config->get_string(
"atmosphere.yearly_cycle.file");
55 if (input_file.empty()) {
57 "Please specify an '-atmosphere yearly_cycle' input file\n"
58 "using atmosphere.yearly_cycle.file or a command-line option.");
62 " Reading mean annual air temperature, mean July air temperature, and\n"
63 " precipitation fields from '%s'...\n", input_file.c_str());
72 return MaxTimestep(
"atmosphere cosine_yearly_cycle");
87 for (
unsigned int k = 0;
k < ts.size(); ++
k) {
std::shared_ptr< const Grid > grid() const
std::shared_ptr< const Config > m_config
configuration database used by this component
std::shared_ptr< const Logger > m_log
logger (for easy access)
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
void regrid(const std::string &filename, io::Default default_value)
std::shared_ptr< ScalarForcing > m_A
virtual void init_impl(const Geometry &geometry)
Reads in the precipitation data from the input file.
virtual MaxTimestep max_timestep_impl(double t) const
virtual void init_timeseries_impl(const std::vector< double > &ts) const
CosineYearlyCycle(std::shared_ptr< const Grid > g)
virtual void update_impl(const Geometry &geometry, double t, double dt)
array::Scalar m_air_temp_mean_summer
array::Scalar m_precipitation
std::vector< double > m_cosine_cycle
virtual void init_timeseries_impl(const std::vector< double > &ts) const
array::Scalar m_air_temp_mean_annual
#define PISM_ERROR_LOCATION