18 #ifndef SNOWPACKINTERFACE_H 19 #define SNOWPACKINTERFACE_H 22 #include <meteoio/MeteoIO.h> 23 #include <snowpack/libsnowpack.h> 132 const mio::DEMObject& dem_in,
133 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);
150 void assimilate(
const mio::Grid2DObject& daData,
const mio::Date& timestamp);
151 void setSnowMassChange(
const mio::Grid2DObject& new_mns,
const mio::Date& timestamp);
152 void setMeteo(
const mio::Grid2DObject& new_psum,
153 const mio::Grid2DObject& new_psum_ph,
154 const mio::Grid2DObject& new_vw,
155 const mio::Grid2DObject& new_dw,
156 const mio::Grid2DObject& new_rh,
157 const mio::Grid2DObject& new_ta,
158 const mio::Date& timestamp);
160 const mio::Array2D<double>& longwave,
161 const mio::Array2D<double>& diff,
162 const double& solarElevation,
163 const mio::Date& timestamp);
168 std::string getGridsRequirements()
const;
169 mio::Config readAndTweakConfig(
const mio::Config& io_cfg,
const bool have_pts);
170 bool do_grid_output(
const mio::Date &date)
const;
172 void setInitGlacierHeight();
173 SN_SNOWSOIL_DATA getIcePixel(
const double glacier_height,
const std::stringstream& GRID_sno,
const bool seaIce);
174 void readInitalSnowCover(std::vector<SnowStation*>& snow_stations,
175 std::vector<std::pair<size_t,size_t> >& snow_stations_coord);
176 void readSnowCover(
const std::string& GRID_sno,
const std::string& LUS_sno,
const bool& is_special_point,
177 SN_SNOWSOIL_DATA &sno, ZwischenData &zwischenData,
const bool& read_seaice);
178 void writeSnowCover(
const mio::Date& date,
const std::vector<SnowStation*>& snow_station);
180 void write_SMET_header(
const mio::StationData& meta,
const double& landuse_code)
const;
181 void write_SMET(
const CurrentMeteo& met,
const mio::StationData& meta,
const SurfaceFluxes& surf)
const;
182 void writeOutputSpecialPoints(
const mio::Date& date,
const std::vector<SnowStation*>& snow_pixel,
const std::vector<CurrentMeteo*>& meteo_pixel,
183 const std::vector<SurfaceFluxes*>& surface_flux);
184 void write_special_points();
185 void calcLateralFlow();
192 std::vector< std::pair<size_t,size_t> > pts;
194 const mio::DEMObject dem;
197 bool is_restart, useCanopy, enable_lateral_flow, a3d_view;
199 std::string station_name;
200 bool glacier_katabatic_flow, snow_production, snow_grooming;
202 std::vector<std::string> Tsoil_idx;
203 double grids_start, grids_days_between;
204 double ts_start, ts_days_between;
205 double prof_start, prof_days_between;
206 bool grids_write, ts_write, prof_write, snow_write, snow_poi_written, glacier_from_grid;
207 std::string meteo_outpath;
211 mio::Grid2DObject maskGlacier;
214 SnowpackConfig sn_cfg;
216 SnowpackIO snowpackIO;
219 size_t mpi_offset, mpi_nx;
220 mio::Grid2DObject landuse;
222 mio::Grid2DObject mns, shortwave, longwave, diffuse;
223 mio::Grid2DObject psum, psum_ph, psum_tech, grooming, vw, dw, rh, ta, init_glaciers_height;
224 double solarElevation;
226 std::vector<std::string> output_grids;
227 std::vector<SnowpackInterfaceWorker*> workers;
228 std::vector<size_t> worker_startx;
229 std::vector<size_t> worker_deltax;
230 std::vector<std::vector<std::pair<size_t,size_t> > > worker_stations_coord;
233 mio::Date nextStepTimestamp;
236 bool dataMeteo2D, dataDa, dataSnowDrift, dataRadiation;
void setRunoff(Runoff &init_runoff)
Definition: SnowpackInterface.cc:546
void writeOutput(const mio::Date &julian)
Internal in Snowpack Interface Master used method to write standard results in output files...
Definition: SnowpackInterface.cc:392
void setSnowMassChange(const mio::Grid2DObject &new_mns, const mio::Date ×tamp)
Interface that SnowDrift can push the data to the SnowpackInterface.
Definition: SnowpackInterface.cc:600
void setSnowDrift(SnowDriftA3D &drift)
Set reference to SnowDrift module, to comunicate with it.
Definition: SnowpackInterface.cc:502
~SnowpackInterface()
Destructor of SnowpackInterface Master. Handels special cases with POP-C++ and also free correctly ru...
Definition: SnowpackInterface.cc:366
void setRadiationComponents(const mio::Array2D< double > &shortw, const mio::Array2D< double > &longwave, const mio::Array2D< double > &diff, const double &solarElevation, const mio::Date ×tamp)
get values from Energy Balance
Definition: SnowpackInterface.cc:677
void setEnergyBalance(EnergyBalance &myeb)
Set reference to EnergyBalance module, to comunicate with it.
Definition: SnowpackInterface.cc:523
mio::Grid2DObject getGrid(const SnGrids::Parameters ¶m) const
Request specific grid by parameter type.
Definition: SnowpackInterface.cc:701
void setDataAssimilation(DataAssimilation &init_da)
Set reference to DataAssimilation module, to comunicate with it.
Definition: SnowpackInterface.cc:541
Definition: SnowDrift.h:78
Definition: SnowpackInterfaceWorker.h:26
SnowpackInterface & operator=(const SnowpackInterface &)
Assignement operator, required because of pointer member.
Definition: SnowpackInterface.cc:237
Definition: EnergyBalance.h:68
Definition: SnowpackInterface.h:127
void assimilate(const mio::Grid2DObject &daData, const mio::Date ×tamp)
Interface that DataAssimilation can push the data to the SnowpackInterface This is currently never us...
Definition: SnowpackInterface.cc:557
Definition: TechSnowA3D.h:70
Parameters
Definition: MeteoObj.h:32
Definition: Glaciers.h:47
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
Definition: SnowpackInterface.cc:632
void writeOutputSNO(const mio::Date &julian)
commands worker to write .sno files. Is triggered by Alpine Control
Definition: SnowpackInterface.cc:456
double getTiming() const
get time who was used to exchange Data with Workers and run on each Pixel the Snowpack Model throught...
Definition: SnowpackInterface.cc:378
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 f...
Definition: SnowpackInterface.cc:76
Definition: DataAssimilation.h:30