hydro_core/forcing.rs
1//! Forcing data types shared across all hydrology models.
2
3use serde::{Serialize, Deserialize};
4
5/// Per-timestep meteorological forcing for a sub-basin or grid cell.
6#[derive(Clone, Debug, Serialize, Deserialize, Default)]
7pub struct Forcing {
8 /// Precipitation (mm) for this time-step.
9 pub p_mm: f64,
10 /// Potential evapotranspiration (mm).
11 pub pet_mm: f64,
12 /// Air temperature (°C).
13 pub t_c: f64,
14}
15
16/// Basin / sub-basin metadata shared across models.
17#[derive(Clone, Debug, Serialize, Deserialize)]
18pub struct BasinInfo {
19 pub id: String,
20 pub name: String,
21 /// Basin area in km².
22 pub area_km2: f64,
23 /// Outlet coordinates (lat, lon).
24 pub outlet_lat: f64,
25 pub outlet_lon: f64,
26}
27
28/// Outlet section descriptor.
29#[derive(Clone, Debug, Serialize, Deserialize)]
30pub struct Outlet {
31 pub basin_id: String,
32 pub name: String,
33 /// Stage-discharge relationship (optional, for routing).
34 pub rating_curve: Option<Vec<(f64, f64)>>, // (stage_m, discharge_m3s)
35}