lakelevel 0.1.0
lakelevel is a small D library for reservoir and lake water arithmetic. Operators report a lake by its water-surface elevation in feet above a datum, while the public asks how full it is and how much water that represents. This library does the conversions in between. Eight public functions. percentFull turns an elevation into a percentage of the conservation pool given the full-pool and dead-pool elevations. depthAboveDatum gives depth over the streambed or gauge datum. interpArea interpolates surface area linearly between two rows of a published elevation-area table and clamps at either end rather than extrapolating. storageChange applies the average-end-area method to get the incremental storage in acre-feet between two elevations. Four unit conversions cover acre-feet to and from US gallons and cubic-feet-per-second to and from acre-feet per day. The numeric conversion constants are declared as named enums with their derivation in the comment, so a reader can check them. Degenerate brackets and NaN inputs return zero instead of a nonsense figure. Six unittest blocks, no dependencies, MIT licensed.
| Tags | d dlang library hydrology water units |
|---|---|
| License | MITL |
| State | initial |