REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticBathymetry_DogboneAnalytic.H
Go to the documentation of this file.
1 ParmParse pp_prob("remora.prob");
2
3 bool traditional = true;
4 pp_prob.query("traditional", traditional);
5
6 // Flat-bottom depth for the traditional dogbone. Settable so a run can be matched to a
7 // ROMS grid file with a different h; set remora.prob_lo's z to -depth to match.
8 Real depth = Real(10.0);
9 pp_prob.query("depth", depth);
10
12 mf_h.setVal(depth);
13 } else {
14 // Coordinates from the Geometry rather than remora.vec_xr/vec_yr, as in the mask hook:
15 // the hires_grid_level path evaluates this on a full-domain MultiFab that is not built
16 // on grids[lev], so the per-level coordinate arrays cannot be indexed with its MFIter.
17 // Matches set_grid_coords_from_grid_scale's (i + 1/2) * dx convention.
18 const Real dx = geom.CellSize(0);
19 const Real dy = geom.CellSize(1);
20
21 mf_h.setVal(zero);
22 for (MFIter mfi(mf_h, TilingIfNotGPU()); mfi.isValid(); ++mfi)
23 {
24 const Box &bx = mfi.growntilebox();
25
26 Array4< Real> const& h = mf_h.array(mfi);
27
28 ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int ) noexcept
29 {
30 const Real x_r = (i + Real(0.5)) * dx;
31 const Real y_r = (j + Real(0.5)) * dy;
32 h(i,j,0) = Real(10.0) + (x_r - Real(4200.0)) * (x_r - Real(4200.0)) * Real(5.0) / (Real(4200.0) * Real(4200.0)) -
33 (y_r - Real(375.0)) * (y_r - Real(375.0)) * Real(5.0) / (Real(375.0) * Real(375.0));
34 });
35 }
36 }
constexpr amrex::Real zero
mf_h setVal(zero)
ParmParse pp_prob("remora.prob")