#include <SnowpackInterface.h>
Public Member Functions | |
SnowpackInterface (const mio::Config &io_cfg, const size_t &nbworkers, const mio::DEMObject &dem_in, const mio::Grid2DObject &landuse_in, const std::vector< mio::Coords > &vec_pts, const mio::Date &startTime, const std::string &grids_requirements, const bool is_restart_in) | |
Constructs and initialise Snowpack Interface Master. He creates the Worker and Distributes the Data from the other modules to the Worker. Is the acces interface A3D side. More... | |
SnowpackInterface (const SnowpackInterface &) | |
~SnowpackInterface () | |
Destructor of SnowpackInterface Master. Handels special cases with POP-C++ and also free correctly workers. More... | |
SnowpackInterface & | operator= (const SnowpackInterface &) |
Assignment operator, required because of pointer member. More... | |
double | getTiming () const |
get time who was used to exchange Data with Workers and run on each Pixel the Snowpack Model throught workers. More... | |
void | writeOutput (const mio::Date &julian) |
Internal method to allow the master (in case of parallel execution) or the normal thread (non-parallel execution) to write gridded outputs. More... | |
void | writeOutputSNO (const mio::Date &julian) |
commands worker to write .sno files. Is triggered by Alpine Control More... | |
void | setSnowDrift (SnowDriftA3D &drift) |
Set reference to SnowDrift module, to comunicate with it. More... | |
void | setEnergyBalance (EnergyBalance &myeb) |
Set reference to EnergyBalance module, to comunicate with it. More... | |
void | setDataAssimilation (DataAssimilation &init_da) |
Set reference to DataAssimilation module, to comunicate with it. More... | |
void | setSnowDrift () |
Send required fields to SnowDrift module. More... | |
void | setEnergyBalance () |
Send required fields to EnergyBalance module. More... | |
void | assimilate (const mio::Grid2DObject &daData, const mio::Date ×tamp) |
Interface that DataAssimilation can push the data to the SnowpackInterface This is currently never used... More... | |
void | setSnowMassChange (const mio::Grid2DObject &new_mns, const mio::Date ×tamp) |
Interface that SnowDrift can push the data to the SnowpackInterface. More... | |
void | setMeteo (const mio::Grid2DObject &new_psum, const mio::Grid2DObject &new_psum_ph, const mio::Grid2DObject &new_vw, const mio::Grid2DObject &new_dw, const mio::Grid2DObject &new_rh, const mio::Grid2DObject &new_ta, const mio::Date ×tamp) |
get Meteo changes from AlpineControl or SnowDrift module More... | |
void | setRadiationComponents (const mio::Array2D< double > &shortw, const mio::Array2D< double > &longwave, const mio::Array2D< double > &diff, const mio::Array2D< double > &terrain_shortwave_in, const mio::Array2D< double > &terrain_longwave_in, const double &solarElevation, const mio::Date ×tamp) |
get values from Energy Balance More... | |
mio::Grid2DObject | getGrid (const SnGrids::Parameters ¶m) const |
Request specific grid by parameter type. More... | |
void | calcNextStep () |
Get data from other modules and run one simulation step. Once the simulation step has been performed, the data are pushed to ther other modules. More... | |
SnowpackInterface::SnowpackInterface | ( | const mio::Config & | io_cfg, |
const size_t & | nbworkers, | ||
const mio::DEMObject & | dem_in, | ||
const mio::Grid2DObject & | landuse_in, | ||
const std::vector< mio::Coords > & | vec_pts, | ||
const mio::Date & | startTime, | ||
const std::string & | grids_requirements, | ||
const bool | is_restart_in | ||
) |
Constructs and initialise Snowpack Interface Master. He creates the Worker and Distributes the Data from the other modules to the Worker. Is the acces interface A3D side.
io_cfg | is used to create IOManager, which is used to write the standart output |
nbworkers | gives the new values for the wind speed |
dem_in | gives the demographic Data. Also tetermines size and position of the geographical modeling scope |
landuse_in | gives the landuse Data. Also tetermines size and position of the landuse for modeling scope |
vec_pts | gives the spezial points. For this points more output is done then for the others. Calcualtion is the same. |
startTime | is the time and date the first simulation step is done |
grids_requirements | list of grids that must be prepared for other modules (similar to the Output::GRIDS_PARAMETERS configuration key) |
is_restart_in | is used to know which files the worker needs to read to init the pixel |
SnowpackInterface::SnowpackInterface | ( | const SnowpackInterface & | ) |
SnowpackInterface::~SnowpackInterface | ( | ) |
Destructor of SnowpackInterface Master. Handels special cases with POP-C++ and also free correctly workers.
void SnowpackInterface::assimilate | ( | const mio::Grid2DObject & | daData, |
const mio::Date & | timestamp | ||
) |
Interface that DataAssimilation can push the data to the SnowpackInterface This is currently never used...
daData | are the data from the DataAssimilation module |
timestamp | for controlle if data from DataAssimilation are form the correct simulation step |
void SnowpackInterface::calcNextStep | ( | ) |
Get data from other modules and run one simulation step. Once the simulation step has been performed, the data are pushed to ther other modules.
mio::Grid2DObject SnowpackInterface::getGrid | ( | const SnGrids::Parameters & | param | ) | const |
Request specific grid by parameter type.
param | parameter |
double SnowpackInterface::getTiming | ( | ) | const |
get time who was used to exchange Data with Workers and run on each Pixel the Snowpack Model throught workers.
SnowpackInterface & SnowpackInterface::operator= | ( | const SnowpackInterface & | source | ) |
Assignment operator, required because of pointer member.
void SnowpackInterface::setDataAssimilation | ( | DataAssimilation & | init_da | ) |
Set reference to DataAssimilation module, to comunicate with it.
init_da | is the reference to the DataAssimilation module |
void SnowpackInterface::setEnergyBalance | ( | ) |
Send required fields to EnergyBalance module.
void SnowpackInterface::setEnergyBalance | ( | EnergyBalance & | myeb | ) |
Set reference to EnergyBalance module, to comunicate with it.
myeb | is the reference to the EnergyBalance module |
void SnowpackInterface::setMeteo | ( | const mio::Grid2DObject & | new_psum, |
const mio::Grid2DObject & | new_psum_ph, | ||
const mio::Grid2DObject & | new_vw, | ||
const mio::Grid2DObject & | new_dw, | ||
const mio::Grid2DObject & | new_rh, | ||
const mio::Grid2DObject & | new_ta, | ||
const mio::Date & | timestamp | ||
) |
get Meteo changes from AlpineControl or SnowDrift module
new_psum | gives the new values for new Water High |
new_psum_ph | gives the new values for the precipitation phase |
new_vw | gives the new values for the wind speed |
new_dw | gives the new values for the wind direction |
new_rh | gives the new values for the realtiv Humidity |
new_ta | gives the new values for the Aire temperature |
timestamp | is the time of the calculation step from which this new values are comming |
void SnowpackInterface::setRadiationComponents | ( | const mio::Array2D< double > & | shortwave_in, |
const mio::Array2D< double > & | longwave_in, | ||
const mio::Array2D< double > & | diff_in, | ||
const mio::Array2D< double > & | terrain_shortwave_in, | ||
const mio::Array2D< double > & | terrain_longwave_in, | ||
const double & | solarElevation_in, | ||
const mio::Date & | timestamp | ||
) |
get values from Energy Balance
[in] | shortwave_in | is the 2D double Array map of ISWR [W m-2] |
[in] | longwave_in | is the 2D double Array map of ILWR [W m-2] |
[in] | diff_in | is the 2D double Array map of Diffuse radiation from the sky [W m-2] |
[in] | terrain_shortwave_in | 2D double Array map of ISWR reflected by the surrounding terrain [W m-2] |
[in] | terrain_longwave_in2D | double Array map of ILWR emitted by the surrounding terrain [W m-2] |
[in] | solarElevation_in | double of Solar elevation to be used for Canopy (in dec) |
[in] | timestamp | is the time of the calculation step from which this new values are comming |
void SnowpackInterface::setSnowDrift | ( | ) |
Send required fields to SnowDrift module.
void SnowpackInterface::setSnowDrift | ( | SnowDriftA3D & | mydrift | ) |
Set reference to SnowDrift module, to comunicate with it.
mydrift | is the reference to the SnowDrift module |
void SnowpackInterface::setSnowMassChange | ( | const mio::Grid2DObject & | new_mns, |
const mio::Date & | timestamp | ||
) |
Interface that SnowDrift can push the data to the SnowpackInterface.
new_mns | are the data about the new Snow masses from the DataAssimilation module |
timestamp | for controlle if data from DataAssimilation are form the correct simulation step |
void SnowpackInterface::writeOutput | ( | const mio::Date & | date | ) |
Internal method to allow the master (in case of parallel execution) or the normal thread (non-parallel execution) to write gridded outputs.
In order to generate ARC ASCI files compatible with the legacy Alpine3D grids viewer, set A3D_VIEW to TRUE in the [Output] section!
date | is the date for which the output is done |
void SnowpackInterface::writeOutputSNO | ( | const mio::Date & | date | ) |
commands worker to write .sno files. Is triggered by Alpine Control
Hack --> Find better software architecture to do this then SnowpackInterface also does output for other modules of A3D here..
date | is the date witch the output is done |