|
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | 7 | "## Run the STEMMUS_SCOPE model\n", |
8 | | - "Steps to run the STEMMUS_SCOPE model, including preprocessing and postprocessing, on Surf super computer Snellius." |
| 8 | + "Steps to run the STEMMUS_SCOPE model, including preprocessing and postprocessing, on Surf super computer Snellius or on a unix system." |
9 | 9 | ] |
10 | 10 | }, |
11 | 11 | { |
|
50 | 50 | }, |
51 | 51 | { |
52 | 52 | "cell_type": "code", |
53 | | - "execution_count": 5, |
| 53 | + "execution_count": 16, |
54 | 54 | "metadata": {}, |
55 | 55 | "outputs": [], |
56 | 56 | "source": [ |
|
67 | 67 | }, |
68 | 68 | { |
69 | 69 | "cell_type": "code", |
70 | | - "execution_count": 6, |
| 70 | + "execution_count": 17, |
71 | 71 | "metadata": {}, |
72 | 72 | "outputs": [ |
73 | 73 | { |
|
82 | 82 | " 'DurationSize': '17520'}" |
83 | 83 | ] |
84 | 84 | }, |
85 | | - "execution_count": 6, |
| 85 | + "execution_count": 17, |
86 | 86 | "metadata": {}, |
87 | 87 | "output_type": "execute_result" |
88 | 88 | } |
|
93 | 93 | }, |
94 | 94 | { |
95 | 95 | "cell_type": "code", |
96 | | - "execution_count": 10, |
| 96 | + "execution_count": 18, |
97 | 97 | "metadata": {}, |
98 | 98 | "outputs": [ |
99 | 99 | { |
100 | 100 | "data": { |
101 | 101 | "text/plain": [ |
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", |
| 102 | + "{'SoilPropertyPath': '/projects/0/einf2480/model_parameters/soil_property/',\n", |
| 103 | + " 'InputPath': '/scratch-shared/ecoextreml/stemmus_scope/input/',\n", |
| 104 | + " 'OutputPath': '/scratch-shared/ecoextreml/stemmus_scope/output/',\n", |
| 105 | + " 'ForcingPath': '/projects/0/einf2480/forcing/plumber2_data/',\n", |
106 | 106 | " 'ForcingFileName': 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc',\n", |
107 | | - " 'VegetationPropertyPath': '/home/sarah/temp/ecoextreml/data/model_parameters/vegetation_property/',\n", |
108 | | - " 'DurationSize': '20'}" |
| 107 | + " 'VegetationPropertyPath': '/projects/0/einf2480/model_parameters/vegetation_property/',\n", |
| 108 | + " 'DurationSize': '5'}" |
109 | 109 | ] |
110 | 110 | }, |
111 | | - "execution_count": 10, |
| 111 | + "execution_count": 18, |
112 | 112 | "metadata": {}, |
113 | 113 | "output_type": "execute_result" |
114 | 114 | } |
115 | 115 | ], |
116 | 116 | "source": [ |
117 | 117 | "# edit config\n", |
118 | | - "config[\"DurationSize\"] = \"20\"\n", |
| 118 | + "config[\"DurationSize\"] = \"5\"\n", |
119 | 119 | "config" |
120 | 120 | ] |
121 | 121 | }, |
|
128 | 128 | }, |
129 | 129 | { |
130 | 130 | "cell_type": "code", |
131 | | - "execution_count": 11, |
| 131 | + "execution_count": 9, |
132 | 132 | "metadata": {}, |
133 | 133 | "outputs": [], |
134 | 134 | "source": [ |
|
161 | 161 | }, |
162 | 162 | { |
163 | 163 | "cell_type": "code", |
164 | | - "execution_count": 19, |
| 164 | + "execution_count": 10, |
165 | 165 | "metadata": {}, |
166 | 166 | "outputs": [ |
167 | 167 | { |
168 | 168 | "name": "stdout", |
169 | 169 | "output_type": "stream", |
170 | 170 | "text": [ |
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" |
| 171 | + "Prepare work directory /home/sarah/temp/ecoextreml/input/NL-Hor_20220519_1455 for the station: NL-Hor\n", |
| 172 | + "Prepare work directory /home/sarah/temp/ecoextreml/input/ZA-Kru_20220519_1455 for the station: ZA-Kru\n" |
173 | 173 | ] |
174 | 174 | } |
175 | 175 | ], |
|
182 | 182 | "\n", |
183 | 183 | "full_run = False\n", |
184 | 184 | "if full_run:\n", |
185 | | - " forcing_filenames_list = Path(config[\"ForcingPath\"]).iterdir()\n", |
| 185 | + " forcing_filenames_list = [file.name for file in Path(config[\"ForcingPath\"]).iterdir()]\n", |
186 | 186 | "\n", |
187 | 187 | "config_path_dict = {}\n", |
188 | 188 | "work_dir_dict = {}\n", |
|
194 | 194 | "cell_type": "markdown", |
195 | 195 | "metadata": {}, |
196 | 196 | "source": [ |
197 | | - "#### Run the model" |
| 197 | + "#### Run the model\n", |
| 198 | + "\n", |
| 199 | + "If you run the model locally, you need to first intsall MATLAB Runtime, see instructions in the [readme](https://github.com/EcoExtreML/processing#readme). Then set `LD_LIBRARY_PATH`. To do this, uncomment the cell below and run it:" |
198 | 200 | ] |
199 | 201 | }, |
200 | 202 | { |
201 | 203 | "cell_type": "code", |
202 | | - "execution_count": null, |
| 204 | + "execution_count": 13, |
203 | 205 | "metadata": {}, |
204 | | - "outputs": [], |
| 206 | + "outputs": [ |
| 207 | + { |
| 208 | + "name": "stdout", |
| 209 | + "output_type": "stream", |
| 210 | + "text": [ |
| 211 | + "/usr/local/MATLAB/MATLAB_Runtime/v910/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/extern/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/sys/opengl/lib/glnxa64\n" |
| 212 | + ] |
| 213 | + } |
| 214 | + ], |
| 215 | + "source": [ |
| 216 | + "# # Set LD_LIBRARY_PATH\n", |
| 217 | + "matlab_path = !whereis MATLAB\n", |
| 218 | + "matlab_path = matlab_path.s.split(\": \")[1]\n", |
| 219 | + "os.environ['LD_LIBRARY_PATH'] = (\n", |
| 220 | + " f\"{matlab_path}/MATLAB_Runtime/v910/runtime/glnxa64:\"\n", |
| 221 | + " f\"{matlab_path}/MATLAB_Runtime/v910/bin/glnxa64:\"\n", |
| 222 | + " f\"{matlab_path}/MATLAB_Runtime/v910/sys/os/glnxa64:\"\n", |
| 223 | + " f\"{matlab_path}/MATLAB_Runtime/v910/extern/bin/glnxa64:\"\n", |
| 224 | + " f\"{matlab_path}/MATLAB_Runtime/v910/sys/opengl/lib/glnxa64\")\n", |
| 225 | + "print(os.environ['LD_LIBRARY_PATH'])" |
| 226 | + ] |
| 227 | + }, |
| 228 | + { |
| 229 | + "cell_type": "code", |
| 230 | + "execution_count": 14, |
| 231 | + "metadata": {}, |
| 232 | + "outputs": [ |
| 233 | + { |
| 234 | + "name": "stdout", |
| 235 | + "output_type": "stream", |
| 236 | + "text": [ |
| 237 | + "Run STEMMUS-SCOPE with the forcing: NL-Hor_2008-2011_FLUXNET2015_Met.nc\n", |
| 238 | + "Reading config from /home/sarah/temp/ecoextreml/input/NL-Hor_20220519_1455/NL-Hor_20220519_1455_config.txt\n", |
| 239 | + "\n", |
| 240 | + " The calculations start now \n", |
| 241 | + "Run STEMMUS-SCOPE with the forcing: ZA-Kru_2000-2002_FLUXNET2015_Met.nc\n", |
| 242 | + "Reading config from /home/sarah/temp/ecoextreml/input/ZA-Kru_20220519_1455/ZA-Kru_20220519_1455_config.txt\n", |
| 243 | + "\n", |
| 244 | + " The calculations start now \n", |
| 245 | + " The calculations end now \r" |
| 246 | + ] |
| 247 | + } |
| 248 | + ], |
205 | 249 | "source": [ |
206 | 250 | "# generate a text file\n", |
207 | | - "str.split(\"/\")[-1]\n", |
208 | 251 | "for ncfile in forcing_filenames_list:\n", |
209 | 252 | " path_to_config = config_path_dict[ncfile]\n", |
210 | 253 | " # set matlab log dir to slurm, otherwise java.log files are created in user home dir\n", |
|
224 | 267 | }, |
225 | 268 | { |
226 | 269 | "cell_type": "code", |
227 | | - "execution_count": 26, |
| 270 | + "execution_count": 15, |
228 | 271 | "metadata": {}, |
229 | 272 | "outputs": [ |
230 | 273 | { |
231 | 274 | "name": "stdout", |
232 | 275 | "output_type": "stream", |
233 | 276 | "text": [ |
234 | | - "/scratch-shared/ecoextreml/stemmus_scope/output/NL-Hor_2022-05-11-1610/ECdata.csv\n", |
235 | | - "Reading variable metadata from /home/yangl/STEMMUS_SCOPE/utils/csv_to_nc/Variables_will_be_in_NetCDF_file.csv\n", |
236 | | - "Creating /scratch-shared/ecoextreml/stemmus_scope/output/NL-Hor_2022-05-11-1610/NL-Hor_2022-05-11-1610_STEMMUS_SCOPE.nc \n", |
| 277 | + "/home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-19-1457/ECdata.csv\n", |
| 278 | + "Reading variable metadata from /home/sarah/GitHub/STEMMUS_SCOPE/utils/csv_to_nc/Variables_will_be_in_NetCDF_file.csv\n", |
| 279 | + "Creating /home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-19-1457/NL-Hor_2022-05-19-1457_STEMMUS_SCOPE.nc \n", |
237 | 280 | "Reading data from file: radiation.csv\n", |
238 | 281 | "Reading data from file: fluxes.csv\n", |
239 | 282 | "Reading data from file: surftemp.csv\n", |
240 | 283 | "Reading data from file: Sim_Temp.csv\n", |
241 | 284 | "Reading data from file: Sim_Theta.csv\n", |
242 | 285 | "Reading data from file: aerodyn.csv\n", |
243 | 286 | "Reading data from file: ECdata.csv\n", |
244 | | - "Done writing /scratch-shared/ecoextreml/stemmus_scope/output/NL-Hor_2022-05-11-1610/NL-Hor_2022-05-11-1610_STEMMUS_SCOPE.nc\n", |
245 | | - "/scratch-shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-05-11-1611/ECdata.csv\n", |
246 | | - "Reading variable metadata from /home/yangl/STEMMUS_SCOPE/utils/csv_to_nc/Variables_will_be_in_NetCDF_file.csv\n", |
247 | | - "Creating /scratch-shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-05-11-1611/ZA-Kru_2022-05-11-1611_STEMMUS_SCOPE.nc \n", |
| 287 | + "Done writing /home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-19-1457/NL-Hor_2022-05-19-1457_STEMMUS_SCOPE.nc\n", |
| 288 | + "/home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-19-1458/ECdata.csv\n", |
| 289 | + "Reading variable metadata from /home/sarah/GitHub/STEMMUS_SCOPE/utils/csv_to_nc/Variables_will_be_in_NetCDF_file.csv\n", |
| 290 | + "Creating /home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-19-1458/ZA-Kru_2022-05-19-1458_STEMMUS_SCOPE.nc \n", |
248 | 291 | "Reading data from file: radiation.csv\n", |
249 | 292 | "Reading data from file: fluxes.csv\n", |
250 | 293 | "Reading data from file: surftemp.csv\n", |
251 | 294 | "Reading data from file: Sim_Temp.csv\n", |
252 | 295 | "Reading data from file: Sim_Theta.csv\n", |
253 | 296 | "Reading data from file: aerodyn.csv\n", |
254 | 297 | "Reading data from file: ECdata.csv\n", |
255 | | - "Done writing /scratch-shared/ecoextreml/stemmus_scope/output/ZA-Kru_2022-05-11-1611/ZA-Kru_2022-05-11-1611_STEMMUS_SCOPE.nc\n" |
| 298 | + "Done writing /home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-19-1458/ZA-Kru_2022-05-19-1458_STEMMUS_SCOPE.nc\n" |
256 | 299 | ] |
257 | 300 | } |
258 | 301 | ], |
|
266 | 309 | " Path(path_to_utils, \"Variables_will_be_in_NetCDF_file.csv\")])\n", |
267 | 310 | " result.check_returncode()" |
268 | 311 | ] |
| 312 | + }, |
| 313 | + { |
| 314 | + "cell_type": "code", |
| 315 | + "execution_count": null, |
| 316 | + "metadata": {}, |
| 317 | + "outputs": [], |
| 318 | + "source": [] |
269 | 319 | } |
270 | 320 | ], |
271 | 321 | "metadata": { |
|
0 commit comments