Alpine3D  Alpine3D-3.2.0
SnowpackInterface Class Reference

#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 runoff and workers. More...
 
SnowpackInterfaceoperator= (const SnowpackInterface &)
 Assignement 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 in Snowpack Interface Master used method to write standard results in output files. Attantion: to have old format files output, set in ini file following key: A3D_VIEW = true 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 setRunoff (Runoff &init_runoff)
 
void assimilate (const mio::Grid2DObject &daData, const mio::Date &timestamp)
 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 &timestamp)
 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 &timestamp)
 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 double &solarElevation, const mio::Date &timestamp)
 get values from Energy Balance More...
 
mio::Grid2DObject getGrid (const SnGrids::Parameters &param) const
 Request specific grid by parameter type. More...
 

Constructor & Destructor Documentation

◆ SnowpackInterface() [1/2]

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.

Parameters
io_cfgis used to init Runoff and to create IOManager, which is used to write the standart output
nbworkersgives the new values for the wind speed
dem_ingives the demographic Data. Also tetermines size and position of the geographical modeling scope
landuse_ingives the landuse Data. Also tetermines size and position of the landuse for modeling scope
vec_ptsgives the spezial points. For this points more output is done then for the others. Calcualtion is the same.
startTimeis the time and date the first simulation step is done
grids_requirementslist of grids that must be prepared for other modules (similar to the Output::GRIDS_PARAMETERS configuration key)
is_restart_inis used to know which files the worker needs to read to init the pixel

◆ SnowpackInterface() [2/2]

SnowpackInterface::SnowpackInterface ( const SnowpackInterface )

◆ ~SnowpackInterface()

SnowpackInterface::~SnowpackInterface ( )

Destructor of SnowpackInterface Master. Handels special cases with POP-C++ and also free correctly runoff and workers.

Member Function Documentation

◆ assimilate()

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...

Parameters
daDataare the data from the DataAssimilation module
timestampfor controlle if data from DataAssimilation are form the correct simulation step

◆ getGrid()

mio::Grid2DObject SnowpackInterface::getGrid ( const SnGrids::Parameters param) const

Request specific grid by parameter type.

Parameters
paramparameter
Returns
2D output grid (empty if the requested parameter was not available)

◆ getTiming()

double SnowpackInterface::getTiming ( ) const

get time who was used to exchange Data with Workers and run on each Pixel the Snowpack Model throught workers.

◆ operator=()

SnowpackInterface & SnowpackInterface::operator= ( const SnowpackInterface source)

Assignement operator, required because of pointer member.

◆ setDataAssimilation()

void SnowpackInterface::setDataAssimilation ( DataAssimilation init_da)

Set reference to DataAssimilation module, to comunicate with it.

Parameters
init_dais the reference to the DataAssimilation module

◆ setEnergyBalance()

void SnowpackInterface::setEnergyBalance ( EnergyBalance myeb)

Set reference to EnergyBalance module, to comunicate with it.

Parameters
myebis the reference to the EnergyBalance module

◆ setMeteo()

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

Parameters
new_psumgives the new values for new Water High
new_psum_phgives the new values for the precipitation phase
new_vwgives the new values for the wind speed
new_dwgives the new values for the wind direction
new_rhgives the new values for the realtiv Humidity
new_tagives the new values for the Aire temperature
timestampis the time of the calculation step from which this new values are comming

◆ setRadiationComponents()

void SnowpackInterface::setRadiationComponents ( const mio::Array2D< double > &  shortwave_in,
const mio::Array2D< double > &  longwave_in,
const mio::Array2D< double > &  diff_in,
const double &  solarElevation_in,
const mio::Date &  timestamp 
)

get values from Energy Balance

Parameters
shortwave_inis the 2D double Array map of ISWR [W m-2]
longwave_inis the 2D double Array map of ILWR [W m-2]
diff_inis the 2D double Array map of Diffuse radiation from the sky [W m-2]
solarElevation_indouble of Solar elevation to be used for Canopy (in dec)
timestampis the time of the calculation step from which this new values are comming

◆ setRunoff()

void SnowpackInterface::setRunoff ( Runoff init_runoff)

◆ setSnowDrift()

void SnowpackInterface::setSnowDrift ( SnowDriftA3D mydrift)

Set reference to SnowDrift module, to comunicate with it.

Parameters
mydriftis the reference to the SnowDrift module

◆ setSnowMassChange()

void SnowpackInterface::setSnowMassChange ( const mio::Grid2DObject &  new_mns,
const mio::Date &  timestamp 
)

Interface that SnowDrift can push the data to the SnowpackInterface.

Parameters
new_mnsare the data about the new Snow masses from the DataAssimilation module
timestampfor controlle if data from DataAssimilation are form the correct simulation step

◆ writeOutput()

void SnowpackInterface::writeOutput ( const mio::Date &  date)

Internal in Snowpack Interface Master used method to write standard results in output files. Attantion: to have old format files output, set in ini file following key: A3D_VIEW = true

Parameters
dateis the date for which the output is done

◆ writeOutputSNO()

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..

Parameters
dateis the date witch the output is done

The documentation for this class was generated from the following files: