REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticBathymetry_Upwelling.H
Go to the documentation of this file.
1
2 // Must not be doubly periodic, and must have terrain
4 AMREX_ALWAYS_ASSERT( !m_solverChoice.flat_bathymetry);
5
6 mf_h.setVal(geomdata.ProbHi(2));
7
8 const int Lm = geom.Domain().size()[0];
9 const int Mm = geom.Domain().size()[1];
10
11 for ( MFIter mfi(mf_h, TilingIfNotGPU()); mfi.isValid(); ++mfi )
12 {
13 Array4<Real> const& h = (mf_h).array(mfi);
14
15 Box bx = mfi.tilebox();
16 Box gbx = bx;
17 gbx.grow(mf_h.nGrowVect());
18
19 Box gbxD = gbx;
20 gbxD.makeSlab(2,0);
21
22 Gpu::streamSynchronize();
23
24 if (NSPeriodic) {
25
26 ParallelFor(gbxD, [=] AMREX_GPU_DEVICE (int i, int j, int )
27 {
28 int iFort = i+1; // (+1 is to match the Fortran indexing in ROMS)
29
30 Real val1 = (iFort <= Lm/two) ? iFort : Lm+1-iFort;
31 val1 -= Real(0.5);
32 Real adj = geomdata.CellSize()[1]/Real(1000.0);
33
34 h(i,j,0) = std::min(-geomdata.ProbLo(2),(Real(84.5)+Real(66.526)*std::tanh((val1*adj-Real(10.0))/Real(7.0))));
35 });
36
37 } else if (EWPeriodic) {
38
39 ParallelFor(gbxD, [=] AMREX_GPU_DEVICE (int i, int j, int )
40 {
41 int jFort = j+1; // (+1 is to match the Fortran indexing in ROMS)
42
43 Real val1 = (jFort<=Mm/two) ? jFort : Mm+1-jFort;
44 val1 -= Real(0.5);
45 Real adj = geomdata.CellSize()[0]/Real(1000.0);
46
47 h(i,j,0) = std::min(-geomdata.ProbLo(2),(Real(84.5)+Real(66.526)*std::tanh((val1*adj-Real(10.0))/Real(7.0))));
48 });
49 }
50 } // mfi
constexpr amrex::Real two
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)