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 AMREX_ALWAYS_ASSERT(!m_solverChoice.flat_bathymetry);
5
6 mf_h.setVal(geomdata.ProbHi(2));
7
8 for ( MFIter mfi(mf_h, TilingIfNotGPU()); mfi.isValid(); ++mfi )
9 {
10 Array4<Real> const& h = (mf_h).array(mfi);
11
12 Box bx = mfi.tilebox();
13 Box gbx = bx;
14 gbx.grow(mf_h.nGrowVect());
15
16 Box gbxD = gbx;
17 gbxD.makeSlab(2,0);
18
19 ParallelFor(gbxD, [=] AMREX_GPU_DEVICE (int i, int j, int)
20 {
21 const auto prob_lo = geomdata.ProbLo();
22 const auto dx = geomdata.CellSize();
23
24 const Real x0 = prob_lo[0];
25 const Real x = x0 + (i + 0.5_rt) * dx[0];
26 const Real x1 = geomdata.ProbHi(0);
27 const Real h0 = 300.0_rt;
28 const Real h1 = 10.0_rt;
29
30 Real depth = h0 + (h1 - h0) * (x - x0) / (x1 - x0);
31 depth = amrex::min(amrex::max(depth, h1), h0);
32 h(i,j,0) = depth;
33 });
34 } // mfi
AMREX_ALWAYS_ASSERT(!EWPeriodic)