Alpine3D 20241222.625fd38
Glaciers.h
Go to the documentation of this file.
1/***********************************************************************************/
2/* Copyright 2009-2015 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3/***********************************************************************************/
4/* This file is part of Alpine3D.
5 Alpine3D is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Alpine3D is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with Alpine3D. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef GLACIERS_H
19#define GLACIERS_H
20
21#include <meteoio/MeteoIO.h>
22
48{
49 public:
50 Glaciers(const mio::Config& cfg);
51 Glaciers(const mio::Config& cfg, const mio::DEMObject& in_dem);
53
54 void setDEM(const mio::DEMObject& in_dem);
55 void setGlacierMap(const mio::Grid2DObject& glacierMask);
56 const mio::Grid2DObject correctTemperatures(const mio::Grid2DObject& hs, const mio::Grid2DObject& tss, const mio::Grid2DObject& ta) const;
57 void correctTemperatures(const mio::Grid2DObject& hs, const mio::Grid2DObject& tss, mio::Grid2DObject& ta) const;
58 void correctTemperatures(mio::Grid2DObject& ta) const;
59
60 void getGrids(mio::Grid2DObject &alt, mio::Grid2DObject &dist) const;
61
62 private:
63 void init(const mio::Config& cfg);
64 static bool enableKatabatikFlows(const mio::Grid2DObject& hs, const mio::Grid2DObject& tss, const mio::Grid2DObject& ta, const mio::Grid2DObject& isGlacier);
65 static bool hillslope_distribute_cell(const mio::Grid2DObject& dem, const mio::Grid2DObject& mask, const double& A, const size_t ii, const size_t jj, mio::Grid2DObject &flow, mio::Grid2DObject &src_altitude, mio::Grid2DObject &src_distance);
66 void hillslope_flow(mio::Grid2DObject glacier_mask);
67
68 mio::DEMObject dem;
69 mio::Grid2DObject isGlacier;
70 mio::Grid2DObject flowpath, src_altitude, src_distance;
71 double KBL, K, scale;
72};
73
74#endif
Definition: Glaciers.h:48
Glaciers(const mio::Config &cfg)
Definition: Glaciers.cc:24
void setGlacierMap(const mio::Grid2DObject &glacierMask)
Set the mask of where the glaciers are.
Definition: Glaciers.cc:63
void setDEM(const mio::DEMObject &in_dem)
Definition: Glaciers.cc:46
void getGrids(mio::Grid2DObject &alt, mio::Grid2DObject &dist) const
Definition: Glaciers.cc:82
~Glaciers()
Definition: Glaciers.h:52
const mio::Grid2DObject correctTemperatures(const mio::Grid2DObject &hs, const mio::Grid2DObject &tss, const mio::Grid2DObject &ta) const
Definition: Glaciers.cc:127