-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtutorial.html
628 lines (608 loc) · 46.2 KB
/
tutorial.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>5. Tutorial — Community Water Model</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" href="_static/iiasa.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="6. Error handling" href="errorHandling.html" />
<link rel="prev" title="4. Setup of the model" href="setup.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
Community Water Model
<img src="_static/IIASA_logo_white.png" class="logo" alt="Logo"/>
</a>
<div class="version">
1.0.6
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="modeldesign.html">2. Model Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="publication.html">3. Publication</a></li>
<li class="toctree-l1"><a class="reference internal" href="setup.html">4. Setup of the model</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">5. Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#requirements">Requirements</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">Requirements</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#python-version">Python version</a></li>
<li class="toctree-l4"><a class="reference internal" href="#libraries">Libraries</a></li>
<li class="toctree-l4"><a class="reference internal" href="#windows-executeable-python-version">Windows executeable Python version</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#test-the-executable-model-version">Test the executable model version</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#test-1">Test 1</a></li>
<li class="toctree-l3"><a class="reference internal" href="#test-2">Test 2</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#test-the-python-model-version">Test the Python model version</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#error-because-you-did-not-run-it-with-python">Error because you did not run it with Python</a></li>
<li class="toctree-l3"><a class="reference internal" href="#error-because-python-is-not-added-to-the-path">Error because python is not added to the PATH</a></li>
<li class="toctree-l3"><a class="reference internal" href="#error-because-the-path-has-white-spaces-included">Error because the path has white spaces included</a></li>
<li class="toctree-l3"><a class="reference internal" href="#error-because-the-python-libraries-are-installed-incorrectly">Error because the python libraries are installed incorrectly</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#running-the-model-1">Running the model 1</a></li>
<li class="toctree-l2"><a class="reference internal" href="#downloading-and-installing-the-spatial-dataset">Downloading and installing the spatial dataset</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changing-the-settings-file">Changing the Settings file</a></li>
<li class="toctree-l2"><a class="reference internal" href="#error-and-exception-handling">Error and exception handling</a></li>
<li class="toctree-l2"><a class="reference internal" href="#running-the-model-2">Running the model 2</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changing-parameters-of-the-model">Changing parameters of the model</a></li>
<li class="toctree-l2"><a class="reference internal" href="#changing-the-output">Changing the Output</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#output-variables">Output variables</a></li>
<li class="toctree-l3"><a class="reference internal" href="#daily-monthly-at-the-end-or-average">Daily, monthly - at the end or average</a></li>
<li class="toctree-l3"><a class="reference internal" href="#time-series-as-point-infomation-or-catchment-sum-or-average">Time series as point infomation or catchment sum or average</a></li>
<li class="toctree-l3"><a class="reference internal" href="#most-important-output-variables-a-selection">Most important output variables - a selection</a></li>
<li class="toctree-l3"><a class="reference internal" href="#a-list-of-all-variables">A list of all variables</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="errorHandling.html">6. Error handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="listVariables.html">7. List of output variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="results.html">8. Demo of the model</a></li>
<li class="toctree-l1"><a class="reference internal" href="todo.html">9. The Model Itself</a></li>
<li class="toctree-l1"><a class="reference internal" href="data.html">10. Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="calibration.html">11. Calibration tool</a></li>
<li class="toctree-l1"><a class="reference internal" href="calibration_tutorial.html">12. Calibration tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="resolution.html">13. Increasing resolution</a></li>
<li class="toctree-l1"><a class="reference internal" href="zambezi.html">14. Example Zambezi</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">15. License and download info</a></li>
<li class="toctree-l1"><a class="reference internal" href="sourcecode.html">16. Source code</a></li>
<li class="toctree-l1"><a class="reference internal" href="forum.html">17. Forum</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Community Water Model</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active"><span class="section-number">5. </span>Tutorial</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/tutorial.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="tutorial">
<h1><a class="toc-backref" href="#id3" role="doc-backlink"><span class="section-number">5. </span>Tutorial</a><a class="headerlink" href="#tutorial" title="Permalink to this heading"></a></h1>
<nav class="contents" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#tutorial" id="id3">Tutorial</a></p>
<ul>
<li><p><a class="reference internal" href="#requirements" id="id4">Requirements</a></p>
<ul>
<li><p><a class="reference internal" href="#id1" id="id5">Requirements</a></p>
<ul>
<li><p><a class="reference internal" href="#python-version" id="id6">Python version</a></p></li>
<li><p><a class="reference internal" href="#libraries" id="id7">Libraries</a></p></li>
<li><p><a class="reference internal" href="#windows-executeable-python-version" id="id8">Windows executeable Python version</a></p></li>
</ul>
</li>
</ul>
</li>
<li><p><a class="reference internal" href="#test-the-executable-model-version" id="id9">Test the executable model version</a></p>
<ul>
<li><p><a class="reference internal" href="#test-1" id="id10">Test 1</a></p></li>
<li><p><a class="reference internal" href="#test-2" id="id11">Test 2</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#test-the-python-model-version" id="id12">Test the Python model version</a></p>
<ul>
<li><p><a class="reference internal" href="#error-because-you-did-not-run-it-with-python" id="id13">Error because you did not run it with Python</a></p></li>
<li><p><a class="reference internal" href="#error-because-python-is-not-added-to-the-path" id="id14">Error because python is not added to the PATH</a></p></li>
<li><p><a class="reference internal" href="#error-because-the-path-has-white-spaces-included" id="id15">Error because the path has white spaces included</a></p></li>
<li><p><a class="reference internal" href="#error-because-the-python-libraries-are-installed-incorrectly" id="id16">Error because the python libraries are installed incorrectly</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#running-the-model-1" id="id17">Running the model 1</a></p></li>
<li><p><a class="reference internal" href="#downloading-and-installing-the-spatial-dataset" id="id18">Downloading and installing the spatial dataset</a></p></li>
<li><p><a class="reference internal" href="#changing-the-settings-file" id="id19">Changing the Settings file</a></p></li>
<li><p><a class="reference internal" href="#error-and-exception-handling" id="id20">Error and exception handling</a></p></li>
<li><p><a class="reference internal" href="#running-the-model-2" id="id21">Running the model 2</a></p></li>
<li><p><a class="reference internal" href="#changing-parameters-of-the-model" id="id22">Changing parameters of the model</a></p></li>
<li><p><a class="reference internal" href="#changing-the-output" id="id23">Changing the Output</a></p>
<ul>
<li><p><a class="reference internal" href="#output-variables" id="id24">Output variables</a></p></li>
<li><p><a class="reference internal" href="#daily-monthly-at-the-end-or-average" id="id25">Daily, monthly - at the end or average</a></p></li>
<li><p><a class="reference internal" href="#time-series-as-point-infomation-or-catchment-sum-or-average" id="id26">Time series as point infomation or catchment sum or average</a></p></li>
<li><p><a class="reference internal" href="#most-important-output-variables-a-selection" id="id27">Most important output variables - a selection</a></p></li>
<li><p><a class="reference internal" href="#a-list-of-all-variables" id="id28">A list of all variables</a></p></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
<section id="requirements">
<h2><a class="toc-backref" href="#id4" role="doc-backlink">Requirements</a><a class="headerlink" href="#requirements" title="Permalink to this heading"></a></h2>
<section id="id1">
<h3><a class="toc-backref" href="#id5" role="doc-backlink">Requirements</a><a class="headerlink" href="#id1" title="Permalink to this heading"></a></h3>
<section id="python-version">
<h4><a class="toc-backref" href="#id6" role="doc-backlink">Python version</a><a class="headerlink" href="#python-version" title="Permalink to this heading"></a></h4>
<p>NEW from 2019 on:
Requirements are a 64 bit <a class="reference external" href="https://www.python.org/downloads/release/python-372/">Python 3.7.x version</a></p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>a 32 bit version is not able to handle the data requirements!</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>From 2019 on we are changing to Python37. We do not provide further support for Python 2.7</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>CWatM is tested for Python 3.7, 3.8 and will for sure not work with Python versions lower than 3.6. We recommend using Python 3.7, 3.8</p>
</div>
</section>
<section id="libraries">
<h4><a class="toc-backref" href="#id7" role="doc-backlink">Libraries</a><a class="headerlink" href="#libraries" title="Permalink to this heading"></a></h4>
<p>These external libraries are needed:</p>
<ul class="simple">
<li><p><a class="reference external" href="http://www.numpy.org">Numpy</a></p></li>
<li><p><a class="reference external" href="https://www.scipy.org">Scipy</a></p></li>
<li><p><a class="reference external" href="https://pypi.python.org/pypi/netCDF4">netCDF4</a></p></li>
<li><p><a class="reference external" href="http://www.gdal.org">GDAL</a></p></li>
<li><p><a class="reference external" href="https://www.usgs.gov/software/flopy-python-package-creating-running-and-post-processing-modflow-based-models">Flopy</a></p></li>
</ul>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Installing GDAL via pip causes sometimes problems. We recommend downloading the library from <a class="reference external" href="http://www.lfd.uci.edu/~gohlke/pythonlibs">Unofficial Windows Binaries for Python Extension Packages</a> as GDAL-3.0.4-cp37-cp37m-win_amd64.whl (or a later version depending on your Python version) and installing them as:</p>
<blockquote>
<div><p>pip install C:/Users/XXXXX/Downloads/GDAL-3.0.4-cp37-cp37m-win_amd64.whl</p>
</div></blockquote>
</div>
<p><strong>Windows</strong></p>
<p>The five libraries can be installed with pip or
downloaded at <a class="reference external" href="http://www.lfd.uci.edu/~gohlke/pythonlibs">Unofficial Windows Binaries for Python Extension Packages</a></p>
</section>
<section id="windows-executeable-python-version">
<h4><a class="toc-backref" href="#id8" role="doc-backlink">Windows executeable Python version</a><a class="headerlink" href="#windows-executeable-python-version" title="Permalink to this heading"></a></h4>
<div class="line-block">
<div class="line">The A cwatmexe.zip with all Python libraries and a test case (River Rhine)) is stored on:</div>
<div class="line"><a class="reference external" href="https://github.com/iiasa/CWatM">Source code on Github repository of CWatM</a></div>
<div class="line"><a class="reference external" href="https://github.com/iiasa/CWatM/tree/version1.05/tutorial/CWATM_model">Executable cwatmexe.zip on Github repository of CWatM</a></div>
</div>
</section>
</section>
</section>
<section id="test-the-executable-model-version">
<h2><a class="toc-backref" href="#id9" role="doc-backlink">Test the executable model version</a><a class="headerlink" href="#test-the-executable-model-version" title="Permalink to this heading"></a></h2>
<p><strong>only Windows</strong></p>
<p>If you familiar with Python just go to the next chapter.</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span>cwatm
│-- README.md
│
└-- cwatmexe
│ └- lib
│ └---cwatm.exe
│ └---metaNetcdf.xml
│ └--- libraries etc.
│
└--rhine_basin
│ └---climate_rhine
│ └---cwatm_input_rhine
│ └---init
│ └---output
│ └---run_python_rhine30.bat
│ └---settings_rhine30.ini
│
└-- run_test1.bat
└-- run_test2_rhine30min.bat
└-- settings_rhine_test.ini
└-- tutorial.html
</pre></div>
</div>
<div class="line-block">
<div class="line">Either start cwatm.exe in a DOS box (cmd windows command), or use a batch file e.g. run_test1.bat</div>
</div>
<section id="test-1">
<h3><a class="toc-backref" href="#id10" role="doc-backlink">Test 1</a><a class="headerlink" href="#test-1" title="Permalink to this heading"></a></h3>
<p>In the root directory cwatm</p>
<p>Please try:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">run</span> <span class="n">run_test1</span><span class="o">.</span><span class="n">bat</span> <span class="ow">or</span> <span class="nb">type</span> <span class="o">.</span>\<span class="n">cwatmexe</span>\<span class="n">cwatm</span><span class="o">.</span><span class="n">exe</span>
</pre></div>
</div>
<p>The output should be like See: <a class="reference internal" href="#rst-output1"><span class="std std-ref">Test the Python model version</span></a></p>
</section>
<section id="test-2">
<h3><a class="toc-backref" href="#id11" role="doc-backlink">Test 2</a><a class="headerlink" href="#test-2" title="Permalink to this heading"></a></h3>
<p>Please try:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">run</span> <span class="n">run_test2_rhine30min</span><span class="o">.</span><span class="n">bat</span> <span class="ow">or</span> <span class="nb">type</span> <span class="o">.</span>\<span class="n">cwatmexe</span>\<span class="n">cwatm</span><span class="o">.</span><span class="n">exe</span> <span class="n">settings_rhine30_test</span><span class="o">.</span><span class="n">ini</span> <span class="o">-</span><span class="n">l</span>
</pre></div>
</div>
<p>The output should be like See: <a class="reference internal" href="#rst-output2"><span class="std std-ref">Error and exception handling</span></a></p>
</section>
</section>
<section id="test-the-python-model-version">
<span id="rst-output1"></span><h2><a class="toc-backref" href="#id12" role="doc-backlink">Test the Python model version</a><a class="headerlink" href="#test-the-python-model-version" title="Permalink to this heading"></a></h2>
<p><strong>Windows and Linux</strong> (and maybe Mac, but not tested)</p>
<p>Please try:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o"><</span><span class="n">modelpath</span><span class="o">>/</span><span class="n">run_cwatm</span><span class="o">.</span><span class="n">py</span> <span class="p">(</span><span class="k">for</span> <span class="n">the</span> <span class="n">Python3</span><span class="mf">.7</span> <span class="n">version</span><span class="p">)</span>
<span class="ow">or</span><span class="p">:</span>
<span class="o"><</span><span class="n">modelpath</span><span class="o">>/</span><span class="n">cwatm</span> <span class="p">(</span><span class="k">for</span> <span class="n">the</span> <span class="o">.</span><span class="n">exe</span> <span class="n">version</span><span class="p">)</span>
</pre></div>
</div>
<p>The output should be:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Running</span> <span class="n">under</span> <span class="n">platform</span><span class="p">:</span> <span class="n">Windows</span> <span class="o">**</span><span class="p">(</span><span class="ow">or</span> <span class="n">Linux</span> <span class="n">etc</span><span class="p">)</span><span class="o">**</span>
<span class="n">CWatM</span> <span class="o">-</span> <span class="n">Community</span> <span class="n">Water</span> <span class="n">Model</span>
<span class="n">Authors</span><span class="p">:</span> <span class="o">...</span>
<span class="n">Version</span><span class="p">:</span> <span class="o">...</span>
<span class="n">Date</span><span class="p">:</span> <span class="o">...</span>
<span class="n">Arguments</span> <span class="nb">list</span><span class="p">:</span>
<span class="n">settings</span><span class="o">.</span><span class="n">ini</span> <span class="n">settings</span> <span class="n">file</span>
<span class="o">-</span><span class="n">q</span> <span class="o">--</span><span class="n">quiet</span> <span class="n">output</span> <span class="n">progression</span> <span class="n">given</span> <span class="k">as</span> <span class="o">.</span>
<span class="o">-</span><span class="n">v</span> <span class="o">--</span><span class="n">veryquiet</span> <span class="n">no</span> <span class="n">output</span> <span class="n">progression</span> <span class="ow">is</span> <span class="n">given</span>
<span class="o">-</span><span class="n">l</span> <span class="o">--</span><span class="n">loud</span> <span class="n">output</span> <span class="n">progression</span> <span class="n">given</span> <span class="k">as</span> <span class="n">time</span> <span class="n">st</span>
<span class="o">-</span><span class="n">c</span> <span class="o">--</span><span class="n">check</span> <span class="nb">input</span> <span class="n">maps</span> <span class="ow">and</span> <span class="n">stack</span> <span class="n">maps</span> <span class="n">are</span> <span class="n">check</span>
<span class="o">-</span><span class="n">h</span> <span class="o">--</span><span class="n">noheader</span> <span class="o">.</span><span class="n">tss</span> <span class="n">file</span> <span class="n">have</span> <span class="n">no</span> <span class="n">header</span> <span class="ow">and</span> <span class="n">start</span>
<span class="o">-</span><span class="n">t</span> <span class="o">--</span><span class="n">printtime</span> <span class="n">the</span> <span class="n">computation</span> <span class="n">time</span> <span class="k">for</span> <span class="n">hydrologic</span>
<span class="o">-</span><span class="n">w</span> <span class="o">--</span><span class="n">warranty</span> <span class="n">copyright</span> <span class="ow">and</span> <span class="n">warranty</span> <span class="n">information</span>
</pre></div>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>If python is not set in the environment path, the full path of python has to be used</p>
</div>
<section id="error-because-you-did-not-run-it-with-python">
<h3><a class="toc-backref" href="#id13" role="doc-backlink">Error because you did not run it with Python</a><a class="headerlink" href="#error-because-you-did-not-run-it-with-python" title="Permalink to this heading"></a></h3>
<p>if the model is causing an error with look like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">File</span> <span class="s2">"run_cwatm.py"</span><span class="p">,</span> <span class="n">line</span> <span class="mi">116</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">%-6s</span><span class="s2"> </span><span class="si">%10s</span><span class="s2"> </span><span class="si">%11s</span><span class="se">\n</span><span class="s2">"</span> <span class="o">%</span><span class="p">(</span><span class="s2">"Step"</span><span class="p">,</span><span class="s2">"Date"</span><span class="p">,</span><span class="s2">"Discharge"</span><span class="p">),</span> <span class="n">end</span><span class="o">=</span><span class="s1">' '</span><span class="p">)</span>
<span class="ne">SyntaxError</span><span class="p">:</span> <span class="n">invalid</span> <span class="n">syntax</span>
</pre></div>
</div>
<p>You run the model without the python command in front. Please use: python cwatm.py
(You may have to adjust the path to your python version and to cwatm.py).</p>
</section>
<section id="error-because-python-is-not-added-to-the-path">
<h3><a class="toc-backref" href="#id14" role="doc-backlink">Error because python is not added to the PATH</a><a class="headerlink" href="#error-because-python-is-not-added-to-the-path" title="Permalink to this heading"></a></h3>
<p>If executing python return an error like this</p>
<blockquote>
<div><p>‘python’ is not recognized as an internal or external command</p>
</div></blockquote>
<p>You need either need to add Python to the PATH Environmental Variable or you need to start Python with full path.</p>
<blockquote>
<div><p>c:/path_to_python/python</p>
</div></blockquote>
</section>
<section id="error-because-the-path-has-white-spaces-included">
<h3><a class="toc-backref" href="#id15" role="doc-backlink">Error because the path has white spaces included</a><a class="headerlink" href="#error-because-the-path-has-white-spaces-included" title="Permalink to this heading"></a></h3>
<p>It is also possible to use paths with white spaces or dots. An easy way to avoid this is using relative paths, but is is also possible with absolute paths:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"C:/Python 37/python"</span> <span class="s2">"C:/CWatM Hydrologic.modeling/CWatM/run_cwatm.py"</span> <span class="s2">"C:/CWatM Hydrologic.modeling/settings .rhine30min.ini"</span> <span class="o">-</span><span class="n">l</span>
<span class="n">But</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">settingsfile</span> <span class="n">do</span> <span class="ow">not</span> <span class="n">use</span> <span class="n">apostrophe</span><span class="p">:</span>
<span class="n">PathRoot</span> <span class="o">=</span> <span class="n">C</span><span class="p">:</span><span class="o">/</span><span class="n">CWatM</span> <span class="n">Hydrologic</span><span class="o">.</span><span class="n">modeling</span>
</pre></div>
</div>
</section>
<section id="error-because-the-python-libraries-are-installed-incorrectly">
<h3><a class="toc-backref" href="#id16" role="doc-backlink">Error because the python libraries are installed incorrectly</a><a class="headerlink" href="#error-because-the-python-libraries-are-installed-incorrectly" title="Permalink to this heading"></a></h3>
<p>If the model is causing an error at this stage, please check the python libraries:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span>
<span class="kn">import</span> <span class="nn">numpy</span>
<span class="kn">import</span> <span class="nn">scipy.ndimage</span>
<span class="kn">import</span> <span class="nn">gdal</span>
<span class="kn">import</span> <span class="nn">netCDF4</span>
</pre></div>
</div>
</section>
</section>
<section id="running-the-model-1">
<h2><a class="toc-backref" href="#id17" role="doc-backlink">Running the model 1</a><a class="headerlink" href="#running-the-model-1" title="Permalink to this heading"></a></h2>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The model needs a settings file as an argument. See: <a class="reference internal" href="setup.html#rst-settingdoc"><span class="std std-ref">Settings file</span></a></p>
</div>
<p>python <modelpath>/cwatm.py settingsfile flags</p>
<p>example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">cwatm</span><span class="o">.</span><span class="n">py</span> <span class="n">settings_rhine</span><span class="o">.</span><span class="n">ini</span> <span class="o">-</span><span class="n">l</span>
</pre></div>
</div>
<p>The flag -l show the output on screen as date and discharge</p>
<p>At this point you should receive this eror message:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">========================</span> <span class="n">CWatM</span> <span class="n">FILE</span> <span class="n">ERROR</span> <span class="o">===========================</span>
<span class="n">Cannot</span> <span class="n">find</span> <span class="n">option</span> <span class="n">file</span><span class="p">:</span> <span class="n">d</span><span class="p">:</span><span class="o">/</span><span class="n">work</span><span class="o">/</span><span class="n">CWatM</span><span class="o">/</span><span class="n">source</span><span class="o">/</span><span class="n">metaNetcdf</span><span class="o">.</span><span class="n">xml</span> <span class="n">In</span> <span class="s2">"metaNetcdfFile"</span>
<span class="n">searching</span><span class="p">:</span> <span class="s2">"d:/work/CWatM/source/metaNetcdf.xml"</span>
<span class="n">path</span><span class="p">:</span> <span class="n">d</span><span class="p">:</span><span class="o">/</span><span class="n">work</span><span class="o">/</span><span class="n">CWatM</span><span class="o">/</span><span class="n">source</span> <span class="n">does</span> <span class="ow">not</span> <span class="n">exists</span>
</pre></div>
</div>
</section>
<section id="downloading-and-installing-the-spatial-dataset">
<h2><a class="toc-backref" href="#id18" role="doc-backlink">Downloading and installing the spatial dataset</a><a class="headerlink" href="#downloading-and-installing-the-spatial-dataset" title="Permalink to this heading"></a></h2>
<p>The spatial dataset contains:</p>
<ul class="simple">
<li><p>static data ie. data that does not change over time (a model assumption) e.g. soil data</p></li>
<li><p>time dependend (inter annual) data that change periodical during a year e.g. crop coefficient of vegetation</p></li>
<li><p>time dependend (intra annual) data that change by month or year e.g. fraction of landcover</p></li>
</ul>
<p>These data are stored as global dataset:</p>
<ul class="simple">
<li><p>cwat_input.zip for the 30’ global version</p></li>
<li><p>cwat_input5min.zip for the 5’ global version</p></li>
</ul>
<p>As climate data different forcings can be used e.g:</p>
<ul class="simple">
<li><p>PGMFD v.2 (Princeton), GSWP3, etc.</p></li>
<li><p>precipitation from e.g. MSWEP <a class="reference external" href="http://www.gloh2o.org/">http://www.gloh2o.org/</a></p></li>
<li><p>WATCH+WFDEI <a class="reference external" href="https://www.isimip.org/gettingstarted/details/5/">https://www.isimip.org/gettingstarted/details/5/</a></p></li>
</ul>
<p>and as projection e.g.:</p>
<ul class="simple">
<li><p>ISI-MIP dataset <a class="reference external" href="https://www.isimip.org/gettingstarted/#input-data-bias-correction">https://www.isimip.org/gettingstarted/#input-data-bias-correction</a></p></li>
</ul>
<div class="line-block">
<div class="line">For the tutorial we cut out Rhine basin and included the WATCH+WFDEI precipitation, average temperature and the calculated potential evaporation .</div>
<div class="line">A 30’ and a 5’ version can be found on FTP in rhine/climate</div>
</div>
<div class="line-block">
<div class="line">Reference:</div>
<div class="line">Weedon, G.P., S.S. Gomes, P.P. Viterbo, W.J. Shuttleworth, E.E. Blyth, H.H. Österle, J.C. Adam, N.N. Bellouin, O.O. Boucher, and M.M. Best, 2011: Creation of the WATCH Forcing Data and Its Use to Assess Global and Regional Reference Crop Evaporation over Land during the Twentieth Century. J. Hydrometeor., 12, 823–848, doi: 10.1175/2011JHM1369.1</div>
<div class="line">Weedon, G. P., G. Balsamo, N. Bellouin, S. Gomes, M. J. Best, and P. Viterbo (2014), The WFDEI meteorological forcing data set: WATCH Forcing Data methodology applied to ERA-Interim reanalysis data, Water Resour. Res., 50, 7505–7514, doi:10.1002/2014WR015638.</div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<div class="line-block">
<div class="line">Please copy and unpack the spatial dataset (either 30’ or 5’)in a folder</div>
<div class="line">Please copy the the climate dataset 30min_meteo_rhine.zip or 5min_meteo_rhine.zip in a seperate folder</div>
<div class="line">Please create a folder called output</div>
</div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<div class="line-block">
<div class="line">For testing purpose there is a file rhine_basin.zip on GitHub</div>
<div class="line">it has all the necessary data to run the River Rhine on 30 arcmin from 1990-2010</div>
</div>
</div>
</section>
<section id="changing-the-settings-file">
<h2><a class="toc-backref" href="#id19" role="doc-backlink">Changing the Settings file</a><a class="headerlink" href="#changing-the-settings-file" title="Permalink to this heading"></a></h2>
<p>to run the model the pathes to data have to be set correctly:
The information of pathes are stored in the settings file around line 80-100</p>
<p>[FILE_PATHS]:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PathRoot = E:/
PathOut = $(PathRoot)/output
PathMaps = E:/cwatm_input
PathMeteo = E:/climate
#--------------------------------------
[NETCDF_ATTRIBUTES]
institution = IIASA
title = Global Water Model - WATCH WDFEI
metaNetcdfFile = $(FILE_PATHS:PathRoot)/CWatM/source/metaNetcdf.xml
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Please change the pathes according to your file system</p>
</div>
</section>
<section id="error-and-exception-handling">
<span id="rst-output2"></span><h2><a class="toc-backref" href="#id20" role="doc-backlink">Error and exception handling</a><a class="headerlink" href="#error-and-exception-handling" title="Permalink to this heading"></a></h2>
<p>We try to make our program behave properly when encountering unexpected conditions. Therefore we caption a number of possible wrong inputs.</p>
<p>If you get an output with an error number please look at <a class="reference internal" href="errorHandling.html#rst-error"><span class="std std-ref">Error handling</span></a></p>
</section>
<section id="running-the-model-2">
<h2><a class="toc-backref" href="#id21" role="doc-backlink">Running the model 2</a><a class="headerlink" href="#running-the-model-2" title="Permalink to this heading"></a></h2>
<p>If you type now:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">cwatm</span><span class="o">.</span><span class="n">py</span> <span class="n">settings_rhine</span><span class="o">.</span><span class="n">ini</span> <span class="o">-</span><span class="n">l</span>
</pre></div>
</div>
<p>You should see:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">E</span><span class="p">:</span>\<span class="n">CWatM_rhine</span>\<span class="n">source</span><span class="o">></span><span class="n">python</span> <span class="n">cwatm</span><span class="o">.</span><span class="n">py</span> <span class="n">settings_rhine30min</span><span class="o">.</span><span class="n">ini</span> <span class="o">-</span><span class="n">l</span>
<span class="n">CWatM</span> <span class="o">-</span> <span class="n">Community</span> <span class="n">Water</span> <span class="n">Model</span> <span class="n">Version</span><span class="p">:</span> <span class="mf">0.991</span> <span class="n">Date</span><span class="p">:</span> <span class="mi">16</span><span class="o">/</span><span class="mi">09</span><span class="o">/</span><span class="mi">2017</span>
<span class="n">International</span> <span class="n">Institute</span> <span class="n">of</span> <span class="n">Applied</span> <span class="n">Systems</span> <span class="n">Analysis</span> <span class="p">(</span><span class="n">IIASA</span><span class="p">)</span>
<span class="n">Running</span> <span class="n">under</span> <span class="n">platform</span><span class="p">:</span> <span class="n">Windows</span>
<span class="o">-----------------------------------------------------------</span>
<span class="n">CWatM</span> <span class="n">Simulation</span> <span class="n">Information</span> <span class="ow">and</span> <span class="n">Setting</span>
<span class="n">The</span> <span class="n">simulation</span> <span class="n">output</span> <span class="k">as</span> <span class="n">specified</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">settings</span> <span class="n">file</span><span class="p">:</span> <span class="n">settings_rhine30min</span><span class="o">.</span><span class="n">ini</span>
<span class="n">can</span> <span class="n">be</span> <span class="n">found</span> <span class="ow">in</span> <span class="n">E</span><span class="p">:</span><span class="o">/</span><span class="n">CWatM_rhine</span><span class="o">/</span><span class="n">output</span>
<span class="n">Step</span> <span class="n">Date</span> <span class="n">Discharge</span>
<span class="mi">1</span> <span class="mi">01</span><span class="o">/</span><span class="mi">01</span><span class="o">/</span><span class="mi">1961</span> <span class="mf">4.20</span>
<span class="mi">2</span> <span class="mi">02</span><span class="o">/</span><span class="mi">01</span><span class="o">/</span><span class="mi">1961</span> <span class="mf">4.23</span>
<span class="o">...</span>
</pre></div>
</div>
<p>If you don’t see this. Something went wrong and you might see this instead:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>E:\CWatM_rhine\source>python cwatm.py settings_rhine30min.ini -l
CWatM - Community Water Model Version: 0.991 Date: 16/09/2017
International Institute of Applied Systems Analysis (IIASA)
Running under platform: Windows
-----------------------------------------------------------
ERROR 4: `E:/CWatM_rhine/cwatm_input/routing/ldd.map' does not exist in the file system,
and is not recognised as a supported dataset name.
management_modules.messages.CWatMFileError:
======================== CWatM FILE ERROR ===========================
In "Ldd"
searching: "E:/CWatM_rhine/cwatm_input/routing/ldd.map"
path: E:/CWatM_rhine/cwatm_input/routing does not exists
</pre></div>
</div>
<div class="line-block">
<div class="line">The model tries to help you on finding the error.</div>
<div class="line">In this case it is looking for the river network map ldd.map or ldd.nc or ldd.tif</div>
<div class="line">but it cannot find the file and not even the path to the file.</div>
</div>
<p>Here you might change:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[FILE_PATHS]
PathRoot = E:/CWatM_rhine
PathMaps = $(PathRoot)/cwatm_input
</pre></div>
</div>
<p>or:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[TOPOP]
# local drain direction map (1-9)
Ldd = $(FILE_PATHS:PathMaps)/routing/ldd.map
</pre></div>
</div>
<p>But many other error can occure too! Have fun.</p>
<p>P.s. some error we captured and we give a hint. Please look at <a class="reference internal" href="errorHandling.html#rst-error"><span class="std std-ref">Error handling</span></a></p>
</section>
<section id="changing-parameters-of-the-model">
<h2><a class="toc-backref" href="#id22" role="doc-backlink">Changing parameters of the model</a><a class="headerlink" href="#changing-parameters-of-the-model" title="Permalink to this heading"></a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>An overview of possibilities is given in see <a class="reference internal" href="setup.html#rst-settingdoc"><span class="std std-ref">Settings file</span></a></p>
</div>
</section>
<section id="changing-the-output">
<h2><a class="toc-backref" href="#id23" role="doc-backlink">Changing the Output</a><a class="headerlink" href="#changing-the-output" title="Permalink to this heading"></a></h2>
<section id="output-variables">
<h3><a class="toc-backref" href="#id24" role="doc-backlink">Output variables</a><a class="headerlink" href="#output-variables" title="Permalink to this heading"></a></h3>
<p>Output can be every global defined variable in the model
Variable are e.g. Precipitation, runoff, baseflow</p>
<p>but also not so common variables as:</p>
<ul class="simple">
<li><p>reservoirStorage (amount of water in the reservoirs in [m3])</p></li>
<li><p>nonIrrReturnFlowFraction (returnflow from domenstic and industrial water use [m3])</p></li>
<li><p>actualET[1] (actual evapotranspiration from grassland [m/day])</p></li>
<li><p>…</p></li>
</ul>
</section>
<section id="daily-monthly-at-the-end-or-average">
<h3><a class="toc-backref" href="#id25" role="doc-backlink">Daily, monthly - at the end or average</a><a class="headerlink" href="#daily-monthly-at-the-end-or-average" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p>per day</p></li>
<li><p>total month, average month, end of month</p></li>
<li><p>total year, average year, end of year</p></li>
<li><p>total average, total at the end</p></li>
</ul>
<p>available prefixes are: ‘daily’, ‘monthtot’,’monthavg’, ‘monthend’,’annualtot’,’annualavg’,’annualend’,’totaltot’,’totalavg’</p>
<p>for example</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[OUTPUT]
# OUTPUT maps and timeseries
OUT_Dir = $(FILE_PATHS:PathOut)
OUT_MAP_Daily = discharge, runoff
OUT_MAP_MonthAvg = Precipitation
OUT_MAP_TotalEnd = lakeStorage
OUT_MAP_TotalAvg = Tavg
OUT_TSS_Daily = discharge
OUT_TSS_AnnualAvg = Precipitation
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>For each variable the meta data information can be defined in <a class="reference internal" href="setup.html#rst-metadata"><span class="std std-ref">Output Meta NetCDF information</span></a></p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>For information how to adjust the output in the settings file see <a class="reference internal" href="setup.html#rst-outputone"><span class="std std-ref">Output</span></a></p>
</div>
</section>
<section id="time-series-as-point-infomation-or-catchment-sum-or-average">
<h3><a class="toc-backref" href="#id26" role="doc-backlink">Time series as point infomation or catchment sum or average</a><a class="headerlink" href="#time-series-as-point-infomation-or-catchment-sum-or-average" title="Permalink to this heading"></a></h3>
<p>As standard time series can include values of the specific cell as defined in the settings file as <em>Gauges</em>
But time series can also show the area sum or area average of the upstream catchment from the specific cell</p>
<p>for example</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">OUTPUT</span><span class="p">]</span>
<span class="c1"># OUTPUT maps and timeseries</span>
<span class="c1"># Standard values of a specific cell</span>
<span class="n">OUT_TSS_Daily</span> <span class="o">=</span> <span class="n">discharge</span>
<span class="n">OUT_TSS_AnnualAvg</span> <span class="o">=</span> <span class="n">Precipitation</span>
<span class="c1"># Area sum of upstream catchment</span>
<span class="n">OUT_TSS_AreaSum_MonthTot</span> <span class="o">=</span> <span class="n">Precipitation</span><span class="p">,</span> <span class="n">runoff</span>
<span class="c1"># Area sum of upstream catchment</span>
<span class="n">OUT_TSS_AreaAvg_MonthTot</span> <span class="o">=</span> <span class="n">Precipitation</span>
</pre></div>
</div>
</section>
<section id="most-important-output-variables-a-selection">
<h3><a class="toc-backref" href="#id27" role="doc-backlink">Most important output variables - a selection</a><a class="headerlink" href="#most-important-output-variables-a-selection" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#Variable name : Description</span>
<span class="n">discharge</span> <span class="p">:</span> <span class="n">river</span> <span class="n">discharge</span>
<span class="n">runoff</span> <span class="p">:</span> <span class="n">runoff</span>
<span class="n">Precipitation</span> <span class="p">:</span> <span class="n">rainfall</span> <span class="o">+</span> <span class="n">snow</span>
<span class="n">Tavg</span> <span class="p">:</span> <span class="n">average</span> <span class="n">temperature</span>
<span class="n">ETRef</span><span class="p">:</span> <span class="n">potential</span> <span class="p">:</span> <span class="n">evaporation</span> <span class="kn">from</span> <span class="nn">reference</span> <span class="n">soil</span>
<span class="n">sum_gwRecharge</span> <span class="p">:</span> <span class="n">total</span> <span class="n">groundwater</span> <span class="n">recharge</span>
<span class="n">totalET</span> <span class="p">:</span> <span class="n">total</span> <span class="n">actual</span> <span class="n">evapotranspiration</span>
<span class="n">baseflow</span> <span class="p">:</span> <span class="n">baseflow</span> <span class="kn">from</span> <span class="nn">groundwater</span>
<span class="o">...</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">continued</span><span class="p">)</span>
</pre></div>
</div>
</section>
<section id="a-list-of-all-variables">
<h3><a class="toc-backref" href="#id28" role="doc-backlink">A list of all variables</a><a class="headerlink" href="#a-list-of-all-variables" title="Permalink to this heading"></a></h3>
<p>We started a list of possible output variables. Please note that this list is under construction. We still need to fill in all descriptions and all units.
You find this list at <a class="reference internal" href="listVariables.html#rst-variables"><span class="std std-ref">List of output variables</span></a></p>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="setup.html" class="btn btn-neutral float-left" title="4. Setup of the model" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="errorHandling.html" class="btn btn-neutral float-right" title="6. Error handling" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2021, IIASA Water Security.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>