PISM, A Parallel Ice Sheet Model  stable v2.0.5 committed by Constantine Khrulev on 2022-10-14 09:56:26 -0800
Simple.cc
Go to the documentation of this file.
1 // Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 PISM Authors
2 //
3 // This file is part of PISM.
4 //
5 // PISM is free software; you can redistribute it and/or modify it under the
6 // terms of the GNU General Public License as published by the Free Software
7 // Foundation; either version 3 of the License, or (at your option) any later
8 // version.
9 //
10 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with PISM; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 
20 #include "Simple.hh"
21 
22 #include "pism/coupler/AtmosphereModel.hh"
23 
24 namespace pism {
25 namespace surface {
26 
27 Simple::Simple(IceGrid::ConstPtr g, std::shared_ptr<atmosphere::AtmosphereModel> atmosphere)
28  : SurfaceModel(g, atmosphere) {
29 
32 }
33 
34 void Simple::init_impl(const Geometry &geometry) {
35 
36  m_atmosphere->init(geometry);
37 
38  m_log->message(2,
39  "* Initializing the simplest PISM surface (snow) processes model Simple.\n"
40  " It passes atmospheric state directly to upper ice fluid surface:\n"
41  " surface mass balance := precipitation,\n"
42  " ice upper surface temperature := 2m air temperature.\n");
43 }
44 
45 void Simple::update_impl(const Geometry &geometry, double t, double dt) {
46  if (m_atmosphere) {
47  m_atmosphere->update(geometry, t, dt);
48  }
49 
50  m_mass_flux->copy_from(m_atmosphere->mean_precipitation());
51  m_temperature->copy_from(m_atmosphere->mean_annual_temp());
52 
56 }
57 
59  return *m_mass_flux;
60 }
61 
63  return *m_temperature;
64 }
65 
67  return *m_accumulation;
68 }
69 
71  return *m_melt;
72 }
73 
75  return *m_runoff;
76 }
77 
78 } // end of namespace surface
79 } // end of namespace pism
const Logger::ConstPtr m_log
logger (for easy access)
Definition: Component.hh:142
std::shared_ptr< const IceGrid > ConstPtr
Definition: IceGrid.hh:233
const IceModelVec2S & runoff_impl() const
Definition: Simple.cc:74
IceModelVec2S::Ptr m_mass_flux
Definition: Simple.hh:54
const IceModelVec2S & accumulation_impl() const
Definition: Simple.cc:66
const IceModelVec2S & temperature_impl() const
Definition: Simple.cc:62
const IceModelVec2S & mass_flux_impl() const
Definition: Simple.cc:58
IceModelVec2S::Ptr m_temperature
Definition: Simple.hh:55
virtual void update_impl(const Geometry &geometry, double t, double dt)
Definition: Simple.cc:45
Simple(IceGrid::ConstPtr g, std::shared_ptr< atmosphere::AtmosphereModel > atmosphere)
Definition: Simple.cc:27
const IceModelVec2S & melt_impl() const
Definition: Simple.cc:70
virtual void init_impl(const Geometry &geometry)
Definition: Simple.cc:34
static IceModelVec2S::Ptr allocate_mass_flux(IceGrid::ConstPtr grid)
Definition: SurfaceModel.cc:76
std::shared_ptr< atmosphere::AtmosphereModel > m_atmosphere
IceModelVec2S::Ptr m_melt
IceModelVec2S::Ptr m_accumulation
static IceModelVec2S::Ptr allocate_temperature(IceGrid::ConstPtr grid)
Definition: SurfaceModel.cc:93
void dummy_accumulation(const IceModelVec2S &smb, IceModelVec2S &result)
IceModelVec2S::Ptr m_runoff
void dummy_runoff(const IceModelVec2S &smb, IceModelVec2S &result)
void dummy_melt(const IceModelVec2S &smb, IceModelVec2S &result)
The interface of PISM's surface models.
Definition: SurfaceModel.hh:45
static const double g
Definition: exactTestP.cc:39