Alpine3D

Alpine3D Svn Source Tree

Root/trunk/alpine3d/Glaciers.h

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
23/**
24 * @page glaciers Glaciers
25 * This module corrects the air temperature for the effect of the katabatic flows on the glaciated pixels.
26 * The flows are computed automatically for each glaciated pixel following (Quinn, 1991) (see below).
27 * Then the air temperature correction is computed according to (Greuell and Bohm, 1998) with the improvements
28 * by (Ayala, Pellicciotti and Shea, 2015) (see Glaciers::correctTemperatures).
29 * This model is enabled by setting to TRUE the GLACIER_KATABATIC_FLOW key in the [ALPINE3D] section.
30 *
31 * Then, two calibration parameters must be set:
32 * - KATABATIC_LAYER_HEIGHT which represents the katabatic layer height in meters. It was around 17m in the original paper and
33 * around 5m in (Ayala et al.);
34 * - KATABATIC_K_COEFFICIENT which takes into account the lateral energy fluxes on the glacier tongue in (Ayala et al.). This was
35 * around 7°C but can be set to 0 (default value) to use a pure (Greuell and Bohm, 1998) model.
36 * - KATABATIC_SCALING might also be provided. This factor reduces the katabatic flow reach. A value of .25 seems to work quite well
37 *
38 * @section multiple_flow
39 * The computation of the katabatic flows paths is based on the multiple flow direction algorithm and
40 * associates to each cell an upslope area that is based on the number of cells
41 * that flow into it. This follows <i>"The prediction of hillslope flow paths for distributed
42 * hydrological modelling using digital terrain models"</i>, Quinn P., Chevallier P., Planchon O.,
43 * hydrological processes, <b>5</b>, 1991, pp 59-79.
44 *
45 * @remarks This code is still experimental and awaits proper validation!!
46 */
47class Glaciers
48{
49public:
50Glaciers(const mio::Config& cfg);
51Glaciers(const mio::Config& cfg, const mio::DEMObject& in_dem);
52~Glaciers() {}
53
54void setDEM(const mio::DEMObject& in_dem);
55void setGlacierMap(const mio::Grid2DObject& glacierMask);
56const mio::Grid2DObject correctTemperatures(const mio::Grid2DObject& hs, const mio::Grid2DObject& tss, const mio::Grid2DObject& ta) const;
57void correctTemperatures(const mio::Grid2DObject& hs, const mio::Grid2DObject& tss, mio::Grid2DObject& ta) const;
58void correctTemperatures(mio::Grid2DObject& ta) const;
59
60void getGrids(mio::Grid2DObject &alt, mio::Grid2DObject &dist) const;
61
62private:
63void init(const mio::Config& cfg);
64static bool enableKatabatikFlows(const mio::Grid2DObject& hs, const mio::Grid2DObject& tss, const mio::Grid2DObject& ta, const mio::Grid2DObject& isGlacier);
65static 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);
66void hillslope_flow(mio::Grid2DObject glacier_mask);
67
68mio::DEMObject dem;
69mio::Grid2DObject isGlacier; ///< glacier pixels tagged with 1, non glacier tagged with 0 and out of domain tagged with nodata
70mio::Grid2DObject flowpath, src_altitude, src_distance;
71double KBL, K, scale;
72};
73
74#endif

Archive Download this file

Revision: HEAD