25#include "pism/coupler/atmosphere/SeariseGreenland.hh"
26#include "pism/geometry/Geometry.hh"
27#include "pism/util/Config.hh"
28#include "pism/util/Grid.hh"
29#include "pism/util/MaxTimestep.hh"
30#include "pism/util/error_handling.hh"
31#include "pism/util/Logger.hh"
49 "* Initializing SeaRISE-Greenland atmosphere model based on the Fausto et al (2009)\n"
50 " air temperature parameterization and using stored time-independent precipitation...\n");
53 "R. S. Fausto, A. P. Ahlstrom, D. V. As, C. E. Boggild, and S. J. Johnsen, 2009. "
54 "A new present-day temperature parameterization for Greenland. J. Glaciol. 55 (189), 95-105.";
56 auto precip_file =
m_config->get_string(
"atmosphere.searise_greenland.file");
58 if (not precip_file.empty()) {
60 " * Reading precipitation from '%s'...\n",
91 d_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.d_ma"),
92 gamma_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.gamma_ma"),
93 c_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.c_ma"),
94 kappa_ma =
m_config->get_number(
"atmosphere.fausto_air_temp.kappa_ma"),
95 d_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.d_mj"),
96 gamma_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.gamma_mj"),
97 c_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.c_mj"),
98 kappa_mj =
m_config->get_number(
"atmosphere.fausto_air_temp.kappa_mj");
107 if (lat_degN.metadata().has_attribute(
"missing_at_bootstrap")) {
109 "SeaRISE-Greenland atmosphere model depends on latitude and would return nonsense!");
112 if (lon_degE.metadata().has_attribute(
"missing_at_bootstrap")) {
114 "SeaRISE-Greenland atmosphere model depends on longitude and would return nonsense!");
119 for (
auto p :
m_grid->points()) {
120 const int i = p.i(), j = p.j();
121 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));
122 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));
std::shared_ptr< const Config > m_config
configuration database used by this component
const std::shared_ptr< const Grid > m_grid
grid used by this component
std::shared_ptr< const Logger > m_log
logger (for easy access)
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