tPico.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
HTML git clone git://src.adamsgaard.dk/pism
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tPico.hh (5472B)
---
1 // Copyright (C) 2012-2016, 2018 Ricarda Winkelmann, Ronja Reese, Torsten Albrecht
2 // and Matthias Mengel
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 2 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 #ifndef _POPICO_H_
21 #define _POPICO_H_
22
23 #include "CompleteOceanModel.hh"
24
25 #include "pism/util/IceModelVec2CellType.hh"
26 #include "pism/util/iceModelVec2T.hh"
27
28 namespace pism {
29 namespace ocean {
30
31 class PicoGeometry;
32 class PicoPhysics;
33
34 //! Implements the PICO ocean model as submitted to The Cryosphere (March 2017).
35 //!
36 //! Generalizes the two dimensional ocean box model of [@ref OlbersHellmer2010] for
37 //! use in PISM, i.e. three dimensions.
38 //!
39 class Pico : public CompleteOceanModel {
40 public:
41 Pico(IceGrid::ConstPtr g);
42 virtual ~Pico();
43
44 protected:
45 void init_impl(const Geometry &geometry);
46 void update_impl(const Geometry &geometry, double t, double dt);
47 MaxTimestep max_timestep_impl(double t) const;
48
49 void define_model_state_impl(const File &output) const;
50 void write_model_state_impl(const File &output) const;
51
52 std::map<std::string, Diagnostic::Ptr> diagnostics_impl() const;
53
54 private:
55 IceModelVec2S m_Soc, m_Soc_box0;
56 IceModelVec2S m_Toc, m_Toc_box0, m_T_star;
57 IceModelVec2S m_overturning;
58 IceModelVec2S m_basal_melt_rate;
59
60 IceModelVec2Int m_basin_mask;
61
62 std::unique_ptr<PicoGeometry> m_geometry;
63
64 IceModelVec2T::Ptr m_theta_ocean, m_salinity_ocean;
65
66 void compute_ocean_input_per_basin(const PicoPhysics &physics,
67 const IceModelVec2Int &basin_mask,
68 const IceModelVec2Int &continental_shelf_mask,
69 const IceModelVec2S &salinity_ocean,
70 const IceModelVec2S &theta_ocean,
71 std::vector<double> &temperature,
72 std::vector<double> &salinity);
73
74 void set_ocean_input_fields(const PicoPhysics &physics,
75 const IceModelVec2S &ice_thickness,
76 const IceModelVec2CellType &mask,
77 const IceModelVec2Int &basin_mask,
78 const IceModelVec2Int &shelf_mask,
79 const std::vector<double> basin_temperature,
80 const std::vector<double> basin_salinity,
81 IceModelVec2S &Toc_box0,
82 IceModelVec2S &Soc_box0);
83
84 void process_box1(const PicoPhysics &physics,
85 const IceModelVec2S &ice_thickness,
86 const IceModelVec2Int &shelf_mask,
87 const IceModelVec2Int &box_mask,
88 const IceModelVec2S &Toc_box0,
89 const IceModelVec2S &Soc_box0,
90 IceModelVec2S &basal_melt_rate,
91 IceModelVec2S &basal_temperature,
92 IceModelVec2S &T_star,
93 IceModelVec2S &Toc,
94 IceModelVec2S &Soc,
95 IceModelVec2S &overturning);
96
97 void process_other_boxes(const PicoPhysics &cc,
98 const IceModelVec2S &ice_thickness,
99 const IceModelVec2Int &shelf_mask,
100 const IceModelVec2Int &box_mask,
101 IceModelVec2S &basal_melt_rate,
102 IceModelVec2S &basal_temperature,
103 IceModelVec2S &T_star,
104 IceModelVec2S &Toc,
105 IceModelVec2S &Soc);
106 void extend_basal_melt_rates(const IceModelVec2CellType &mask,
107 IceModelVec2S &basal_melt_rate);
108
109 void beckmann_goosse(const PicoPhysics &physics,
110 const IceModelVec2S &ice_thickness,
111 const IceModelVec2Int &shelf_mask,
112 const IceModelVec2CellType &cell_type,
113 const IceModelVec2S &Toc_box0,
114 const IceModelVec2S &Soc_box0,
115 IceModelVec2S &basal_melt_rate,
116 IceModelVec2S &T_pressure_melting,
117 IceModelVec2S &Toc,
118 IceModelVec2S &Soc);
119
120 void compute_box_average(int box_id,
121 const IceModelVec2S &field,
122 const IceModelVec2Int &shelf_mask,
123 const IceModelVec2Int &box_mask,
124 std::vector<double> &result);
125
126 void compute_box_area(int box_id,
127 const IceModelVec2Int &shelf_mask,
128 const IceModelVec2Int &box_mask,
129 std::vector<double> &result);
130
131
132 int m_n_basins, m_n_boxes, m_n_shelves;
133 };
134
135 } // end of namespace ocean
136 } // end of namespace pism
137
138 #endif /* _POPICO_H_ */