Alpine3D 20241222.625fd38
EnergyBalance.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 ENERGYBALANCE_H
19#define ENERGYBALANCE_H
20
21#include <string>
22#include <meteoio/MeteoIO.h>
23
25
30
69{
70 public:
71 EnergyBalance( const unsigned int& i_nbworkers, const mio::Config& cfg, const mio::DEMObject &dem_in);
74
76
77 void setSnowPack(SnowpackInterface &mysnowpack );
78 void setAlbedo( const mio::Grid2DObject &in_albedo );
79
80 void compute(const mio::Grid2DObject& in_ilwr,
81 const mio::Grid2DObject& in_ta, const mio::Grid2DObject& in_rh, const mio::Grid2DObject& in_p,
82 const mio::Grid2DObject& in_iswr_dir, const mio::Grid2DObject& in_iswr_diff,
83 const mio::Date timestamp);
84
85 void writeSP(const unsigned int max_steps); //write Solar Panels information
86
87 bool hasSP(){return terrain_radiation->hasSP();} //are Solar Panels defined?
88 void setStations(const std::vector<mio::MeteoData>& in_vecMeteo);
89 double getTiming() const;
90 void Destroy();
91 std::string getGridsRequirements() const;
92
93 private:
94 SnowpackInterface *snowpack;
95 TerrainRadiationAlgorithm *terrain_radiation;
96 std::vector<RadiationField> radfields;
97 mio::DEMObject dem;
98 std::vector<mio::MeteoData> vecMeteo;
99 mio::Grid2DObject albedo;
100 mio::Array2D<double> direct_unshaded_horizontal, direct, diffuse, reflected; //FELIX: direct_unshaded_horizontal
101 mio::Timer timer;
102 const mio::Config& cfg;
103 size_t dimx, dimy;
104 unsigned int nbworkers;
105 bool dataFromGrids;
106};
107
108#endif
Definition: EnergyBalance.h:69
void setSnowPack(SnowpackInterface &mysnowpack)
Definition: EnergyBalance.cc:109
EnergyBalance(const EnergyBalance &)
bool hasSP()
Definition: EnergyBalance.h:87
void compute(const mio::Grid2DObject &in_ilwr, const mio::Grid2DObject &in_ta, const mio::Grid2DObject &in_rh, const mio::Grid2DObject &in_p, const mio::Grid2DObject &in_iswr_dir, const mio::Grid2DObject &in_iswr_diff, const mio::Date timestamp)
Definition: EnergyBalance.cc:130
void Destroy()
Definition: EnergyBalance.cc:101
~EnergyBalance()
Definition: EnergyBalance.cc:72
EnergyBalance & operator=(const EnergyBalance &)
Assignement operator, required because of pointer member.
Definition: EnergyBalance.cc:76
double getTiming() const
Definition: EnergyBalance.cc:221
std::string getGridsRequirements() const
Definition: EnergyBalance.cc:96
void setAlbedo(const mio::Grid2DObject &in_albedo)
Definition: EnergyBalance.cc:114
EnergyBalance(const unsigned int &i_nbworkers, const mio::Config &cfg, const mio::DEMObject &dem_in)
Definition: EnergyBalance.cc:25
void writeSP(const unsigned int max_steps)
Definition: EnergyBalance.cc:215
void setStations(const std::vector< mio::MeteoData > &in_vecMeteo)
Definition: EnergyBalance.cc:124
Definition: SnowpackInterface.h:126
Definition: TerrainRadiationAlgorithm.h:37
bool hasSP()
Definition: TerrainRadiationAlgorithm.h:41