#include <SnowpackInterfaceWorker.h>
|
| SnowpackInterfaceWorker (const mio::Config &io_cfg, const mio::DEMObject &dem_in, const mio::Grid2DObject &landuse_in, const std::vector< std::pair< size_t, size_t > > &pts_in, const std::vector< SnowStation * > &snow_stations, const size_t offset_in) |
| Constructs and initialise Snowpack Interface Worker. Create one worker and init values for slice which the worker need to simulate it slice. More...
|
|
| ~SnowpackInterfaceWorker () |
|
void | setUseDrift (const bool useDrift_in) |
|
void | setUseEBalance (const bool useEBalance_in) |
|
void | getOutputSNO (std::vector< SnowStation * > &snow_station) const |
| method that returns SnowCover files for specific date. More...
|
|
void | getOutputSpecialPoints (std::vector< SnowStation * > &ptr_snow_pixel, std::vector< CurrentMeteo * > &ptr_meteo_pixel, std::vector< SurfaceFluxes * > &ptr_surface_flux) |
|
void | clearSpecialPointsData () |
|
void | getGrid (const SnGrids::Parameters ¶m, mio::Grid2DObject &o_grid2D) const |
| Method that the Master can search the neded data (in grids) from Worker (Pull from client) More...
|
|
double & | getGridPoint (const SnGrids::Parameters ¶m, const size_t &ii, const size_t &jj) |
| Retrieve one point (ii,jj) from the specified grid. More...
|
|
void | runModel (const mio::Date &julian, const mio::Grid2DObject &psum, const mio::Grid2DObject &psum_ph, const mio::Grid2DObject &rh, const mio::Grid2DObject &ta, const mio::Grid2DObject &vw, const mio::Grid2DObject &mns, const mio::Grid2DObject &shortwave, const mio::Grid2DObject &diffuse, const mio::Grid2DObject &longwave, const double solarElevation) |
| method which prepares all data for simulation and then access correctly the Snowpack model interfaces. More...
|
|
|
static int | round_landuse (const double &landuse_dbl) |
| optimised way to round landuse More...
|
|
static bool | skipThisCell (const double &landuse_val, const double &dem_val) |
| check if a cell should be simulated or skipped More...
|
|
static bool | is_special (const std::vector< std::pair< size_t, size_t > > &pts_in, const size_t &ix, const size_t &iy) |
|
SnowpackInterfaceWorker::SnowpackInterfaceWorker |
( |
const mio::Config & |
io_cfg, |
|
|
const mio::DEMObject & |
dem_in, |
|
|
const mio::Grid2DObject & |
landuse_in, |
|
|
const std::vector< std::pair< size_t, size_t > > & |
pts_in, |
|
|
const std::vector< SnowStation * > & |
snow_stations, |
|
|
const size_t |
offset_in |
|
) |
| |
Constructs and initialise Snowpack Interface Worker. Create one worker and init values for slice which the worker need to simulate it slice.
- Parameters
-
io_cfg | configuration to pass to Snowpack |
dem_in | gives the demographic Data. Also tetermines size and position of the slice |
landuse_in | gives the landuse Data. Also tetermines size and position of the landuse for slice |
pts_in | gives the spezial points. For this points more output is done then for the others. Calcualtion is the same. |
snow_stations | gives a vector of pointers to the SnowStation objects relevant for this thread |
offset_in | gives the offsett on X for this slice (needed to read data and error messages) |
SnowpackInterfaceWorker::~SnowpackInterfaceWorker |
( |
| ) |
|
void SnowpackInterfaceWorker::clearSpecialPointsData |
( |
| ) |
|
void SnowpackInterfaceWorker::getGrid |
( |
const SnGrids::Parameters & |
param, |
|
|
mio::Grid2DObject & |
o_grid2D |
|
) |
| const |
Method that the Master can search the neded data (in grids) from Worker (Pull from client)
- Parameters
-
param | says which grid param the Master wants to have |
o_grid2D | is the output grid, which gives back the data to the master |
double & SnowpackInterfaceWorker::getGridPoint |
( |
const SnGrids::Parameters & |
param, |
|
|
const size_t & |
ii, |
|
|
const size_t & |
jj |
|
) |
| |
Retrieve one point (ii,jj) from the specified grid.
- Parameters
-
param | says which grid param the Master wants to have |
ii | ii index |
jj | jj index |
- Returns
- grid value at point (ii,jj) for parameter param
void SnowpackInterfaceWorker::getOutputSNO |
( |
std::vector< SnowStation * > & |
snow_station | ) |
const |
method that returns SnowCover files for specific date.
- Parameters
-
snow_station | vector that will be filled with the SnowStation data for each pixels |
void SnowpackInterfaceWorker::getOutputSpecialPoints |
( |
std::vector< SnowStation * > & |
ptr_snow_pixel, |
|
|
std::vector< CurrentMeteo * > & |
ptr_meteo_pixel, |
|
|
std::vector< SurfaceFluxes * > & |
ptr_surface_flux |
|
) |
| |
bool SnowpackInterfaceWorker::is_special |
( |
const std::vector< std::pair< size_t, size_t > > & |
pts_in, |
|
|
const size_t & |
ix, |
|
|
const size_t & |
iy |
|
) |
| |
|
static |
int SnowpackInterfaceWorker::round_landuse |
( |
const double & |
landuse_dbl | ) |
|
|
static |
optimised way to round landuse
- Parameters
-
landuse_dbl | is the landuse to round |
void SnowpackInterfaceWorker::runModel |
( |
const mio::Date & |
date, |
|
|
const mio::Grid2DObject & |
psum, |
|
|
const mio::Grid2DObject & |
psum_ph, |
|
|
const mio::Grid2DObject & |
rh, |
|
|
const mio::Grid2DObject & |
ta, |
|
|
const mio::Grid2DObject & |
vw, |
|
|
const mio::Grid2DObject & |
mns, |
|
|
const mio::Grid2DObject & |
shortwave, |
|
|
const mio::Grid2DObject & |
diffuse, |
|
|
const mio::Grid2DObject & |
longwave, |
|
|
const double |
solarElevation |
|
) |
| |
method which prepares all data for simulation and then access correctly the Snowpack model interfaces.
- Parameters
-
date | current simulation time step |
psum | precipitation grid (kg m-2) |
psum_ph | precipitation phase grid (between 0 and 1) |
rh | relative humidity grid (% or 1) |
ta | air temperature grid (K) |
vw | wind velocity grid (m s-1) |
mns | map of the Precipitation (mm/h) HACK get this map only if per pull from Master if Drift is used !! |
shortwave | incoming shortwave radiation grid (W m-2) |
diffuse | diffuse radiation from the sky grid (W m-2) |
longwave | incoming longwave grid (W m-2) |
solarElevation | solar elevation (in dec) |
void SnowpackInterfaceWorker::setUseDrift |
( |
const bool |
useDrift_in | ) |
|
|
inline |
void SnowpackInterfaceWorker::setUseEBalance |
( |
const bool |
useEBalance_in | ) |
|
|
inline |
bool SnowpackInterfaceWorker::skipThisCell |
( |
const double & |
landuse_val, |
|
|
const double & |
dem_val |
|
) |
| |
|
static |
check if a cell should be simulated or skipped
- Parameters
-
landuse_val | land use parameter for this pixel |
dem_val | dem altitude for this pixel |
The documentation for this class was generated from the following files: