Simstrat is a one-dimensional physical lake model for simulation of stratification and mixing in deep stratified lakes. The aquatic research institute Eawag uses Simstrat to operationally simulate lake conditions for a number of lakes across Switzerland.
The model is coupled with AED2 for biogeochemical simulations.
This repository automates the production of model inputs, running the simulations and publishing the outputs.
- Clone the repository to your local machine using the command:
git clone [email protected]:Eawag-AppliedSystemAnalysis/operational-simstrat.git
Note that the repository will be copied to your current working directory.
- Use Python 3 and install the requirements with:
pip install -r requirements.txt
If you want to run the simulations as part of the pipeline you need to install docker.
- Install docker engine
Warning
The pipeline uses meteorological and hydraulic data from third party providers (MeteoSwiss, BAFU). This data can only be accessed while connected to the Eawag network.
To run the pipeline you must pass the name of an arguments file from the args/
folder to src/main.py
e.g. to run arguments file args/quickstart.json
python src/main.py quickstart
Arguments can be overwritten on the command line by passing them as key=value pairs.
python src/main.py quickstart run=false
A full list of the arguments can be seen in src/configuration.py
In order to add additional lakes their parameters must be added to static/lake_parameter.json
in the format of the
lakes already there.
{
"key": "greifensee",
"name": "Greifensee",
"elevation": 435.0,
"surface_area": 8.5,
"type": "Natural",
"volume": 0.15,
"max_depth": 32.0,
"average_depth": 18.0,
"residence_time": 400.0,
"mixing_regime": "Monomictic",
"geothermal_flux": 0.09,
"latitude": 47.35,
"longitude": 8.678,
"trophic_state": "Eutrophic",
"datalakes_id": 3,
"datalakes_bathymetry": true,
"sediment_oxygen_uptake_rate": -32.5,
"forcing": [
{
"id": "SMA",
"type": "meteoswiss_meteostation"
}
],
"forcing_forecast": {
"source": "MeteoSwiss",
"model": "COSMO",
"days": 5
},
"a_seiche": 0.0056684225,
"f_wind": 0.672030072,
"p_lw": 0.952833972,
"snow_temp": 2.02759986
}
The Simstrat docker image is available here.
cd {{ run_folder }}
docker run -v $(pwd):/simstrat/run eawag/simstrat:3.0.4 Settings.par
See the instructions here for details.
Simstrat operational uses Lake-Calibrator to calibrate the lakes. It is installed as a submodule as can be called as follows:
python src/calibrator.py calibration
Where calibration is the argument file in args/
The arguments follow the same structure as for running simstrat operational but with some additional parameters required.
Observations are required for the calibration, by default they should be located in lake-calibrator/observations
with the structure {lake-key}/{parameter}.csv
. For example greifensee/temperature.csv
.
Observation files should have the following structure:
time | depth | latitude | longitude | value | weight |
---|---|---|---|---|---|
2024-08-12T22:27:54+00:00 | 1.6 | 46.5 | 6.67 | 18.3 | 1 |
2024-08-12T23:27:54+00:00 | 8.4 | 46.5 | 6.67 | 8.5 | 1 |
There should be one file per lake and per parameter and the values should all have the same units.