25 #include "pism/coupler/atmosphere/SeariseGreenland.hh"
26 #include "pism/geometry/Geometry.hh"
27 #include "pism/util/ConfigInterface.hh"
28 #include "pism/util/Grid.hh"
29 #include "pism/util/MaxTimestep.hh"
30 #include "pism/util/error_handling.hh"
33 namespace atmosphere {
48 "* Initializing SeaRISE-Greenland atmosphere model based on the Fausto et al (2009)\n"
49 " air temperature parameterization and using stored time-independent precipitation...\n");
52 "R. S. Fausto, A. P. Ahlstrom, D. V. As, C. E. Boggild, and S. J. Johnsen, 2009. "
53 "A new present-day temperature parameterization for Greenland. J. Glaciol. 55 (189), 95-105.";
55 auto precip_file =
m_config->get_string(
"atmosphere.searise_greenland.file");
57 if (not precip_file.empty()) {
59 " * Reading precipitation from '%s'...\n",
90 d_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.d_ma"),
91 gamma_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.gamma_ma"),
92 c_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.c_ma"),
93 kappa_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.kappa_ma"),
94 d_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.d_mj"),
95 gamma_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.gamma_mj"),
96 c_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.c_mj"),
97 kappa_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.kappa_mj");
106 if (lat_degN.metadata().has_attribute(
"missing_at_bootstrap")) {
108 "SeaRISE-Greenland atmosphere model depends on latitude and would return nonsense!");
111 if (lon_degE.metadata().has_attribute(
"missing_at_bootstrap")) {
113 "SeaRISE-Greenland atmosphere model depends on longitude and would return nonsense!");
118 for (
auto p =
m_grid->points(); p; p.next()) {
119 const int i = p.i(), j = p.j();
120 m_air_temp_mean_annual(i,j) = d_ma + gamma_ma * h(i,j) + c_ma * lat_degN(i,j) + kappa_ma * (-lon_degE(i,j));
121 m_air_temp_mean_summer(i,j) = d_mj + gamma_mj * h(i,j) + c_mj * lat_degN(i,j) + kappa_mj * (-lon_degE(i,j));
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
array::Scalar2 ice_surface_elevation
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
std::vector< double > m_ts_times
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 precip_time_series_impl(int i, int j, std::vector< double > &values) const
virtual ~SeaRISEGreenland()
SeaRISEGreenland(std::shared_ptr< const Grid > g)
virtual void update_impl(const Geometry &geometry, double t, double dt)
Updates mean annual and mean summer (July) near-surface air temperatures. Note that the precipitation...
array::Scalar m_air_temp_mean_summer
void init_internal(const std::string &input_filename, bool regrid, unsigned int start)
Read precipitation data from a given file.
array::Scalar m_precipitation
virtual void init_impl(const Geometry &geometry)
Reads in the precipitation data from the input file.
array::Scalar m_air_temp_mean_annual
#define PISM_ERROR_LOCATION