19 #include "pism/coupler/atmosphere/CosineYearlyCycle.hh"
20 #include "pism/util/Time.hh"
21 #include "pism/util/pism_options.hh"
22 #include "pism/util/ConfigInterface.hh"
23 #include "pism/util/Grid.hh"
24 #include "pism/util/io/File.hh"
26 #include "pism/util/error_handling.hh"
27 #include "pism/util/MaxTimestep.hh"
29 #include "pism/util/ScalarForcing.hh"
32 namespace atmosphere {
37 auto scaling_file =
m_config->get_string(
"atmosphere.yearly_cycle.scaling.file");
39 if (not scaling_file.empty()) {
41 "atmosphere.yearly_cycle.scaling",
44 "temperature amplitude scaling"));
52 "* Initializing the 'cosine yearly cycle' atmosphere model...\n");
54 auto input_file =
m_config->get_string(
"atmosphere.yearly_cycle.file");
56 if (input_file.empty()) {
58 "Please specify an '-atmosphere yearly_cycle' input file\n"
59 "using atmosphere.yearly_cycle.file or a command-line option.");
63 " Reading mean annual air temperature, mean July air temperature, and\n"
64 " precipitation fields from '%s'...\n", input_file.c_str());
73 return MaxTimestep(
"atmosphere cosine_yearly_cycle");
88 for (
unsigned int k = 0;
k < ts.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)
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