-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathERF__InitFromInputSounding_8cpp.html
664 lines (656 loc) · 56.3 KB
/
ERF__InitFromInputSounding_8cpp.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
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ERF: Source/Initialization/ERF_InitFromInputSounding.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">ERF
</div>
<div id="projectbrief">Energy Research and Forecasting: An Atmospheric Modeling Code</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('ERF__InitFromInputSounding_8cpp.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">ERF_InitFromInputSounding.cpp File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include <<a class="el" href="ERF_8H_source.html">ERF.H</a>></code><br />
<code>#include <<a class="el" href="ERF__EOS_8H_source.html">ERF_EOS.H</a>></code><br />
<code>#include <<a class="el" href="ERF__Constants_8H_source.html">ERF_Constants.H</a>></code><br />
<code>#include <<a class="el" href="ERF__Utils_8H_source.html">ERF_Utils.H</a>></code><br />
<code>#include <<a class="el" href="ERF__ProbCommon_8H_source.html">ERF_ProbCommon.H</a>></code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for ERF_InitFromInputSounding.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="ERF__InitFromInputSounding_8cpp__incl.png" border="0" usemap="#aSource_2Initialization_2ERF__InitFromInputSounding_8cpp" alt=""/></div>
<map name="aSource_2Initialization_2ERF__InitFromInputSounding_8cpp" id="aSource_2Initialization_2ERF__InitFromInputSounding_8cpp">
<area shape="rect" title=" " alt="" coords="2805,5,3037,47"/>
<area shape="rect" href="ERF_8H.html" title=" " alt="" coords="1896,95,1954,121"/>
<area shape="rect" href="ERF__ProbCommon_8H.html" title=" " alt="" coords="2590,244,2746,271"/>
<area shape="rect" href="ERF__Constants_8H.html" title=" " alt="" coords="2665,393,2798,420"/>
<area shape="rect" href="ERF__EOS_8H.html" title=" " alt="" coords="3662,319,3756,345"/>
<area shape="rect" href="ERF__Utils_8H.html" title=" " alt="" coords="2872,169,2970,196"/>
<area shape="rect" title=" " alt="" coords="1549,393,1608,420"/>
<area shape="rect" title=" " alt="" coords="3096,169,3154,196"/>
<area shape="rect" title=" " alt="" coords="3408,319,3485,345"/>
<area shape="rect" title=" " alt="" coords="505,319,652,345"/>
<area shape="rect" title=" " alt="" coords="2223,244,2355,271"/>
<area shape="rect" title=" " alt="" coords="1337,393,1457,420"/>
<area shape="rect" title=" " alt="" coords="235,169,439,196"/>
<area shape="rect" title=" " alt="" coords="2842,393,3000,420"/>
<area shape="rect" title=" " alt="" coords="3786,468,3954,495"/>
<area shape="rect" title=" " alt="" coords="2292,319,2459,345"/>
<area shape="rect" title=" " alt="" coords="616,169,744,196"/>
<area shape="rect" title=" " alt="" coords="768,169,943,196"/>
<area shape="rect" title=" " alt="" coords="968,169,1154,196"/>
<area shape="rect" title=" " alt="" coords="1178,169,1322,196"/>
<area shape="rect" title=" " alt="" coords="142,244,316,271"/>
<area shape="rect" title=" " alt="" coords="1398,169,1583,196"/>
<area shape="rect" href="ERF__EB_8H.html" title=" " alt="" coords="125,169,210,196"/>
<area shape="rect" href="ERF__DataStruct_8H.html" title=" " alt="" coords="1879,319,2016,345"/>
<area shape="rect" title=" " alt="" coords="1700,393,1780,420"/>
<area shape="rect" href="ERF__IndexDefines_8H.html" title=" " alt="" coords="2188,393,2342,420"/>
<area shape="rect" href="ERF__TurbPertStruct_8H.html" title=" " alt="" coords="2443,393,2602,420"/>
<area shape="rect" href="ERF__InputSoundingData_8H.html" title=" " alt="" coords="1702,244,1894,271"/>
<area shape="rect" href="ERF__InputSpongeData_8H.html" title=" " alt="" coords="1420,319,1600,345"/>
<area shape="rect" href="ERF__ABLMost_8H.html" title=" " alt="" coords="2821,244,2946,271"/>
<area shape="rect" href="ERF__Derive_8H.html" title=" " alt="" coords="1258,244,1368,271"/>
<area shape="rect" href="ERF__ReadBndryPlanes_8H.html" title=" " alt="" coords="1444,244,1627,271"/>
<area shape="rect" href="ERF__WriteBndryPlanes_8H.html" title=" " alt="" coords="357,244,541,271"/>
<area shape="rect" href="ERF__MRI_8H.html" title=" " alt="" coords="3290,319,3384,345"/>
<area shape="rect" href="ERF__PhysBCFunct_8H.html" title=" " alt="" coords="1962,169,2114,196"/>
<area shape="rect" href="ERF__FillPatcher_8H.html" title=" " alt="" coords="2431,244,2566,271"/>
<area shape="rect" href="ERF__SampleData_8H.html" title=" " alt="" coords="3336,244,3484,271"/>
<area shape="rect" href="ERF__ForestDrag_8H.html" title=" " alt="" coords="3021,244,3160,271"/>
<area shape="rect" href="ERF__EulerianMicrophysics_8H.html" title="Contains the Eulerian microphysics class." alt="" coords="2342,169,2548,196"/>
<area shape="rect" href="ERF__LagrangianMicrophysics_8H.html" title="Contains the Lagrangian microphysics class." alt="" coords="2572,169,2798,196"/>
<area shape="rect" href="ERF__LandSurface_8H.html" title=" " alt="" coords="3934,319,4082,345"/>
<area shape="rect" title=" " alt="" coords="1139,393,1292,420"/>
<area shape="rect" title=" " alt="" coords="2483,319,2639,345"/>
<area shape="rect" title=" " alt="" coords="2968,319,3114,345"/>
<area shape="rect" href="ERF__HSEUtils_8H.html" title=" " alt="" coords="2092,319,2216,345"/>
<area shape="rect" title=" " alt="" coords="2670,468,2793,495"/>
<area shape="rect" title=" " alt="" coords="3725,393,3808,420"/>
<area shape="rect" title=" " alt="" coords="3566,393,3700,420"/>
<area shape="rect" title=" " alt="" coords="3324,393,3454,420"/>
<area shape="rect" title=" " alt="" coords="3479,393,3542,420"/>
</map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a3591f1ded54f05cbacb8d1ad6246572e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="ERF__InitFromInputSounding_8cpp.html#a3591f1ded54f05cbacb8d1ad6246572e">init_bx_scalars_from_input_sounding</a> (const Box &bx, Array4< Real > const &state, GeometryData const &geomdata, Array4< const Real > const &z_cc_arr, const bool &l_moist, <a class="el" href="structInputSoundingData.html">InputSoundingData</a> const &inputSoundingData)</td></tr>
<tr class="separator:a3591f1ded54f05cbacb8d1ad6246572e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2fa99eca7f2a1ca02c504e6a3a2026b2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="ERF__InitFromInputSounding_8cpp.html#a2fa99eca7f2a1ca02c504e6a3a2026b2">init_bx_scalars_from_input_sounding_hse</a> (const Box &bx, Array4< Real > const &state, Array4< Real > const &r_hse_arr, Array4< Real > const &p_hse_arr, Array4< Real > const &pi_hse_arr, Array4< Real > const &th_hse_arr, Array4< Real > const &qv_hse_arr, GeometryData const &geomdata, Array4< const Real > const &z_cc_arr, const Real &l_gravity, const Real &l_rdOcp, const bool &l_moist, <a class="el" href="structInputSoundingData.html">InputSoundingData</a> const &inputSoundingData)</td></tr>
<tr class="separator:a2fa99eca7f2a1ca02c504e6a3a2026b2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3e2549542024fc00744ba8077f71f1fb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="ERF__InitFromInputSounding_8cpp.html#a3e2549542024fc00744ba8077f71f1fb">init_bx_velocities_from_input_sounding</a> (const Box &bx, Array4< Real > const &x_vel, Array4< Real > const &y_vel, Array4< Real > const &z_vel, GeometryData const &geomdata, Array4< const Real > const &z_nd_arr, <a class="el" href="structInputSoundingData.html">InputSoundingData</a> const &inputSoundingData)</td></tr>
<tr class="separator:a3e2549542024fc00744ba8077f71f1fb"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a3591f1ded54f05cbacb8d1ad6246572e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3591f1ded54f05cbacb8d1ad6246572e">◆ </a></span>init_bx_scalars_from_input_sounding()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void init_bx_scalars_from_input_sounding </td>
<td>(</td>
<td class="paramtype">const Box & </td>
<td class="paramname"><em>bx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">GeometryData const & </td>
<td class="paramname"><em>geomdata</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< const Real > const & </td>
<td class="paramname"><em>z_cc_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const bool & </td>
<td class="paramname"><em>l_moist</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structInputSoundingData.html">InputSoundingData</a> const & </td>
<td class="paramname"><em>inputSoundingData</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Box level wrapper for initializing scalar data from input sounding data.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bx</td><td>Box specifying the indices we are initializing </td></tr>
<tr><td class="paramname">state</td><td>Array4 specifying the state data we are to initialize </td></tr>
<tr><td class="paramname">geomdata</td><td>GeometryData object specifying the domain geometry </td></tr>
<tr><td class="paramname">inputSoundingData</td><td><a class="el" href="structInputSoundingData.html">InputSoundingData</a> object we are to initialize from </td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> {</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keyword">const</span> Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keyword">const</span> Real* theta_inp_sound = inputSoundingData.theta_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keyword">const</span> Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> inp_sound_size = inputSoundingData.size(0);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  </div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="comment">// Geometry</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keyword">const</span> Real* prob_lo = geomdata.ProbLo();</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keyword">const</span> Real* dx = geomdata.CellSize();</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keyword">const</span> Real z_lo = prob_lo[2];</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keyword">const</span> Real dz = dx[2];</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="comment">// We want to set the lateral BC values, too</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  Box gbx = bx; <span class="comment">// Copy constructor</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  gbx.grow(0,1); gbx.grow(1,1); <span class="comment">// Grow by one in the lateral directions</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  </div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <span class="keywordtype">int</span> k) noexcept {</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keyword">const</span> Real <a class="code" href="ERF__DataStruct_8H.html#a627f1f843904477f763577ad1460de01afbade9e36a3f36d3d676c1b808451dd7">z</a> = (z_cc_arr) ? z_cc_arr(i,j,k)</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  : z_lo + (k + 0.5) * dz;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  </div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  Real rho_0 = 1.0;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  </div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="comment">// Set the density</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#a27dcc910aeb002a0fd44727954dc0e49">Rho_comp</a>) = rho_0;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  </div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="comment">// Initial Rho0*Theta0</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#a28f96fd04e1ff08fa7a8f53ccde0f877">RhoTheta_comp</a>) = rho_0 * <a class="code" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a>(z_inp_sound, theta_inp_sound, z, inp_sound_size);</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  </div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="comment">// Initialize all scalars to 0.</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> n = 0; n < <a class="code" href="ERF__IndexDefines_8H.html#a6773f201eef9644a5d5b7252f6d95ce9">NSCALARS</a>; n++) {</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#a0296f21cd48e5d8236c62ae4ce319b2f">RhoScalar_comp</a>+n) = 0;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  }</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  </div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="comment">// total nonprecipitating water (Q1) == water vapor (Qv), i.e., there is no cloud water or cloud ice</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordflow">if</span> (l_moist) {</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#aa965e9988f14d5d2a5aef4a942168a15">RhoQ1_comp</a>) = rho_0 * <a class="code" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a>(z_inp_sound, qv_inp_sound, z, inp_sound_size);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  }</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  });</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span> }</div>
<div class="ttc" id="aERF__DataStruct_8H_html_a627f1f843904477f763577ad1460de01afbade9e36a3f36d3d676c1b808451dd7"><div class="ttname"><a href="ERF__DataStruct_8H.html#a627f1f843904477f763577ad1460de01afbade9e36a3f36d3d676c1b808451dd7">Coord::z</a></div><div class="ttdeci">@ z</div></div>
<div class="ttc" id="aERF__IndexDefines_8H_html_a0296f21cd48e5d8236c62ae4ce319b2f"><div class="ttname"><a href="ERF__IndexDefines_8H.html#a0296f21cd48e5d8236c62ae4ce319b2f">RhoScalar_comp</a></div><div class="ttdeci">#define RhoScalar_comp</div><div class="ttdef"><b>Definition:</b> ERF_IndexDefines.H:40</div></div>
<div class="ttc" id="aERF__IndexDefines_8H_html_a27dcc910aeb002a0fd44727954dc0e49"><div class="ttname"><a href="ERF__IndexDefines_8H.html#a27dcc910aeb002a0fd44727954dc0e49">Rho_comp</a></div><div class="ttdeci">#define Rho_comp</div><div class="ttdef"><b>Definition:</b> ERF_IndexDefines.H:36</div></div>
<div class="ttc" id="aERF__IndexDefines_8H_html_a28f96fd04e1ff08fa7a8f53ccde0f877"><div class="ttname"><a href="ERF__IndexDefines_8H.html#a28f96fd04e1ff08fa7a8f53ccde0f877">RhoTheta_comp</a></div><div class="ttdeci">#define RhoTheta_comp</div><div class="ttdef"><b>Definition:</b> ERF_IndexDefines.H:37</div></div>
<div class="ttc" id="aERF__IndexDefines_8H_html_a6773f201eef9644a5d5b7252f6d95ce9"><div class="ttname"><a href="ERF__IndexDefines_8H.html#a6773f201eef9644a5d5b7252f6d95ce9">NSCALARS</a></div><div class="ttdeci">#define NSCALARS</div><div class="ttdef"><b>Definition:</b> ERF_IndexDefines.H:16</div></div>
<div class="ttc" id="aERF__IndexDefines_8H_html_aa965e9988f14d5d2a5aef4a942168a15"><div class="ttname"><a href="ERF__IndexDefines_8H.html#aa965e9988f14d5d2a5aef4a942168a15">RhoQ1_comp</a></div><div class="ttdeci">#define RhoQ1_comp</div><div class="ttdef"><b>Definition:</b> ERF_IndexDefines.H:42</div></div>
<div class="ttc" id="aERF__Interpolation__1D_8H_html_a803d0d35d4ca4791556cbe02bbf51cbb"><div class="ttname"><a href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a></div><div class="ttdeci">AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real interpolate_1d(const amrex::Real *alpha, const amrex::Real *beta, const amrex::Real alpha_interp, const int alpha_size)</div><div class="ttdef"><b>Definition:</b> ERF_Interpolation_1D.H:12</div></div>
</div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="classERF.html#a2908bcd920ab5e3fef171a37302853ec">ERF::init_from_input_sounding()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="ERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_cgraph.png" border="0" usemap="#aERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_cgraph" alt=""/></div>
<map name="aERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_cgraph" id="aERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_cgraph">
<area shape="rect" title=" " alt="" coords="5,23,163,65"/>
<area shape="rect" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb" title=" " alt="" coords="243,5,359,32"/>
<area shape="rect" href="structInputSoundingData.html#ae67ebe7a35af74165a1d2e7ee31a1bbc" title=" " alt="" coords="211,56,391,83"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="ERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_icgraph.png" border="0" usemap="#aERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_icgraph" alt=""/></div>
<map name="aERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_icgraph" id="aERF__InitFromInputSounding_8cpp_a3591f1ded54f05cbacb8d1ad6246572e_icgraph">
<area shape="rect" title=" " alt="" coords="207,5,364,47"/>
<area shape="rect" href="classERF.html#a2908bcd920ab5e3fef171a37302853ec" title=" " alt="" coords="5,5,159,47"/>
</map>
</div>
</div>
</div>
<a id="a2fa99eca7f2a1ca02c504e6a3a2026b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2fa99eca7f2a1ca02c504e6a3a2026b2">◆ </a></span>init_bx_scalars_from_input_sounding_hse()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void init_bx_scalars_from_input_sounding_hse </td>
<td>(</td>
<td class="paramtype">const Box & </td>
<td class="paramname"><em>bx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>r_hse_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>p_hse_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>pi_hse_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>th_hse_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>qv_hse_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">GeometryData const & </td>
<td class="paramname"><em>geomdata</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< const Real > const & </td>
<td class="paramname"><em>z_cc_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Real & </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Real & </td>
<td class="paramname"><em>l_rdOcp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const bool & </td>
<td class="paramname"><em>l_moist</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structInputSoundingData.html">InputSoundingData</a> const & </td>
<td class="paramname"><em>inputSoundingData</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Box level wrapper for initializing scalar and hydrostatic base state data from input sounding data.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bx</td><td>Box specifying the indices we are initializing </td></tr>
<tr><td class="paramname">state</td><td>Array4 specifying the state data we are to initialize </td></tr>
<tr><td class="paramname">r_hse_arr</td><td>Array4 specifying the density HSE base state data we are to initialize </td></tr>
<tr><td class="paramname">p_hse_arr</td><td>Array4 specifying the pressure HSE base state data we are to initialize </td></tr>
<tr><td class="paramname">pi_hse_arr</td><td>Array4 specifying the Exner pressure HSE base state data we are to initialize </td></tr>
<tr><td class="paramname">th_hse_arr</td><td>Array4 specifying the base state potential temperature we are to initialize </td></tr>
<tr><td class="paramname">geomdata</td><td>GeometryData object specifying the domain geometry </td></tr>
<tr><td class="paramname">l_gravity</td><td>Real number specifying the gravitational acceleration constant </td></tr>
<tr><td class="paramname">l_rdOcp</td><td>Real number specifying the Rhydberg constant ($R_d$) divided by specific heat at constant pressure ($c_p$) </td></tr>
<tr><td class="paramname">inputSoundingData</td><td><a class="el" href="structInputSoundingData.html">InputSoundingData</a> object we are to initialize from </td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> {</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keyword">const</span> Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="keyword">const</span> Real* rho_inp_sound = inputSoundingData.rho_inp_sound_d.dataPtr();</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keyword">const</span> Real* theta_inp_sound = inputSoundingData.theta_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="keyword">const</span> Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> inp_sound_size = inputSoundingData.size(0);</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  </div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="comment">// Geometry</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keyword">const</span> Real* prob_lo = geomdata.ProbLo();</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keyword">const</span> Real* dx = geomdata.CellSize();</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keyword">const</span> Real z_lo = prob_lo[2];</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keyword">const</span> Real dz = dx[2];</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  </div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keywordtype">int</span> kbot = geomdata.Domain().smallEnd(2);</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordtype">int</span> ktop = geomdata.Domain().bigEnd(2);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  </div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="comment">// We want to set the lateral BC values, too</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  Box gbx = bx; <span class="comment">// Copy constructor</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  gbx.grow(0,1); gbx.grow(1,1); <span class="comment">// Grow by one in the lateral directions</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  </div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <span class="keywordtype">int</span> k) noexcept {</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keyword">const</span> Real <a class="code" href="ERF__DataStruct_8H.html#a627f1f843904477f763577ad1460de01afbade9e36a3f36d3d676c1b808451dd7">z</a> = (z_cc_arr) ? z_cc_arr(i,j,k)</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  : z_lo + (k + 0.5) * dz;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  </div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  Real rho_k, qv_k, rhoTh_k;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  </div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <span class="comment">// Set the density</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  rho_k = <a class="code" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a>(z_inp_sound, rho_inp_sound, z, inp_sound_size);</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#a27dcc910aeb002a0fd44727954dc0e49">Rho_comp</a>) = rho_k;</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  </div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="comment">// Initial Rho0*Theta0</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  rhoTh_k = rho_k * <a class="code" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a>(z_inp_sound, theta_inp_sound, z, inp_sound_size);</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#a28f96fd04e1ff08fa7a8f53ccde0f877">RhoTheta_comp</a>) = rhoTh_k;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  </div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="comment">// Initialize all scalars to 0.</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> n = 0; n < <a class="code" href="ERF__IndexDefines_8H.html#a6773f201eef9644a5d5b7252f6d95ce9">NSCALARS</a>; n++) {</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#a0296f21cd48e5d8236c62ae4ce319b2f">RhoScalar_comp</a>+n) = 0;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  }</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  </div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="comment">// Update hse quantities with values calculated from InputSoundingData.calc_rho_p()</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  qv_k = (l_moist) ? <a class="code" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a>(z_inp_sound, qv_inp_sound, z, inp_sound_size) : 0.0;</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  </div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  qv_hse_arr(i,j,k) = qv_k;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  r_hse_arr (i,j,k) = rho_k * (1.0 + qv_k);</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  p_hse_arr (i,j,k) = <a class="code" href="ERF__EOS_8H.html#a08354ab110fb9e873bce9250b4f4b46e">getPgivenRTh</a>(rhoTh_k, qv_k);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  pi_hse_arr(i,j,k) = <a class="code" href="ERF__EOS_8H.html#a24b76fd72f051dc593840f006d79fd1a">getExnergivenRTh</a>(rhoTh_k, l_rdOcp);</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  th_hse_arr(i,j,k) = <a class="code" href="ERF__EOS_8H.html#a3cc0ee7727b26e21a97acfc2ad2e6d4d">getRhoThetagivenP</a>(p_hse_arr(i,j,k), qv_k) / rho_k;</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  </div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="comment">// TODO: we should be setting this to the number of ghost cells of base_state[lev]</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <span class="comment">// instead of hard-wiring it here!</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <span class="keywordtype">int</span> ng = 3;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  </div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="comment">// FOEXTRAP hse arrays</span></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <span class="keywordflow">if</span> (k==kbot)</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  {</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 1; kk <= ng; kk++) {</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  r_hse_arr(i, j, k-kk) = r_hse_arr(i,j,k);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  p_hse_arr(i, j, k-kk) = p_hse_arr(i,j,k);</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  pi_hse_arr(i, j, k-kk) = pi_hse_arr(i,j,k);</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  th_hse_arr(i, j, k-kk) = th_hse_arr(i,j,k);</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  qv_hse_arr(i, j, k-kk) = qv_hse_arr(i,j,k);</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  }</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  }</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (k==ktop)</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  {</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 1; kk <= ng; kk++) {</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  r_hse_arr(i, j, k+kk) = r_hse_arr(i,j,k);</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  p_hse_arr(i, j, k+kk) = p_hse_arr(i,j,k);</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  pi_hse_arr(i, j, k+kk) = pi_hse_arr(i,j,k);</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  qv_hse_arr(i, j, k+kk) = qv_hse_arr(i,j,k);</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  }</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  }</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  </div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="comment">// total nonprecipitating water (Q1) == water vapor (Qv), i.e., there</span></div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="comment">// is no cloud water or cloud ice</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <span class="keywordflow">if</span> (l_moist) {</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  state(i, j, k, <a class="code" href="ERF__IndexDefines_8H.html#aa965e9988f14d5d2a5aef4a942168a15">RhoQ1_comp</a>) = rho_k * qv_k;</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  }</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  });</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span> }</div>
<div class="ttc" id="aERF__EOS_8H_html_a08354ab110fb9e873bce9250b4f4b46e"><div class="ttname"><a href="ERF__EOS_8H.html#a08354ab110fb9e873bce9250b4f4b46e">getPgivenRTh</a></div><div class="ttdeci">AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getPgivenRTh(const amrex::Real rhotheta, const amrex::Real qv=0.)</div><div class="ttdef"><b>Definition:</b> ERF_EOS.H:84</div></div>
<div class="ttc" id="aERF__EOS_8H_html_a24b76fd72f051dc593840f006d79fd1a"><div class="ttname"><a href="ERF__EOS_8H.html#a24b76fd72f051dc593840f006d79fd1a">getExnergivenRTh</a></div><div class="ttdeci">AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getExnergivenRTh(const amrex::Real rhotheta, const amrex::Real rdOcp, const amrex::Real qv=0.0)</div><div class="ttdef"><b>Definition:</b> ERF_EOS.H:159</div></div>
<div class="ttc" id="aERF__EOS_8H_html_a3cc0ee7727b26e21a97acfc2ad2e6d4d"><div class="ttname"><a href="ERF__EOS_8H.html#a3cc0ee7727b26e21a97acfc2ad2e6d4d">getRhoThetagivenP</a></div><div class="ttdeci">AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getRhoThetagivenP(const amrex::Real p, const amrex::Real qv=0.0)</div><div class="ttdef"><b>Definition:</b> ERF_EOS.H:175</div></div>
</div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="classERF.html#a2908bcd920ab5e3fef171a37302853ec">ERF::init_from_input_sounding()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="ERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_cgraph.png" border="0" usemap="#aERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_cgraph" alt=""/></div>
<map name="aERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_cgraph" id="aERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_cgraph">
<area shape="rect" title=" " alt="" coords="5,99,164,141"/>
<area shape="rect" href="ERF__EOS_8H.html#a24b76fd72f051dc593840f006d79fd1a" title=" " alt="" coords="232,5,372,32"/>
<area shape="rect" href="ERF__EOS_8H.html#a08354ab110fb9e873bce9250b4f4b46e" title=" " alt="" coords="247,56,357,83"/>
<area shape="rect" href="ERF__EOS_8H.html#a3cc0ee7727b26e21a97acfc2ad2e6d4d" title=" " alt="" coords="227,107,377,133"/>
<area shape="rect" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb" title=" " alt="" coords="244,157,360,184"/>
<area shape="rect" href="structInputSoundingData.html#ae67ebe7a35af74165a1d2e7ee31a1bbc" title=" " alt="" coords="212,208,392,235"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="ERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_icgraph.png" border="0" usemap="#aERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_icgraph" alt=""/></div>
<map name="aERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_icgraph" id="aERF__InitFromInputSounding_8cpp_a2fa99eca7f2a1ca02c504e6a3a2026b2_icgraph">
<area shape="rect" title=" " alt="" coords="207,5,365,47"/>
<area shape="rect" href="classERF.html#a2908bcd920ab5e3fef171a37302853ec" title=" " alt="" coords="5,5,159,47"/>
</map>
</div>
</div>
</div>
<a id="a3e2549542024fc00744ba8077f71f1fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e2549542024fc00744ba8077f71f1fb">◆ </a></span>init_bx_velocities_from_input_sounding()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void init_bx_velocities_from_input_sounding </td>
<td>(</td>
<td class="paramtype">const Box & </td>
<td class="paramname"><em>bx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>x_vel</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>y_vel</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< Real > const & </td>
<td class="paramname"><em>z_vel</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">GeometryData const & </td>
<td class="paramname"><em>geomdata</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Array4< const Real > const & </td>
<td class="paramname"><em>z_nd_arr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structInputSoundingData.html">InputSoundingData</a> const & </td>
<td class="paramname"><em>inputSoundingData</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Box level wrapper for initializing velocities from input sounding data.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bx</td><td>Box specifying the indices we are initializing </td></tr>
<tr><td class="paramname">x_vel</td><td>Array4 specifying the x-velocity data we are to initialize </td></tr>
<tr><td class="paramname">y_vel</td><td>Array4 specifying the y-velocity data we are to initialize </td></tr>
<tr><td class="paramname">z_vel</td><td>Array4 specifying the z-velocity data we are to initialize </td></tr>
<tr><td class="paramname">geomdata</td><td>GeometryData object specifying the domain geometry </td></tr>
<tr><td class="paramname">inputSoundingData</td><td><a class="el" href="structInputSoundingData.html">InputSoundingData</a> object we are to initialize from </td></tr>
</table>
</dd>
</dl>
<div class="fragment"><div class="line"><a name="l00337"></a><span class="lineno"> 337</span> {</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="keyword">const</span> Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="keyword">const</span> Real* U_inp_sound = inputSoundingData.U_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <span class="keyword">const</span> Real* V_inp_sound = inputSoundingData.V_inp_sound_d[0].dataPtr();</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> inp_sound_size = inputSoundingData.size(0);</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  </div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="comment">// Geometry</span></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="keyword">const</span> Real* prob_lo = geomdata.ProbLo();</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  <span class="keyword">const</span> Real* dx = geomdata.CellSize();</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keyword">const</span> Real z_lo = prob_lo[2];</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <span class="keyword">const</span> Real dz = dx[2];</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  </div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <span class="comment">// We want to set the lateral BC values, too</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  Box gbx = bx; <span class="comment">// Copy constructor</span></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  gbx.grow(0,1); gbx.grow(1,1); <span class="comment">// Grow by one in the lateral directions</span></div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  </div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="comment">// Construct a box that is on x-faces</span></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <span class="keyword">const</span> Box& xbx = surroundingNodes(gbx,0);</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  <span class="comment">// Construct a box that is on y-faces</span></div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  <span class="keyword">const</span> Box& ybx = surroundingNodes(gbx,1);</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <span class="comment">// Construct a box that is on z-faces</span></div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  <span class="keyword">const</span> Box& zbx = surroundingNodes(gbx,2);</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  </div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="comment">// Set the x,y,z-velocities</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  ParallelFor(xbx, ybx, zbx,</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  [=] AMREX_GPU_DEVICE (<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <span class="keywordtype">int</span> k) noexcept {</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  <span class="comment">// Note that this is called on a box of x-faces</span></div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <span class="keyword">const</span> Real <a class="code" href="ERF__DataStruct_8H.html#a627f1f843904477f763577ad1460de01afbade9e36a3f36d3d676c1b808451dd7">z</a> = (z_nd_arr) ? 0.25*( z_nd_arr(i,j ,k )</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  + z_nd_arr(i,j+1,k )</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  + z_nd_arr(i,j ,k+1)</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  + z_nd_arr(i,j+1,k+1))</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  : z_lo + (k + 0.5) * dz;</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  </div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <span class="comment">// Set the x-velocity</span></div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  x_vel(i, j, k) = <a class="code" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a>(z_inp_sound, U_inp_sound, z, inp_sound_size);</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  },</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  [=] AMREX_GPU_DEVICE (<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <span class="keywordtype">int</span> k) noexcept {</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="comment">// Note that this is called on a box of y-faces</span></div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="keyword">const</span> Real <a class="code" href="ERF__DataStruct_8H.html#a627f1f843904477f763577ad1460de01afbade9e36a3f36d3d676c1b808451dd7">z</a> = (z_nd_arr) ? 0.25*( z_nd_arr(i ,j,k )</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  + z_nd_arr(i+1,j,k )</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  + z_nd_arr(i ,j,k+1)</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  + z_nd_arr(i+1,j,k+1))</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  : z_lo + (k + 0.5) * dz;</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  </div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <span class="comment">// Set the y-velocity</span></div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  y_vel(i, j, k) = <a class="code" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb">interpolate_1d</a>(z_inp_sound, V_inp_sound, z, inp_sound_size);</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  },</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  [=] AMREX_GPU_DEVICE (<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> j, <span class="keywordtype">int</span> k) noexcept {</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="comment">// Note that this is called on a box of z-faces</span></div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="comment">// Set the z-velocity</span></div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  z_vel(i, j, k) = 0.0;</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  });</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span> }</div>
</div><!-- fragment -->
<p class="reference">Referenced by <a class="el" href="classERF.html#a2908bcd920ab5e3fef171a37302853ec">ERF::init_from_input_sounding()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="ERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_cgraph.png" border="0" usemap="#aERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_cgraph" alt=""/></div>
<map name="aERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_cgraph" id="aERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_cgraph">
<area shape="rect" title=" " alt="" coords="5,23,172,65"/>
<area shape="rect" href="ERF__Interpolation__1D_8H.html#a803d0d35d4ca4791556cbe02bbf51cbb" title=" " alt="" coords="252,5,368,32"/>
<area shape="rect" href="structInputSoundingData.html#ae67ebe7a35af74165a1d2e7ee31a1bbc" title=" " alt="" coords="220,56,400,83"/>
</map>
</div>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="ERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_icgraph.png" border="0" usemap="#aERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_icgraph" alt=""/></div>
<map name="aERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_icgraph" id="aERF__InitFromInputSounding_8cpp_a3e2549542024fc00744ba8077f71f1fb_icgraph">
<area shape="rect" title=" " alt="" coords="207,5,373,47"/>
<area shape="rect" href="classERF.html#a2908bcd920ab5e3fef171a37302853ec" title=" " alt="" coords="5,5,159,47"/>
</map>
</div>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_74389ed8173ad57b461b9d623a1f3867.html">Source</a></li><li class="navelem"><a class="el" href="dir_71a4420ed1f8982e7234eb6a0b7e6d5d.html">Initialization</a></li><li class="navelem"><a class="el" href="ERF__InitFromInputSounding_8cpp.html">ERF_InitFromInputSounding.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>