|
22 | 22 | "import time" |
23 | 23 | ] |
24 | 24 | }, |
| 25 | + { |
| 26 | + "cell_type": "markdown", |
| 27 | + "metadata": {}, |
| 28 | + "source": [ |
| 29 | + "#### Path to STEMMUS_SCOPE\n", |
| 30 | + "\n", |
| 31 | + "STEMMUS_SCOPE executable file is located in the **private** repository on GitHub https://github.com/EcoExtreML/STEMMUS_SCOPE. You need to clone the repository locally and specify the path to it in the cell below. Make sure you have right access to the repository. " |
| 32 | + ] |
| 33 | + }, |
25 | 34 | { |
26 | 35 | "cell_type": "code", |
27 | 36 | "execution_count": 2, |
28 | 37 | "metadata": {}, |
29 | 38 | "outputs": [], |
30 | 39 | "source": [ |
31 | 40 | "# path to executable\n", |
32 | | - "root_path_to_model = Path(Path.home(), \"STEMMUS_SCOPE\")" |
| 41 | + "path_to_model = Path(\"path_to_STEMMUS_SCOPE_repository\")" |
33 | 42 | ] |
34 | 43 | }, |
35 | 44 | { |
|
41 | 50 | }, |
42 | 51 | { |
43 | 52 | "cell_type": "code", |
44 | | - "execution_count": 15, |
| 53 | + "execution_count": 5, |
45 | 54 | "metadata": {}, |
46 | 55 | "outputs": [], |
47 | 56 | "source": [ |
48 | 57 | "# the user must provide the correct path\n", |
49 | 58 | "# path to config file\n", |
50 | | - "config_file_path = root_path_to_model / \"config_file_snellius.txt\"\n", |
| 59 | + "config_file_path = path_to_model / \"config_file_snellius.txt\"\n", |
51 | 60 | "# create an empty dict\n", |
52 | 61 | "config = {}\n", |
53 | 62 | "with open(config_file_path, \"r\") as f:\n", |
|
58 | 67 | }, |
59 | 68 | { |
60 | 69 | "cell_type": "code", |
61 | | - "execution_count": 16, |
| 70 | + "execution_count": 6, |
62 | 71 | "metadata": {}, |
63 | 72 | "outputs": [ |
64 | 73 | { |
|
73 | 82 | " 'DurationSize': '17520'}" |
74 | 83 | ] |
75 | 84 | }, |
76 | | - "execution_count": 16, |
| 85 | + "execution_count": 6, |
77 | 86 | "metadata": {}, |
78 | 87 | "output_type": "execute_result" |
79 | 88 | } |
|
84 | 93 | }, |
85 | 94 | { |
86 | 95 | "cell_type": "code", |
87 | | - "execution_count": 17, |
| 96 | + "execution_count": 10, |
88 | 97 | "metadata": {}, |
89 | 98 | "outputs": [ |
90 | 99 | { |
91 | 100 | "data": { |
92 | 101 | "text/plain": [ |
93 | | - "{'SoilPropertyPath': '/projects/0/einf2480/model_parameters/soil_property/',\n", |
94 | | - " 'InputPath': '/scratch-shared/ecoextreml/stemmus_scope/input/',\n", |
95 | | - " 'OutputPath': '/scratch-shared/ecoextreml/stemmus_scope/output/',\n", |
96 | | - " 'ForcingPath': '/projects/0/einf2480/forcing/plumber2_data/',\n", |
| 102 | + "{'SoilPropertyPath': '/home/sarah/temp/ecoextreml/data/model_parameters/soil_property/',\n", |
| 103 | + " 'InputPath': '/home/sarah/temp/ecoextreml/input/',\n", |
| 104 | + " 'OutputPath': '/home/sarah/temp/ecoextreml/output/',\n", |
| 105 | + " 'ForcingPath': '/home/sarah/temp/ecoextreml/data/forcing/plumber2_data/',\n", |
97 | 106 | " 'ForcingFileName': 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc',\n", |
98 | | - " 'VegetationPropertyPath': '/projects/0/einf2480/model_parameters/vegetation_property/',\n", |
| 107 | + " 'VegetationPropertyPath': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/',\n", |
99 | 108 | " 'DurationSize': '20'}" |
100 | 109 | ] |
101 | 110 | }, |
102 | | - "execution_count": 17, |
| 111 | + "execution_count": 10, |
103 | 112 | "metadata": {}, |
104 | 113 | "output_type": "execute_result" |
105 | 114 | } |
|
119 | 128 | }, |
120 | 129 | { |
121 | 130 | "cell_type": "code", |
122 | | - "execution_count": 21, |
| 131 | + "execution_count": 11, |
123 | 132 | "metadata": {}, |
124 | 133 | "outputs": [], |
125 | 134 | "source": [ |
|
152 | 161 | }, |
153 | 162 | { |
154 | 163 | "cell_type": "code", |
155 | | - "execution_count": 22, |
| 164 | + "execution_count": 19, |
156 | 165 | "metadata": {}, |
157 | 166 | "outputs": [ |
158 | 167 | { |
159 | 168 | "name": "stdout", |
160 | 169 | "output_type": "stream", |
161 | 170 | "text": [ |
162 | | - "Prepare work directory /scratch-shared/ecoextreml/stemmus_scope/input/NL-Hor_20220511_1608 for the station: NL-Hor\n", |
163 | | - "Prepare work directory /scratch-shared/ecoextreml/stemmus_scope/input/ZA-Kru_20220511_1608 for the station: ZA-Kru\n" |
| 171 | + "Prepare work directory /home/sarah/temp/ecoextreml/input/NL-Hor_20220513_1256 for the station: NL-Hor\n", |
| 172 | + "Prepare work directory /home/sarah/temp/ecoextreml/input/ZA-Kru_20220513_1256 for the station: ZA-Kru\n" |
164 | 173 | ] |
165 | 174 | } |
166 | 175 | ], |
|
190 | 199 | }, |
191 | 200 | { |
192 | 201 | "cell_type": "code", |
193 | | - "execution_count": 24, |
| 202 | + "execution_count": null, |
194 | 203 | "metadata": {}, |
195 | | - "outputs": [ |
196 | | - { |
197 | | - "name": "stdout", |
198 | | - "output_type": "stream", |
199 | | - "text": [ |
200 | | - "Run STEMMUS-SCOPE with the forcing: NL-Hor_2008-2011_FLUXNET2015_Met.nc\n", |
201 | | - "Opening log file: /scratch-shared/ecoextreml/stemmus_scope/input/NL-Hor_20220511_1608/java.log.8335\n", |
202 | | - "Reading config from /scratch-shared/ecoextreml/stemmus_scope/input/NL-Hor_20220511_1608/NL-Hor_20220511_1608_config.txt\n", |
203 | | - "\n", |
204 | | - " The calculations start now \n", |
205 | | - "Run STEMMUS-SCOPE with the forcing: ZA-Kru_2000-2002_FLUXNET2015_Met.nc\n", |
206 | | - "Opening log file: /scratch-shared/ecoextreml/stemmus_scope/input/ZA-Kru_20220511_1608/java.log.9161\n", |
207 | | - "Reading config from /scratch-shared/ecoextreml/stemmus_scope/input/ZA-Kru_20220511_1608/ZA-Kru_20220511_1608_config.txt\n", |
208 | | - "\n", |
209 | | - " The calculations start now \n", |
210 | | - " The calculations end now \r" |
211 | | - ] |
212 | | - } |
213 | | - ], |
| 204 | + "outputs": [], |
214 | 205 | "source": [ |
215 | 206 | "# generate a text file\n", |
216 | | - "root_path = Path().resolve().parent\n", |
217 | 207 | "str.split(\"/\")[-1]\n", |
218 | 208 | "for ncfile in forcing_filenames_list:\n", |
219 | 209 | " path_to_config = config_path_dict[ncfile]\n", |
220 | 210 | " # set matlab log dir to slurm, otherwise java.log files are created in user home dir\n", |
221 | 211 | " os.environ['MATLAB_LOG_DIR'] = str(work_dir_dict[ncfile])\n", |
222 | 212 | " # run the model\n", |
223 | 213 | " print(f\"Run STEMMUS-SCOPE with the forcing: {ncfile}\")\n", |
224 | | - " result = subprocess.run([f\"exe/STEMMUS_SCOPE {path_to_config}\"], cwd = root_path_to_model, shell=True)\n", |
| 214 | + " result = subprocess.run([f\"exe/STEMMUS_SCOPE {path_to_config}\"], cwd = path_to_model, shell=True)\n", |
225 | 215 | " result.check_returncode()" |
226 | 216 | ] |
227 | 217 | }, |
|
268 | 258 | ], |
269 | 259 | "source": [ |
270 | 260 | "# convert csv files to nc files\n", |
271 | | - "path_to_utils = Path(root_path_to_model, \"utils/csv_to_nc\")\n", |
| 261 | + "path_to_utils = Path(path_to_model, \"utils/csv_to_nc\")\n", |
272 | 262 | "for ncfile in forcing_filenames_list:\n", |
273 | 263 | " path_to_config = config_path_dict[ncfile]\n", |
274 | 264 | " result = subprocess.run([\"python\", Path(path_to_utils, \"generate_netcdf_files.py\"),\n", |
|
0 commit comments