REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_DogboneAnalytic.H
Go to the documentation of this file.
1
2 ParmParse pp_prob("remora.prob");
3 bool traditional = true;
4 pp_prob.query("traditional", traditional);
5
6 bool l_use_salt = m_solverChoice.use_salt;
7
8 auto geomdata = geom.data();
9 const int khi = geomdata.Domain().bigEnd()[2];
10 for (MFIter mfi(mf_cons, TilingIfNotGPU()); mfi.isValid(); ++mfi)
11 {
12 const Box &bx = mfi.tilebox();
13 AMREX_ALWAYS_ASSERT(bx.length()[2] == khi+1);
14
15 Array4< Real> const& state = mf_cons.array(mfi);
16 Array4< Real> const& x_vel = mf_xvel.array(mfi);
17 Array4< Real> const& y_vel = mf_yvel.array(mfi);
18
19 Array4<const Real> const& x_r = remora.vec_xr[lev]->const_array(mfi);
20 if (traditional) {
21 ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
22 {
23 if (l_use_salt) {
24 state(i, j, k, Salt_comp) = 35.0_rt;
25 }
26
27 state(i,j,k,Temp_comp)= (x_r(i,j,0) < 1000._rt) ? 5.0_rt : 10.0_rt;
28
29 // Set tracer = 0 everywhere
30 state(i, j, k, Tracer_comp) = 0.0_rt;
31 });
32 } else {
33 ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
34 {
35 [[maybe_unused]] const Real x = x_r(i,j,0);
36
37 if (l_use_salt) {
38 state(i, j, k, Salt_comp) = 10.0_rt - 10.0_rt * (x_r(i,j,0) - 8400.0_rt) / 8400.0_rt;
39 }
40
41 state(i,j,k,Temp_comp)= 10.0_rt;
42
43 // Set tracer = 0 everywhere
44 state(i, j, k, Tracer_comp) = 0.0_rt;
45 });
46 }
47
48 const Box& xbx = surroundingNodes(bx,0);
49 const Box& ybx = surroundingNodes(bx,1);
50 ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
51 {
52 x_vel(i, j, k) = 0.0_rt;
53 });
54 ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
55 {
56 y_vel(i, j, k) = 0.0_rt;
57 });
58 }
59 Gpu::streamSynchronize();
#define Temp_comp
#define Tracer_comp
#define Salt_comp
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
ParmParse pp_prob("remora.prob")