REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_Upwelling.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 [[maybe_unused]] bool EWPeriodic = geomdata.isPeriodic(0);
8 [[maybe_unused]] bool NSPeriodic = geomdata.isPeriodic(1);
9
10 auto T0 = m_solverChoice.T0;
11 auto S0 = m_solverChoice.S0;
12 for (MFIter mfi(mf_cons, TilingIfNotGPU()); mfi.isValid(); ++mfi)
13 {
14 const Box &bx = mfi.tilebox();
15 AMREX_ALWAYS_ASSERT(bx.length()[2] == khi+1);
16
17 Array4< Real> const& state = mf_cons.array(mfi);
18 Array4< Real> const& x_vel = mf_xvel.array(mfi);
19 Array4< Real> const& y_vel = mf_yvel.array(mfi);
20
21 Array4<const Real> const& z_r = remora.vec_z_r[lev]->const_array(mfi);
22 ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
23 {
24 const Real z = z_r(i,j,k);
25
26 state(i, j, k, Temp_comp) = 1.;
27
28 state(i,j,k,Temp_comp)=T0+8.0_rt*std::exp(z/50.0_rt);
29 if (l_use_salt) {
30 state(i,j,k,Salt_comp)=S0;
31 }
32
33 // Set tracer = 0 everywhere
34 state(i, j, k, Tracer_comp) = 0.0_rt;
35 });
36
37 const Box& xbx = surroundingNodes(bx,0);
38 const Box& ybx = surroundingNodes(bx,1);
39 ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
40 {
41 x_vel(i, j, k) = 0.0_rt;
42 });
43 ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
44 {
45 y_vel(i, j, k) = 0.0_rt;
46 });
47 }
#define Temp_comp
#define Tracer_comp
#define Salt_comp
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)