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