Skip to content

Commit d5cd35a

Browse files
author
Yang
authored
Merge pull request #1 from EcoExtreML/notebook_to_run_model
Notebook to run the model on Snellius and CRIB
2 parents 4542fb8 + 4e14e7e commit d5cd35a

5 files changed

Lines changed: 449 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# output file
2+
out/
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

README.md

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,103 @@
11
# processing
2-
Examples about running the STEMMUS-SCOPE model
2+
3+
This repositary includes python modules for running the STEMMUS-SCOPE model in a
4+
notebook.
5+
6+
The workflow is executed using python and MATLAB Runtime on a Unix-like system.
7+
The python packages are listed in the
8+
[`environment.yml`](https://github.com/EcoExtreML/processing/blob/main/environment.yml)
9+
file. Follow the instructions below to create conda environment and install
10+
MATLAB Runtime.
11+
12+
<details>
13+
<summary>Create conda environment </summary>
14+
15+
Run the commands below in a terminal:
16+
17+
```sh
18+
# Download and install Conda
19+
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-pypy3-Linux-x86_64.sh
20+
bash Mambaforge-pypy3-Linux-x86_64.sh
21+
-b -p ~/mamba
22+
23+
# Update base environment
24+
. ~/mamba/bin/activate
25+
mamba update --name base mamba
26+
27+
# Clone this repository
28+
git clone https://github.com/EcoExtreML/processing.git
29+
30+
# Create a conda environment called 'stemmus' with all required dependencies
31+
cd processing
32+
mamba env create
33+
34+
# The environment can be activated with
35+
. ~/mamba/bin/activate stemmus
36+
37+
```
38+
</details>
39+
40+
<details>
41+
<summary>Install MATLAB Runtime </summary>
42+
43+
To run the STEMMUS_SCOPE, you need MATLAB Runtime version `2021a`.
44+
45+
In a terminal:
46+
47+
```sh
48+
# Download MATLAB Runtime for Linux
49+
wget https://ssd.mathworks.com/supportfiles/downloads/R2021a/Release/6/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2021a_Update_6_glnxa64.zip
50+
51+
# Unzip the file
52+
unzip MATLAB_Runtime_R2021a_Update_6_glnxa64.zip
53+
54+
# Install it
55+
cd MATLAB_Runtime_R2021a_Update_6_glnxa64
56+
sudo -H ./install -mode silent -agreeToLicense yes
57+
```
58+
59+
For more information on how to download and install it, see the links below:
60+
- [download](https://nl.mathworks.com/products/compiler/matlab-runtime.html)
61+
- [intallation](https://nl.mathworks.com/help/compiler/install-the-matlab-runtime.html)
62+
63+
**On Snellius:**
64+
65+
[Snellius](https://servicedesk.surfsara.nl/wiki/display/WIKI/Snellius) is the
66+
Dutch National supercomputer hosted at SURF. MATLAB Runtime is installed on
67+
Snellius, see the script
68+
[`run_jupyter_lab_on_compute_node.sh`](https://github.com/EcoExtreML/processing/blob/main/run_jupyter_lab_on_compute_node.sh)
69+
on how to load the module.
70+
</details>
71+
72+
# Run jupyter notebook
73+
74+
Open a terminal and run:
75+
76+
```sh
77+
jupyter lab
78+
```
79+
80+
JupyterLab will open automatically in your browser.
81+
82+
**On Snellius:**
83+
84+
Use the script
85+
[`run_jupyter_lab_on_compute_node.sh`](https://github.com/EcoExtreML/processing/blob/main/run_jupyter_lab_on_compute_node.sh)
86+
to create a jupyter lab server on Snellius for running the notebook
87+
interactively.
88+
89+
# Run jupyter notebook on CRIB
90+
91+
[CRIB](https://crib.utwente.nl/) is the ITC Geospatial Computing Platform.
92+
Currently, running the notebook on CRIB is not supported because MATLAB Runtime
93+
can not be installed there.
94+
95+
# Recipe of model execution
96+
97+
The execution of the model includes following steps:
98+
99+
- Create exe file
100+
- Update/set config files
101+
- Create input directories, prepare input files
102+
- Run the model
103+
- Create output directories, prepare output files

environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: stemmus
3+
channels:
4+
- conda-forge
5+
dependencies:
6+
- python=3.9
7+
- netcdf4>=1.5.8,<2
8+
- pandas
9+
- jupyterlab

0 commit comments

Comments
 (0)