REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticMasks_DogboneAnalytic.H
Go to the documentation of this file.
1 // Coordinates come from the Geometry rather than remora.vec_xr/vec_yr so that this hook
2 // also works on the full-domain MultiFab used for hires_grid_level, which is
3 // not built on grids[lev] and so has no per-level coordinate arrays to index. This
4 // matches set_grid_coords_from_grid_scale, which puts the rho point of cell i at
5 // (i + 1/2) * dx measured from index 0.
6 const Real dx = geom.CellSize(0);
7 const Real dy = geom.CellSize(1);
8
9 // Defaults put the coast on coarse cell faces at every refinement ratio the tests use,
10 // so every block is entirely land or entirely water. Moving y_lo/y_hi off a coarse face
11 // is what produces a partially-masked coarse cell.
12 ParmParse pp_mask("remora.prob");
13 Real mask_x_lo = Real(2800.0);
14 Real mask_x_hi = Real(5600.0);
15 Real mask_y_lo = Real(250.0);
16 Real mask_y_hi = Real(500.0);
17 pp_mask.query("mask_x_lo", mask_x_lo);
18 pp_mask.query("mask_x_hi", mask_x_hi);
19 pp_mask.query("mask_y_lo", mask_y_lo);
20 pp_mask.query("mask_y_hi", mask_y_hi);
21
22 for (MFIter mfi(mf_mskr, TilingIfNotGPU()); mfi.isValid(); ++mfi)
23 {
24 // Every grow cell, not just NGROW of them: the full-domain array carries as many as
25 // the cumulative refinement ratio needs, and any it left unwritten would coarsen
26 // down as water.
27 const Box &bx = mfi.growntilebox();
28
29 Array4< Real> const& mskr = mf_mskr.array(mfi);
30
31 // mskr is 1 everywhere already
32 ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int ) noexcept
33 {
34 const Real x_r = (i + Real(0.5)) * dx;
35 const Real y_r = (j + Real(0.5)) * dy;
36 if ((x_r > mask_x_lo && x_r < mask_x_hi) &&
38 mskr(i,j,0) = zero;
39 }
40 });
41 }
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
ParmParse pp_mask("remora.prob")