Alpine3D 20240513.cd14b8b
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
70{
71 public:
72 EnergyBalance( const unsigned int& i_nbworkers, const mio::Config& cfg, const mio::DEMObject &dem_in);
75
77
78 void setSnowPack(SnowpackInterface &mysnowpack );
79 void setAlbedo( const mio::Grid2DObject &in_albedo );
80
81 void compute(const mio::Grid2DObject& in_ilwr,
82 const mio::Grid2DObject& in_ta, const mio::Grid2DObject& in_rh, const mio::Grid2DObject& in_p,
83 const mio::Grid2DObject& in_iswr_dir, const mio::Grid2DObject& in_iswr_diff,
84 const mio::Date timestamp);
85
86 void writeSP(const unsigned int max_steps); //write Solar Panels information
87
88 bool hasSP(){return terrain_radiation->hasSP();} //are Solar Panels defined?
89 void setStations(const std::vector<mio::MeteoData>& in_vecMeteo);
90 double getTiming() const;
91 void Destroy();
92 std::string getGridsRequirements() const;
93
94 private:
95 SnowpackInterface *snowpack;
96 TerrainRadiationAlgorithm *terrain_radiation;
97 std::vector<RadiationField> radfields;
98 mio::DEMObject dem;
99 std::vector<mio::MeteoData> vecMeteo;
100 mio::Grid2DObject albedo;
101 mio::Array2D<double> direct_unshaded_horizontal, direct, diffuse, reflected; //FELIX: direct_unshaded_horizontal
102 mio::Timer timer;
103 const mio::Config& cfg;
104 size_t dimx, dimy;
105 unsigned int nbworkers;
106 bool dataFromGrids;
107};
108
109#endif
Definition: EnergyBalance.h:70
void setSnowPack(SnowpackInterface &mysnowpack)
Definition: EnergyBalance.cc:109
EnergyBalance(const EnergyBalance &)
bool hasSP()
Definition: EnergyBalance.h:88
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