-
Notifications
You must be signed in to change notification settings - Fork 7
/
fgmax.html
573 lines (559 loc) · 33.9 KB
/
fgmax.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Fixed grid monitoring (fgmax) — Clawpack 5.11.x documentation</title>
<link rel="stylesheet" href="_static/base.css" type="text/css" />
<link rel="stylesheet" href="_static/layout.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/flasky.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="_static/clawicon.ico"/>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Nearshore interpolation" href="nearshore_interp.html" />
<link rel="prev" title="Fixed grid output (fgout)" href="fgout.html" />
</head><body>
<div id="main-wrapper" class="sphinx">
<div id="header-wrapper">
<section id="header">
<!-- <h1><a href="http://clawpack.org/">Clawpack</a></h1> -->
<h1><a href="http://clawpack.org/">Clawpack-5</a></h1>
<nav>
<ul>
<li>
<a href="contents.html">Docs</a>
</li>
<li>
<a href="installing.html">Install</a>
</li>
<li>
<a class="" href="http://clawpack.org/gallery/index.html">Gallery</a>
</li>
<li>
<a href="about.html">Citation</a>
</li>
<li>
<a class="active" href="http://github.com/clawpack">GitHub</a>
</li>
<li>
<a class="" href="community.html">Community</a>
</li>
<li>
<a class="" href="developers.html">Contribute</a>
</li>
</ul>
</nav>
</section>
<div class="decoration"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="nearshore_interp.html" title="Nearshore interpolation"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="fgout.html" title="Fixed grid output (fgout)"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="contents.html">Clawpack 5.11.x documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="geoclaw.html" accesskey="U">GeoClaw Description and Detailed Contents</a> »</li>
<li class="nav-item nav-item-this"><a href="">Fixed grid monitoring (fgmax)</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="fixed-grid-monitoring-fgmax">
<span id="fgmax"></span><h1>Fixed grid monitoring (fgmax)<a class="headerlink" href="#fixed-grid-monitoring-fgmax" title="Permalink to this heading">¶</a></h1>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This feature has been modified and this documentation describes
the version introduced in 5.7.0.</p>
</div>
<p>See also:</p>
<blockquote>
<div><ul class="simple">
<li><p><a class="reference internal" href="fgmax_tools_module.html#fgmax-tools-module"><span class="std std-ref">fgmax_tools module for working with fgmax grids</span></a></p></li>
<li><p><a class="reference internal" href="setrun_geoclaw.html#setrun-fgmax"><span class="std std-ref">Fixed grid maximum monitoring / arrival times</span></a> - For adding fgmax data to <cite>setrun.py</cite></p></li>
<li><p><a class="reference internal" href="#fgmax-examples"><span class="std std-ref">fgmax examples</span></a> - Links to some examples</p></li>
</ul>
</div></blockquote>
<p>GeoClaw has the capability to monitor the maximum value of
certain quantities on a specified fixed
“fgmax grid” by interpolating from the AMR grids active at each time step,
or at specified time increments.
This is useful in particular to record the maximum flow depth observed at
each point over the course of a computation, or the maximum flow velocity,
momentum, or momentum flux. These quantities are often of interest in
hazard modeling.</p>
<p>It is also possible to record the <em>arrival time</em> of a flow or wave at each
point on the grid.</p>
<p>The “grids” do not have to be rectangular grids aligned with the
coordinate directions, but can consist of an arbitrary list of points
that could also be points along a one-dimensional transect or points
following a coastline, for example. It is also possible to specify logically
rectangular grids of points covering an arbitrary quadrilateral.</p>
<p><strong>New in v5.7.0:</strong> One can also specify a set of fgmax point by providing a
data file in the style of a topography DEM file with <cite>topo_type==3</cite>, but in
which the values provided are either 0 or 1 instead of topography values, with
1 indicating that a point should be used as an fgmax point, 0 indicating it
should not be used. This is particularly convenient if you want to select
fgmax points that are a subset of points on a DEM. This option is described
more below under <cite>point_style==4</cite>.</p>
<p><strong>New in v5.7.0:</strong> Most fgmax information is now most easily set
in <cite>setrun.py</cite> and is written out to the file <cite>fgmax_grids.data</cite>
when this script is executed, e.g. by “<cite>make data</cite>”. The information
required is described below. See also <a class="reference internal" href="setrun_geoclaw.html#setrun-fgmax"><span class="std std-ref">Fixed grid maximum monitoring / arrival times</span></a>.</p>
<p>This is an improved version of the algorithms used in much earlier versions of
GeoClaw, and now
correctly interpolates when a grid point lies near the junction of two
grid patches, which was not always handled properly before.
The earlier version can still be used for outputing results at intermediate
times on a fixed grid (see <a class="reference internal" href="fgout.html#fgout"><span class="std std-ref">Fixed grid output (fgout)</span></a>), but is not recommended for the purpose
of monitoring maxima or arrival times.</p>
<section id="input-file-specification">
<span id="fgmax-input"></span><h2>Input file specification<a class="headerlink" href="#input-file-specification" title="Permalink to this heading">¶</a></h2>
<p><strong>(Changed in Clawpack 5.7.0.)</strong></p>
<p>The GeoClaw Fortran code reads in one or more files that specify grid(s) for
monitoring values during the computation.</p>
<p>The fgmax grid(s) are specified to GeoClaw in
<cite>setrun.py</cite> by setting <cite>rundata.fgmax_data.fgmax_grids</cite>
to be a list of objects of class <cite>fgmax_tools.FGmaxGrid</cite>.
The order the files appear in this list determines the number assigned to
this grid (starting with 1) that may be needed for processing or plotting
the results. The output appears in files such as <cite>_output/fgmax0001.txt</cite>.</p>
<p><strong>New in v5.7.0:</strong> You can now assign numbers to each fgmax gauge
using the <cite>fgno</cite> attribute, described below, rather than being numbered
sequentially by order specified in the <cite>setrun.py</cite> file.</p>
<p>Currently at most 50 fgmax grids are allowed by default. If you need more,
you can adjust the parameter <cite>FG_MAXNUM_FGRIDS</cite> in
<cite>$CLAW/geoclaw/src/2d/shallow/fgmax_module.f90</cite> and the do <cite>make new</cite> to
recomile everything that depends on this module.</p>
<p>Each <cite>fgmax_tools.FGmaxGrid</cite> object (<cite>fg</cite>, for example)
describing a grid of points has the following attributes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fg</span><span class="o">.</span><span class="n">fgno</span>
<span class="n">fg</span><span class="o">.</span><span class="n">tstart_max</span>
<span class="n">fg</span><span class="o">.</span><span class="n">tend_max</span>
<span class="n">fg</span><span class="o">.</span><span class="n">dt_check</span>
<span class="n">fg</span><span class="o">.</span><span class="n">min_level_check</span>
<span class="n">fg</span><span class="o">.</span><span class="n">arrival_tol</span>
<span class="n">fg</span><span class="o">.</span><span class="n">interp_method</span>
<span class="n">fg</span><span class="o">.</span><span class="n">point_style</span>
</pre></div>
</div>
<p>These are explained further below.</p>
<p>Additional attributes depend on the value of <cite>fg.point_style</cite>.</p>
<section id="different-point-styles">
<h3>Different point styles<a class="headerlink" href="#different-point-styles" title="Permalink to this heading">¶</a></h3>
<p><strong>If `fg.point_style == 0`,</strong> an arbitrary collection of <cite>(x,y)</cite> points is allowed.
In this case you can either set</p>
<blockquote>
<div><p>fg.npts</p>
</div></blockquote>
<p>to the number of points and</p>
<blockquote>
<div><p>fg.X
fg.Y</p>
</div></blockquote>
<p>to lists (or numpy arrays) of the coordinates, or you can set</p>
<blockquote>
<div><p>fg.npts = 0</p>
</div></blockquote>
<p>and set</p>
<blockquote>
<div><p>fg.xy_file</p>
</div></blockquote>
<p>to a string with the path to a file of the form:</p>
<blockquote>
<div><p>npts # number of points
x1 y1 # first point
x2 y2 # second point
… # etc.</p>
</div></blockquote>
<p>These points need not lie on a regular grid and can be specified in any order.</p>
<p><strong>If `point_style == 1`,</strong> a 1-dimensional transect of points is specified by
the attributes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fg</span><span class="o">.</span><span class="n">npts</span> <span class="c1"># number of points to generate</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y1</span> <span class="c1"># first point</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y2</span> <span class="c1"># last point</span>
</pre></div>
</div>
<p><strong>If `point_style == 2`,</strong> a 2-dimensional cartesian of points is specified by
the attributes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fg</span><span class="o">.</span><span class="n">nx</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">ny</span> <span class="c1"># number of points in x and y (nx by ny grid)</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y1</span> <span class="c1"># lower left corner of cartesian grid</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y2</span> <span class="c1"># upper right corner of cartesian grid</span>
</pre></div>
</div>
<p><strong>If `point_style == 3`,</strong> a 2-dimensional logically rectangular array
of points is specified by the attributes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">fg</span><span class="o">.</span><span class="n">n12</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">n23</span> <span class="c1"># number of points along adjacent edges (see below)</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y1</span> <span class="c1"># first corner of grid</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y2</span> <span class="c1"># second corner of grid</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x3</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y3</span> <span class="c1"># third corner of grid</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x4</span><span class="p">,</span> <span class="n">fg</span><span class="o">.</span><span class="n">y4</span> <span class="c1"># fourth corner of grid</span>
</pre></div>
</div>
<p>The corners should define a convex quadrilateral (ordered clockwise around the
perimeter). An array of points will be defined as the intersection points of
two sets of lines. The first set is obtained by connecting <cite>n12</cite>
equally spaced points on the side from <cite>(x1,y1)</cite> to <cite>(x2,y2)</cite> with the same
number of points equally spaced on the side from <cite>(x3,y3)</cite> to <cite>(x4,y4)</cite>.
The second set of lines is obtained by connecting <cite>n23</cite> equally spaced
points on the side from <cite>(x2,y2)</cite> to <cite>(x3,y3)</cite> with the same
number of points equally spaced on the side from <cite>(x4,y4)</cite> to <cite>(x1,y1)</cite></p>
<p><strong>If `point_style == 4`,</strong> a file is expected that has the form of a
topofile with <cite>topo_type == 3</cite> as described in <a class="reference internal" href="topo.html#topo"><span class="std std-ref">Topography data</span></a>.
This file has a header that describes a uniform 2d grid of points, followed
by one line for each row of the grid (moving from north to south).
Unlike a standard topofile, the values are not topography elevations,
however, but are either 1 or 0, with the value 1 indicating that this point
should be used as an fgmax point.</p>
<p>Other tools are available to construct such a file by preprocessing a
topography DEM and selecting only the points that satisfy certain criteria.
For example, if we only want to capture onshore inundation depths and it is
known that regions above a certain elevation will always stay dry, then we
may want to select only points that are onshore and below this elevation.
See <a class="reference internal" href="marching_front.html#marching-front"><span class="std std-ref">Marching Front algorithm</span></a> for more details and examples.</p>
</section>
<section id="other-attributes">
<h3>Other attributes<a class="headerlink" href="#other-attributes" title="Permalink to this heading">¶</a></h3>
<p>The standard required attributes for any <cite>fgmax_tools.FGmaxGrid</cite> object are:</p>
<blockquote>
<div><ul>
<li><p><cite>fgno</cite> : int</p>
<p>The number of this fgmax grid, should be a positive integer with at most
4 digits since the output file will then have the form <cite>fgmax0001.txt</cite>,
for example, if <cite>fgno = 1</cite>. If these are not specified then they will
be numbered sequentially based on the order they are specified
in the <cite>fgmax_grids</cite> list.</p>
</li>
<li><p><cite>tstart_max</cite> : float</p>
<p>Starting time to monitor maximum. Often we only want to monitor on the
finest grids around the location of interest, and only after waves arrive,
and this can be chosen correspondingly.</p>
</li>
<li><p><cite>tend_max</cite> : float</p>
<p>Ending time to monitor maximum. Set to e.g. <cite>1e9</cite> to monitor until end
of simulation</p>
</li>
<li><p><cite>dt_check</cite> : float</p>
<p>Time increment for monitoring maximum and arrivals.
Interpolate to fixed grid and
update values only if the time since the last updating exceeds this time
increment. Set to 0 to monitor every time step.</p>
</li>
<li><p><cite>min_level_check</cite> : integer</p>
<p>Minimum AMR level to check for updating the maximum value observed and
the arrival time.
Care must be taken in selecting this value since the maximum observed
when interpolating to a point from a coarse AMR level may be much larger
than the value that would be seen on a fine grid that better resolves the
topography at this point. Often AMR “regions” are used to specify that a
fine grid at some level <cite>L</cite> should always be used in the region of
interest over the time period from <cite>start_max</cite> to <cite>tend_max</cite>, and then
it is natural to set <cite>min_level_check</cite> to <cite>L</cite>.</p>
<p>But also note that if we monitor over multiple levels then we also keep
track of what level the current maximum was computed on. If the level
at this point is greater than the level used for the current maximum
(because new finer grids were introduced since the last monitor time)
then the old maximum is discarded and the current value as used as to
reinitialize the maximum at this point.</p>
</li>
<li><p><cite>arrival_tol</cite> : float</p>
<p>The time reported as the “arrival time” is the first time the value
of the surface elevation is greater than <cite>sea_level</cite> + <cite>arrival_tol</cite>.</p>
<p>Note that this captures the first positive wave but doesn’t capture
the time of arrival of the first wave if it is a leading depression
rather than a positive wave.</p>
</li>
<li><p><cite>interp_method</cite> : int</p>
<p>The method to be used to interpolate from finite volume cell averages
in GeoClaw to pointwise values at the fgmax points.</p>
<p>The default is 0, meaning we take the value directly from the cell
average in the grid cell containing the fgmax point (zero-order piecewise
constant interpolation).</p>
<p>Setting to 1 will instead use bilinear interpolation between 4 cell
centers. This is not recommended since it can give spurious results near
the margins of the flow. See below, <a class="reference internal" href="#fgmax-interp"><span class="std std-ref">Choice of interpolation procedure</span></a>.</p>
</li>
</ul>
</div></blockquote>
</section>
</section>
<section id="values-to-monitor">
<span id="fgmax-values"></span><h2>Values to monitor<a class="headerlink" href="#values-to-monitor" title="Permalink to this heading">¶</a></h2>
<p>The values to be monitored are specified by the subroutine <cite>fgmax_values</cite>.
The default subroutine found in the library
<cite>$CLAW/geoclaw/src/2d/shallow/fgmax_values.f90</cite>
is now set up to monitor the
depth <cite>h</cite> (rather than the value <cite>eta_tilde</cite> used in Version 5.1)
and optionally will also monitor the speed <span class="math notranslate nohighlight">\(s = \sqrt{u^2 + v^2}\)</span>
and three other quantities (the momentum <span class="math notranslate nohighlight">\(hs\)</span>,
the momentum flux <span class="math notranslate nohighlight">\(hs^2\)</span>, and <span class="math notranslate nohighlight">\(-h\)</span>, which is useful to monitor
the minimum depth at each point, e.g. in a harbor where ships may be grounded).</p>
<p>The values monitored by the default routine described above is determined
by the value of the <cite>fgmax_module</cite> variable <cite>FG_NUM_VAL</cite>, which can be set
to 1, 2, or 5. This value is read in from the data file <cite>fgmax_grids.data</cite>
and can be set by specifying the value of
<cite>rundata.fgmax_data.num_fgmax_val</cite> in <cite>setrun.py</cite>.</p>
</section>
<section id="choice-of-interpolation-procedure">
<span id="fgmax-interp"></span><h2>Choice of interpolation procedure<a class="headerlink" href="#choice-of-interpolation-procedure" title="Permalink to this heading">¶</a></h2>
<p>Before v5.7.0, the choice of interpolation procedure was governed by use of
the library routine <cite>geoclaw/src/2d/shallow/fgmax_interpolate.f90</cite> (for
bilinear interpolation) or <cite>geoclaw/src/2d/shallow/fgmax_interpolate0.f90</cite> (for
constant interpolation).</p>
<p><strong>Starting in v5.7.0,</strong> there is a single library routine
<cite>geoclaw/src/2d/shallow/fgmax_interp.f90</cite> and the choice is controlled by
the <cite>fg.interp_method</cite> parameter described above.</p>
<p>Setting <cite>fg.interp_method = 0</cite> is recommended since
interpolating the fluid depth and the topography
separately and then computing the surface elevation by adding these
may give unrealistic high values. See <a class="reference internal" href="nearshore_interp.html#nearshore-interp"><span class="std std-ref">Nearshore interpolation</span></a>.</p>
</section>
<section id="a-simple-example">
<span id="fgmax-example"></span><h2>A simple example<a class="headerlink" href="#a-simple-example" title="Permalink to this heading">¶</a></h2>
<p>This is taken from
<cite>$CLAW/geoclaw/examples/tsunami/radial-ocean-island-fgmax/setrun.py</cite>, where
other point styles are also illustrated:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">clawpack.geoclaw</span> <span class="kn">import</span> <span class="n">fgmax_tools</span>
<span class="c1"># Points on a uniform 2d grid:</span>
<span class="n">fg</span> <span class="o">=</span> <span class="n">fgmax_tools</span><span class="o">.</span><span class="n">FGmaxGrid</span><span class="p">()</span>
<span class="n">fg</span><span class="o">.</span><span class="n">point_style</span> <span class="o">=</span> <span class="mi">2</span> <span class="c1"># uniform rectangular x-y grid</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="mf">14.25</span>
<span class="n">fg</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="mf">14.65</span>
<span class="n">fg</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="mf">50.10</span>
<span class="n">fg</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="mf">50.35</span>
<span class="n">fg</span><span class="o">.</span><span class="n">dx</span> <span class="o">=</span> <span class="mi">15</span><span class="o">/</span> <span class="mf">3600.</span> <span class="c1"># desired resolution of fgmax grid</span>
<span class="n">fg</span><span class="o">.</span><span class="n">min_level_check</span> <span class="o">=</span> <span class="n">amrdata</span><span class="o">.</span><span class="n">amr_levels_max</span> <span class="c1"># which levels to monitor max on</span>
<span class="n">fg</span><span class="o">.</span><span class="n">tstart_max</span> <span class="o">=</span> <span class="mf">8000.</span> <span class="c1"># just before wave arrives</span>
<span class="n">fg</span><span class="o">.</span><span class="n">tend_max</span> <span class="o">=</span> <span class="mf">1.e10</span> <span class="c1"># when to stop monitoring max values</span>
<span class="n">fg</span><span class="o">.</span><span class="n">dt_check</span> <span class="o">=</span> <span class="mf">20.</span> <span class="c1"># how often to update max values</span>
<span class="n">fg</span><span class="o">.</span><span class="n">interp_method</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1"># 0 ==> pw const in cells, recommended</span>
<span class="n">rundata</span><span class="o">.</span><span class="n">fgmax_data</span><span class="o">.</span><span class="n">fgmax_grids</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">fg</span><span class="p">)</span> <span class="c1"># written to fgmax_grids.data</span>
</pre></div>
</div>
</section>
<section id="processing-and-plotting-fgmax-output">
<span id="fgmax-processing"></span><h2>Processing and plotting fgmax output<a class="headerlink" href="#processing-and-plotting-fgmax-output" title="Permalink to this heading">¶</a></h2>
<p>After GeoClaw has run, the output directory should contain
files of this form for each fgmax grid:</p>
<blockquote>
<div><ul class="simple">
<li><p><cite>fgmax0001.txt</cite></p></li>
</ul>
</div></blockquote>
<p><strong>Note:</strong> This file format is new in Version 5.7.0. Previously two files
such as <cite>fort.FG1.valuemax</cite> and <cite>fort.FG1.aux1</cite> were created to each
fgmax grid. Now the topo value at each grid point is included along with
the max values in the single file.</p>
<p>If more than one fgmax grid was specified by <cite>rundata.fgmax_data.fgmax_grids</cite>
then there will be similar files <cite>fgmax0002.txt</cite>, etc.
They will be numbered in the order they appear in the list of input files in
<cite>setrun.py</cite> unless you explicitly set <cite>fg.fgno</cite> in which case these numbers
will be used.</p>
<p>These files are most easily dealt with using <a class="reference internal" href="fgmax_tools_module.html#fgmax-tools-module"><span class="std std-ref">fgmax_tools module for working with fgmax grids</span></a> by
defining an object of class <cite>fgmax_tools.FGmaxGrid</cite> and using the
class function <cite>read_output</cite> to read the output.</p>
<p>For examples, see <a class="reference internal" href="#fgmax-examples"><span class="std std-ref">fgmax examples</span></a>.</p>
</section>
<section id="format-of-the-output-files">
<span id="fgmax-output-format"></span><h2>Format of the output files<a class="headerlink" href="#format-of-the-output-files" title="Permalink to this heading">¶</a></h2>
<p>The paragraphs below describe in more detail the structure of the output files
for users who need to process them differently.</p>
<p>If <cite>point_style == 0</cite> for a grid then the points will be listed in the same
order as specified in the input file. For other values of <cite>point_style</cite>
(1-dimensional transects or 2-dimensional arrays) the values will be output in
a natural order.</p>
<p>In all cases the first two columns of each output file are
the longitude and latitude of the point.</p>
<p>The columns of <cite>fgmax0001.txt</cite> contain the following values, where N refers
to the number of quantities of interest being monitored, as specified
by <cite>rundata.fgmax_data.num_fgmax_val</cite> and described further below:</p>
<blockquote>
<div><ul class="simple">
<li><p>Column 1: longitude</p></li>
<li><p>Column 2: latitude</p></li>
<li><p>Column 3: AMR level</p></li>
<li><p>Column 4: topo value B</p></li>
<li><p>Columns 5 to 5+N: maximum value recorded of each QoI</p></li>
<li><p>Columns 6+N to 5+2N: time max value was recorded</p></li>
<li><p>Column 6+2N: arrival time</p></li>
</ul>
</div></blockquote>
<p>The AMR level is the level of finest level grids covering this fgmax point
at the time the maximum was recorded.</p>
<p>The “topo value B” is the value of the GeoClaw topography B
interpolated to the fgmax point on this AMR level (with the method
of interpolation being specified by <cite>fg.interp_method</cite>, as for the values).</p>
<p>The value of N above is assumed to be 1, 2, or 5 in the default
routines, as specified in <cite>setrun.py</cite> by the value of
<cite>rundata.fgmax_data.num_fgmax_val</cite>. The quantities monitored are:</p>
<blockquote>
<div><ul class="simple">
<li><dl class="simple">
<dt>If <cite>rundata.fgmax_data.num_fgmax_val == 1</cite>:</dt><dd><ul>
<li><p>Column 5 contains maximum value of depth <cite>h</cite>,</p></li>
<li><p>Column 6 contains time of maximum <cite>h</cite>.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>If <cite>rundata.fgmax_data.num_fgmax_val == 2</cite>:</dt><dd><ul>
<li><p>Column 5 contains maximum value of depth <cite>h</cite>,</p></li>
<li><p>Column 6 contains maximum value of speed,</p></li>
<li><p>Column 7 contains time of maximum <cite>h</cite>,</p></li>
<li><p>Column 8 contains time of maximum speed.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>If <cite>rundata.fgmax_data.num_fgmax_val == 5</cite>:</dt><dd><ul>
<li><p>Columns 5,6,7,8,9 contain maximum value depth, speed, momentum, momentum
flux, and <cite>hmin</cite>, respectively,</p></li>
<li><p>Columns 10,11,12,13,14 contain times the maximum was recorded, for each
value above.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
<p>The <strong>last</strong> column of <cite>fgmax0001.txt</cite> contains the arrival time of the wave
at this grid point, as determined by the tolerance <cite>arrival_tol</cite> specified in
the input file. The time reported as the “arrival time” is the first time the
value of the surface elevation is greater than <cite>sea_level</cite> + <cite>arrival_tol</cite>.
Points where this value is <cite>-0.99999000E+99</cite> never met this criterion, perhaps
because the point was never inundated.</p>
</section>
<section id="fgmax-examples">
<span id="id1"></span><h2>fgmax examples<a class="headerlink" href="#fgmax-examples" title="Permalink to this heading">¶</a></h2>
<p>For an example of how to process and plot the fgmax results, see the
notebook <cite>make_input_files.ipynb</cite> in the directory
<cite>$CLAW/geoclaw/examples/tsunami/radial-ocean-island-fgmax</cite>
or the rendered version linked from the
<a class="reference external" href="https://www.clawpack.org/gallery/_static/geoclaw/examples/tsunami/radial-ocean-island-fgmax/README.html">README</a>
in the <a class="reference external" href="https://www.clawpack.org/gallery/gallery/gallery_geoclaw.html">GeoClaw Gallery</a></p>
<p>For another examples, see
<cite>$CLAW/geoclaw/examples/tsunami/chile2010_fgmax-fgout</cite> and
its <a class="reference external" href="https://www.clawpack.org/gallery/_static/geoclaw/examples/tsunami/chile2010_fgmax-fgout/README.html">README</a>.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p><a href="http://clawpack.org/">
<img class="logo" src= "_static/clawlogo.jpg" alt="Logo"/>
</a>
<h2>Version 5.11.x</h2>
</p>
<div>
<h3><a href="contents.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Fixed grid monitoring (fgmax)</a><ul>
<li><a class="reference internal" href="#input-file-specification">Input file specification</a><ul>
<li><a class="reference internal" href="#different-point-styles">Different point styles</a></li>
<li><a class="reference internal" href="#other-attributes">Other attributes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#values-to-monitor">Values to monitor</a></li>
<li><a class="reference internal" href="#choice-of-interpolation-procedure">Choice of interpolation procedure</a></li>
<li><a class="reference internal" href="#a-simple-example">A simple example</a></li>
<li><a class="reference internal" href="#processing-and-plotting-fgmax-output">Processing and plotting fgmax output</a></li>
<li><a class="reference internal" href="#format-of-the-output-files">Format of the output files</a></li>
<li><a class="reference internal" href="#fgmax-examples">fgmax examples</a></li>
</ul>
</li>
</ul>
</div><h3>Related Topics</h3>
<ul>
<li><a href="contents.html">Documentation overview</a><ul>
<li><a href="geoclaw.html">GeoClaw Description and Detailed Contents</a><ul>
<li>Previous: <a href="fgout.html" title="previous chapter">Fixed grid output (fgout)</a></li>
<li>Next: <a href="nearshore_interp.html" title="next chapter">Nearshore interpolation</a></li>
</ul></li>
</ul></li>
</ul>
<div class="widget navlinks">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/fgmax.rst.txt"
rel="nofollow"
target="_blank">Source .rst</a></li>
<li><a href="https://github.com/clawpack/doc/blob/dev/doc/fgmax.rst"
rel="nofollow"
target="_blank">Source on GitHub</a></li>
<li><a href="https://github.com/clawpack/doc/commits/dev/doc/fgmax.rst"
rel="nofollow"
target="_blank">History</a></li>
<li><a href="https://github.com/clawpack/doc/edit/dev/doc/fgmax.rst"
rel="nofollow"
target="_blank">Suggest Edits</a></li>
<li><a href="https://github.com/clawpack/doc/issues/new/choose"
rel="nofollow"
target="_blank">Raise an Issue</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
<h4>Latest Version</h4>
<ul>
<li><a href="./dev/fgmax.html">dev</a></li>
<li><a href="fgmax.html">v5.11.x</a></li>
</ul>
<h4>Older Versions</h4>
<ul>
<li><a href="./v5.10.x/fgmax.html">v5.10.x</a></li>
<li><a href="./v5.7.x/fgmax.html">v5.7.x</a></li>
<li><a href="./v5.8.x/fgmax.html">v5.8.x</a></li>
<li><a href="./v5.9.x/fgmax.html">v5.9.x</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright CC-BY 2024, The Clawpack Development Team.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44811544-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>