75 const std::vector<MeshSnowGeometry>&
geometry);
94 const std::vector<double>& precipitation_ms,
95 const std::vector<double>& snow_catch);
141 bool active()
const {
return !active_cells_.empty(); }
146 for (
int cell : active_cells_)
154 bool owns(
int cell)
const {
return cell >= 0 && cell < int(pack_.size()) && pack_[cell] >= 0; }
173 const std::array<double, 10>&
depletionCurve()
const {
return depletion_curve_; }
179 const std::vector<double>&
liquidRates()
const {
return liquid_rate_; }
209 const std::vector<MeshSnowGeometry>&
geometry()
const {
return geometry_; }
215 const std::vector<SnowOutputs>&
outputs()
const {
return output_; }
221 const std::vector<MeshSnowLedger>&
ledgers()
const {
return ledger_; }
227 return cell >= 0 && std::size_t(cell) < ground_contact_.size() &&
228 ground_contact_[cell] != 0;
257 const std::vector<ueb::HeldState>&
columns()
const {
return held_; }
265 const std::vector<double>& precipitation_ms,
266 const std::vector<double>& snow_catch,
285 double start,
double end,
286 const std::vector<double>& precipitation_ms,
287 const std::vector<double>& snow_catch);
288 std::string identity_;
289 std::string legacy_identity_;
291 std::array<double, 10> depletion_curve_{};
292 std::array<double, 4> forcing_{};
293 double completed_ = 0, last_seconds_ = 0, step_ = 3600;
294 std::vector<int> active_cells_, pack_;
295 std::vector<SnowKind> kind_;
296 std::vector<MeshSnowGeometry> geometry_;
297 std::vector<ueb::Site> site_;
298 std::vector<ueb::HeldState> held_;
299 std::vector<double> precipitation_, catch_, liquid_rate_, exposed_;
300 std::vector<unsigned char> ground_contact_;
301 std::vector<SnowOutputs> output_;
302 std::vector<MeshSnowLedger> ledger_;
Snowmelt — degree-day and rain-on-snow methods.
Configuration and resolution of mesh snow packs and overrides.
Held forcing and state for Utah Energy Balance snow integration.
Definition DegreeDaySnow.hpp:177
Owned mixed degree-day/UEB snow on remaining mesh weather footprints. Geometry area is horizontal m2;...
Definition MeshSnow.hpp:54
bool groundContactEnabled(int cell) const
Test the stored per-cell reciprocal contact bit.
Definition MeshSnow.hpp:226
const std::array< double, 10 > & depletionCurve() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:173
bool hasUeb() const
Scan active cells for at least one UEB model owner.
Definition MeshSnow.hpp:145
bool owns(int cell) const
Test resolved snowpack ownership for one indexed mesh cell.
Definition MeshSnow.hpp:154
bool active() const
Test whether any nonzero assigned snow weather footprint is owned.
Definition MeshSnow.hpp:141
const std::vector< MeshSnowGeometry > & geometry() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:209
std::string advance(SimulationContext &context, double start, double end, const std::vector< double > &precipitation_ms, const std::vector< double > &snow_catch)
Trial a contiguous interval, publishing internal snow state only after success.
Definition MeshSnow.cpp:195
double completedEnd() const
Read the accepted snow-source frontier.
Definition MeshSnow.hpp:158
double groundContactFraction(int cell) const
Read accepted endpoint cover for the next reciprocal thermal interval.
Definition MeshSnow.hpp:237
double groundContactSurfaceTemperature(int cell) const
Read the latest stored cell snow surface temperature.
Definition MeshSnow.hpp:245
const std::vector< ueb::HeldState > & columns() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:257
const std::vector< double > & exposedFractions() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:185
std::string saveCheckpoint() const
Copy this owner and encode a native version-four accepted/predicted snapshot.
Definition MeshSnow.cpp:629
void reanchorCompletedEnd(double end)
Adopt only an ulp-sized driver endpoint change without advancing physics.
Definition MeshSnow.cpp:256
std::string initialize(SimulationContext &context, const std::vector< MeshSnowGeometry > &geometry)
Build a candidate mixed mesh snow owner from resolved authored assignment scopes.
Definition MeshSnow.cpp:41
const std::string & configurationIdentity() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:203
const std::vector< SnowOutputs > & outputs() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:215
SnowKind kind(int cell) const
Read stored model kind for one allocated cell row.
Definition MeshSnow.hpp:167
std::string restoreCheckpoint(const std::string &bytes, bool seed=false)
Validate a native mesh-snow archive into a private candidate then publish it.
Definition MeshSnow.cpp:642
std::string setGroundContactMask(const std::vector< unsigned char > &mask)
Install reciprocal ground-contact ownership for assigned UEB cells.
Definition MeshSnow.cpp:263
void useAcceptedExposure()
Replace ET exposure for active cells by one minus accepted endpoint cover. Does not advance snow or a...
Definition MeshSnow.cpp:252
const std::vector< double > & liquidRates() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:179
double lastSeconds() const
Read the latest ordinary accepted advance duration.
Definition MeshSnow.hpp:162
const std::vector< unsigned char > & groundContactMask() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:251
const std::vector< MeshSnowLedger > & ledgers() const
Borrow owned snow metadata/state without copying it.
Definition MeshSnow.hpp:221
std::string applyGroundContactEnergy(int cell, double soil_j)
Apply an accepted reciprocal soil energy receipt to one covered-point owner.
Definition MeshSnow.cpp:275
Definition CommonSourceStage.hpp:44
Definition GroundHeat.hpp:19
SnowKind
Definition UebConfig.hpp:22
@ Ueb
Definition UebConfig.hpp:22
Definition ExchangeLaw.hpp:60
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
Definition MeshSnow.hpp:24
std::string tag
Definition MeshSnow.hpp:25
double slope
Definition MeshSnow.hpp:26
double aspect
Definition MeshSnow.hpp:26
double area
Definition MeshSnow.hpp:26
Definition MeshSnow.hpp:28
double raw_precipitation
Definition MeshSnow.hpp:29
double net_energy
Definition MeshSnow.hpp:31
double energyResidual() const
Compute signed cumulative represented-energy closure.
Definition MeshSnow.hpp:37
double geometry_energy
Definition MeshSnow.hpp:31
double sublimation
Definition MeshSnow.hpp:29
double liquid
Definition MeshSnow.hpp:29
double initial
Definition MeshSnow.hpp:29
double stored_energy
Definition MeshSnow.hpp:32
double stored
Definition MeshSnow.hpp:30
double prescribed_ground_energy
Definition MeshSnow.hpp:33
double initial_energy
Definition MeshSnow.hpp:31
double ground_contact_energy
Definition MeshSnow.hpp:33
double precipitation
Definition MeshSnow.hpp:29
double residual() const
Compute signed cumulative physical water closure.
Definition MeshSnow.hpp:43
Point UEB material, radiation and integration parameters. Temperatures are Celsius,...
Definition UebSnow.hpp:23