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