REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_Seamount.H
Go to the documentation of this file.
1
2 // Whether this run carries a passive dye tracer. nComp() cannot answer this: with
3 // biology active and no dye, Tracer_comp is the first biology component, so testing
4 // nComp() would write the dye initial value into NO3.
5 const bool l_do_dye = (remora.num_passive_scalars() > 0);
6 bool l_use_salt = m_solverChoice.use_salt;
7
8 auto geomdata = geom.data();
9 const int khi = geomdata.Domain().bigEnd()[2];
10
11 auto T0 = m_solverChoice.T0;
12 auto S0 = m_solverChoice.S0;
13 for (MFIter mfi(mf_cons, TilingIfNotGPU()); mfi.isValid(); ++mfi)
14 {
15 const Box &bx = mfi.tilebox();
16 AMREX_ALWAYS_ASSERT(bx.length()[2] == khi+1);
17
18 Array4< Real> const& state = mf_cons.array(mfi);
19 Array4< Real> const& x_vel = mf_xvel.array(mfi);
20 Array4< Real> const& y_vel = mf_yvel.array(mfi);
21
22 Array4<const Real> const& z_r = remora.vec_z_r[lev]->const_array(mfi);
23
24 ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
25 {
26 // Geometry (note we must include these here to get the data on device)
27 // const auto prob_lo = geomdata.ProbLo();
28 // const auto dx = geomdata.CellSize();
29
30 // const Real x = prob_lo[0] + (i + Real(0.5)) * dx[0];
31 // const Real y = prob_lo[1] + (j + Real(0.5)) * dx[1];
32 const Real z = z_r(i,j,k);
33
34 state(i, j, k, Temp_comp) = one;
35
36 state(i,j,k,Temp_comp)=T0+Real(7.5)*std::exp(z/Real(1000.0));
37 if (l_use_salt) {
39 }
40
41 // Set tracer = 0 everywhere
42 if (l_do_dye) { state(i, j, k,Tracer_comp) = zero; }
43 });
44
45 // Construct a box that is on x-faces
46 const Box& xbx = surroundingNodes(bx,0);
47 // Set the x-velocity
48 ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
49 {
50 // Set the x-velocity
51 x_vel(i, j, k) = zero;
52 });
53
54 // Construct a box that is on y-faces
55 const Box& ybx = surroundingNodes(bx,1);
56
57 // Set the y-velocity
58 ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
59 {
60 y_vel(i, j, k) = zero;
61 });
62 }
constexpr amrex::Real one
constexpr amrex::Real zero
#define Temp_comp
#define Tracer_comp
#define Salt_comp
mf_h setVal(geomdata.ProbHi(2))
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
const bool l_do_dye