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
5 mf_h.setVal(geomdata.ProbHi(2));
6
7 const int Lm = geom.Domain().size()[0];
8 const int Mm = geom.Domain().size()[1];
9
10 for ( MFIter mfi(mf_h, TilingIfNotGPU()); mfi.isValid(); ++mfi )
11 {
12 Array4<Real> const& h = (mf_h).array(mfi);
13
14 Box bx = mfi.tilebox();
15 Box gbx = bx;
16 gbx.grow(mf_h.nGrowVect());
17
18 Box gbxD = gbx;
19 gbxD.makeSlab(2,0);
20
21 Gpu::streamSynchronize();
22
23 if (NSPeriodic) {
24
25 ParallelFor(gbxD, [=] AMREX_GPU_DEVICE (int i, int j, int )
26 {
27 int iFort = i+1; // (+1 is to match the Fortran indexing in ROMS)
28
29 Real val1 = (iFort <= Lm/two) ? iFort : Lm+1-iFort;
30 val1 -= Real(0.5);
31 Real adj = geomdata.CellSize()[0]/Real(1000.0);
32
33 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))));
34 });
35
36 } else if (EWPeriodic) {
37
38 ParallelFor(gbxD, [=] AMREX_GPU_DEVICE (int i, int j, int )
39 {
40 int jFort = j+1; // (+1 is to match the Fortran indexing in ROMS)
41
42 Real val1 = (jFort<=Mm/two) ? jFort : Mm+1-jFort;
43 val1 -= Real(0.5);
44 Real adj = geomdata.CellSize()[1]/Real(1000.0);
45
46 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))));
47 });
48 }
49 } // mfi
constexpr amrex::Real two
mf_h setVal(geomdata.ProbHi(2))
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)