REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticBathymetry_Upwelling_Coupling.H
Go to the documentation of this file.
1
2 // Must not be periodic in E-W, and must allow bathymetry
4
5 mf_h.setVal(geomdata.ProbHi(2));
6
7 for ( MFIter mfi(mf_h, TilingIfNotGPU()); mfi.isValid(); ++mfi )
8 {
9 Array4<Real> const& h = (mf_h).array(mfi);
10
11 Box bx = mfi.tilebox();
12 Box gbx = bx;
13 gbx.grow(mf_h.nGrowVect());
14
15 Box gbxD = gbx;
16 gbxD.makeSlab(2,0);
17
18 ParallelFor(gbxD, [=] AMREX_GPU_DEVICE (int i, int j, int)
19 {
20 const auto prob_lo = geomdata.ProbLo();
21 const auto dx = geomdata.CellSize();
22
23 const Real x0 = prob_lo[0];
24 const Real x = x0 + (i + Real(0.5)) * dx[0];
25 const Real x1 = geomdata.ProbHi(0);
26 const Real h0 = Real(300.0);
27 const Real h1 = Real(10.0);
28
29 Real depth = h0 + (h1 - h0) * (x - x0) / (x1 - x0);
30 depth = amrex::min(amrex::max(depth, h1), h0);
31 h(i,j,0) = depth;
32 });
33 } // mfi
AMREX_ALWAYS_ASSERT(!EWPeriodic)
mf_h setVal(geomdata.ProbHi(2))