Skip to content

Commit 33adb9e

Browse files
Merge pull request #104 from EcoExtreML/bmi-MODFLOW-coupling
Add a BMI MODFLOW coupling notebook
2 parents d2e9186 + e9268ce commit 33adb9e

9 files changed

Lines changed: 6865 additions & 6 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/ecoextreml/stemmus_scope:1.6.0
1+
FROM ghcr.io/ecoextreml/stemmus_scope:1.6.1
22

33
LABEL maintainer="Bart Schilperoort <b.schilperoort@esciencecenter.nl>"
44
LABEL org.opencontainers.image.source = "https://github.com/EcoExtreML/STEMMUS_SCOPE_Processing"

PyStemmusScope/bmi/docker_process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class StemmusScopeDocker:
8383
"""Communicate with a STEMMUS_SCOPE Docker container."""
8484

8585
# Default image, can be overridden with config:
86-
compatible_tags = ("1.6.0",)
86+
compatible_tags = ("1.6.1",)
8787

8888
_process_ready_phrase = b"Select BMI mode:"
8989
_process_finalized_phrase = b"Finished clean up."

PyStemmusScope/bmi/variable_reference.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ class BmiVariable:
114114
grid=0,
115115
keys=["gwfluxes", "recharge"],
116116
),
117+
BmiVariable(
118+
name="groundwater_recharge_index",
119+
dtype="int64",
120+
input=False,
121+
output=True,
122+
units="-",
123+
grid=0,
124+
keys=["gwfluxes", "indxRchrg"],
125+
),
117126
# groundwater (coupling) vars
118127
BmiVariable(
119128
name="groundwater_coupling_enabled",

PyStemmusScope/config_io.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ def _copy_data(input_dir: Path, config: dict) -> None:
126126

127127
# copy input_data.xlsx
128128
shutil.copy(str(config["input_data"]), str(input_dir))
129+
# copy soil_layers_thickness, this is optional
130+
if "soil_layers_thickness" in config:
131+
if Path(config["soil_layers_thickness"]).is_file():
132+
shutil.copy(str(config["soil_layers_thickness"]), str(input_dir))
133+
else:
134+
raise FileNotFoundError(
135+
"The key `soil_layers_thickness` is provided in the config file, "
136+
f"but file {config['soil_layers_thickness']} not found. "
137+
"Remove the key from the config file or provide the file."
138+
)
129139

130140

131141
def _update_config_file(

docs/bmi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ To use the Docker image, use the `DockerImage` setting in the configuration file
1919
```sh
2020
WorkDir=/home/username/tmp/stemmus_scope
2121
...
22-
DockerImage=ghcr.io/ecoextreml/stemmus_scope:1.6.0
22+
DockerImage=ghcr.io/ecoextreml/stemmus_scope:1.6.1
2323
```
2424

25-
It is best to add the version tag here too (`:1.6.0`), this way the BMI will warn you if the version might be incompatible.
25+
It is best to add the version tag here too (`:1.6.1`), this way the BMI will warn you if the version might be incompatible.
2626

2727
Note that the `docker` package for python is required here. Install this with `pip install PyStemmusScope[docker]`.
2828
Additionally, [Docker](https://docs.docker.com/get-docker/) itself has to be installed.
@@ -52,7 +52,7 @@ If you need access to other model variables that are not yet available in the BM
5252

5353
A [Docker image is available](https://ghcr.io/ecoextreml/stemmus_scope-grpc4bmi) in which the model as well as the Python BMI have been wrapped in a container. The Docker image is created using the Docker file [here](https://github.com/EcoExtreML/STEMMUS_SCOPE_Processing/blob/main/Dockerfile) and allows communication with a STEMMUS_SCOPE BMI through [grpc4bmi](https://grpc4bmi.readthedocs.io/en/latest/).
5454

55-
Doing so avoids the needs to install PyStemmusScope yourself, only Docker/apptainer and a python environment with grpc4bmi are required. Please note you should not specify `DockerImage` or `ExeFilePath` in the config file if you are using the grpc4bmi interface.
55+
Doing so avoids the needs to install PyStemmusScope yourself, only Docker/apptainer and a python environment with grpc4bmi are required. Please note you should not specify `DockerImage` or `ExeFilePath` in the config file if you are using the grpc4bmi interface.
5656

5757
A demonstration is available [here](notebooks/grpc4bmi_demo.ipynb)
5858

0 commit comments

Comments
 (0)