PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
SeariseGreenland.cc
Go to the documentation of this file.
1// Copyright (C) 2008-2018, 2022, 2023, 2025 Ed Bueler, Constantine Khroulev, Ricarda Winkelmann,
2// Gudfinna Adalgeirsdottir and Andy Aschwanden
3//
4// This file is part of PISM.
5//
6// PISM is free software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the Free Software
8// Foundation; either version 3 of the License, or (at your option) any later
9// version.
10//
11// PISM is distributed in the hope that it will be useful, but WITHOUT ANY
12// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14// details.
15//
16// You should have received a copy of the GNU General Public License
17// along with PISM; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
20// Implementation of the atmosphere model using constant-in-time precipitation
21// and a cosine yearly cycle for near-surface air temperatures.
22
23// This includes the SeaRISE Greenland parameterization.
24
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"
32
33namespace pism {
34namespace atmosphere {
35
36///// SeaRISEGreenland
37
38SeaRISEGreenland::SeaRISEGreenland(std::shared_ptr<const Grid> g)
39 : YearlyCycle(g) {
40 // empty
41}
42
45
47
48 m_log->message(2,
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");
51
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.";
55
56 auto precip_file = m_config->get_string("atmosphere.searise_greenland.file");
57
58 if (not precip_file.empty()) {
59 m_log->message(2,
60 " * Reading precipitation from '%s'...\n",
61 precip_file.c_str());
62
64 true, /* do regrid */
65 0 /* start (irrelevant) */);
66 } else {
67 YearlyCycle::init_impl(geometry);
68 }
69}
70
71void SeaRISEGreenland::precip_time_series_impl(int i, int j, std::vector<double> &result) const {
72
73 for (unsigned int k = 0; k < m_ts_times.size(); k++) {
74 result[k] = m_precipitation(i,j);
75 }
76}
77
79 (void) t;
80 return MaxTimestep("atmosphere searise_greenland");
81}
82
83//! \brief Updates mean annual and mean summer (July) near-surface air temperatures.
84//! Note that the precipitation rate is time-independent and does not need
85//! to be updated.
86void SeaRISEGreenland::update_impl(const Geometry &geometry, double t, double dt) {
87 (void) t;
88 (void) dt;
89
90 const double
91 d_ma = m_config->get_number("atmosphere.fausto_air_temp.d_ma"), // K
92 gamma_ma = m_config->get_number("atmosphere.fausto_air_temp.gamma_ma"), // K m-1
93 c_ma = m_config->get_number("atmosphere.fausto_air_temp.c_ma"), // K (degN)-1
94 kappa_ma = m_config->get_number("atmosphere.fausto_air_temp.kappa_ma"), // K (degW)-1
95 d_mj = m_config->get_number("atmosphere.fausto_air_temp.d_mj"), // SAME UNITS as for _ma ...
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");
99
100
101 // initialize pointers to fields the parameterization depends on:
102 const array::Scalar
103 &h = geometry.ice_surface_elevation,
104 &lat_degN = geometry.latitude,
105 &lon_degE = geometry.longitude;
106
107 if (lat_degN.metadata().has_attribute("missing_at_bootstrap")) {
108 throw RuntimeError(PISM_ERROR_LOCATION, "latitude variable was missing at bootstrap;\n"
109 "SeaRISE-Greenland atmosphere model depends on latitude and would return nonsense!");
110 }
111
112 if (lon_degE.metadata().has_attribute("missing_at_bootstrap")) {
113 throw RuntimeError(PISM_ERROR_LOCATION, "longitude variable was missing at bootstrap;\n"
114 "SeaRISE-Greenland atmosphere model depends on longitude and would return nonsense!");
115 }
116
117 array::AccessScope list{&h, &lat_degN, &lon_degE, &m_air_temp_mean_annual, &m_air_temp_mean_summer};
118
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));
123 }
124}
125
126} // end of namespace atmosphere
127} // end of namespace pism
std::shared_ptr< const Config > m_config
configuration database used by this component
Definition Component.hh:160
const std::shared_ptr< const Grid > m_grid
grid used by this component
Definition Component.hh:158
std::shared_ptr< const Logger > m_log
logger (for easy access)
Definition Component.hh:164
array::Scalar2 ice_surface_elevation
Definition Geometry.hh:57
array::Scalar longitude
Definition Geometry.hh:42
array::Scalar latitude
Definition Geometry.hh:41
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.
Definition Array.hh:66
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
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.
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
static const double g
Definition exactTestP.cc:36
static const double k
Definition exactTestP.cc:42