13#include <AMReX_ParallelReduce.H>
23BoxArray slab_boxes (
const BoxArray& ba)
25 BoxList bl2d = ba.boxList();
26 for (
auto& b : bl2d) {
29 return BoxArray(std::move(bl2d));
61 mskr.FillBoundary(geom[lev].periodicity());
68 mskr.FillBoundary(geom[lev].periodicity());
71#ifdef REMORA_USE_NETCDF
81 const IntVect rr = refRatio(lev-1);
82 MultiFab ctmp(amrex::coarsen(mskr.boxArray(), rr), mskr.DistributionMap(), 1, 0);
84 ctmp.ParallelCopy(*
vec_mskr[lev-1], 0, 0, 1);
85 const int rx = rr[0], ry = rr[1];
87#pragma omp parallel if (Gpu::notInLaunchRegion())
89 for (MFIter mfi(mskr, TilingIfNotGPU()); mfi.isValid(); ++mfi) {
90 Array4< Real>
const& f = mskr.array(mfi);
91 Array4<const Real>
const& c = ctmp.const_array(mfi);
92 ParallelFor(mfi.tilebox(), [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
noexcept
94 f(i,j,k) = c(amrex::coarsen(i, rx), amrex::coarsen(j, ry), 0);
97 Gpu::streamSynchronize();
113 const BoxArray ba2d = slab_boxes(ba);
114 MultiFab mskr(ba2d, DistributionMapping(ba2d), 1, IntVect(
NGROW+1,
NGROW+1,0));
117 wet.assign(ba.size(), 0);
119#pragma omp parallel if (Gpu::notInLaunchRegion())
121 for (MFIter mfi(mskr); mfi.isValid(); ++mfi) {
123 const Real ncol = mskr[mfi].sum<RunOn::Device>(mfi.validbox(), 0);
124 wet[mfi.index()] =
static_cast<Long
>(ncol) * ba[mfi.index()].length(2);
126 ParallelAllReduce::Sum(wet.data(),
static_cast<int>(wet.size()),
127 ParallelContext::CommunicatorSub());
145 BL_PROFILE(
"REMORA::MakeDistributionMap()");
147 return AmrCore::MakeDistributionMap(lev, ba);
157 constexpr Long scale = Long(1) << 20;
159 std::vector<Long> wgts(ba.size());
160 Long total_cells = 0, total_wet = 0;
161 bool cell_count_weights =
true;
162 for (
int b = 0; b < ba.size(); ++b) {
163 const Long npts = ba[b].numPts();
164 const Long nwet = known ? wet[b] : npts;
165 wgts[b] = scale * nwet + land_w * (npts - nwet);
166 cell_count_weights = cell_count_weights && (wgts[b] == scale * npts);
172 amrex::Print() <<
"Level " << lev <<
": the land mask is not known before the level is"
173 <<
" made (remora.hires_grid_level >= " << lev <<
"), so its boxes are"
174 <<
" weighted by cell count for remora.load_balance.\n";
178 return AmrCore::MakeDistributionMap(lev, ba);
181 const int nprocs = ParallelContext::NProcsSub();
182 DistributionMapping dm;
184 dm.SFCProcessorMap(ba, wgts, nprocs);
186 dm.KnapSackProcessorMap(wgts, nprocs);
188 dm.RoundRobinProcessorMap(wgts, nprocs);
192 std::vector<Long> rank_w(nprocs, 0), rank_c(nprocs, 0), rank_n(nprocs, 0);
193 for (
int b = 0; b < ba.size(); ++b) {
194 const int r = ParallelContext::global_to_local_rank(dm[b]);
195 rank_w[r] += wgts[b];
196 rank_c[r] += ba[b].numPts();
199 auto max_over_mean = [nprocs] (
const std::vector<Long>& v) {
200 Long tot = 0, mx = 0;
201 for (
auto x : v) { tot +=
x; mx = std::max(mx,
x); }
202 return (tot > 0) ? Real(mx) * nprocs / Real(tot) :
one;
206 <<
" boxes, " << total_wet <<
" of " << total_cells
207 << (known ?
" cells wet;" :
" cells (mask unknown, all weighed);")
208 <<
" max/mean rank load " << max_over_mean(rank_w)
209 <<
" by weight, " << max_over_mean(rank_c) <<
" by cell count; boxes per"
210 <<
" rank " << *std::min_element(rank_n.begin(), rank_n.end()) <<
" to "
211 << *std::max_element(rank_n.begin(), rank_n.end()) <<
"\n";
250 if (max_level < 1 ||
ref_tags.empty()) {
return bl; }
252 if (unbounded) {
return bl; }
254 const IntVect rr = ref_ratio[0];
255 IntVect bf(1), stencil(0);
256 for (
int d = 0; d < 2; ++d) {
257 bf[d] = std::max(1, blocking_factor[1][d] / rr[d]);
258 stencil[d] = (
NGROW + 2 + rr[d] - 1) / rr[d] + 1;
260 const Box&
dom = geom[0].Domain();
261 const Real* plo = geom[0].ProbLo();
262 const Real*
dx = geom[0].CellSize();
264 IntVect lo =
dom.smallEnd(), hi =
dom.bigEnd();
265 for (
int d = 0; d < 2; ++d) {
266 lo[d] =
static_cast<int>(std::floor((rb.lo(d) - plo[d]) /
dx[d])) - n_error_buf[0][d];
267 hi[d] =
static_cast<int>(std::floor((rb.hi(d) - plo[d]) /
dx[d])) + n_error_buf[0][d];
272 b.grow(IntVect(n_proper + 1, n_proper + 1, 0));
276 if (b.ok()) { bl.push_back(b); }
294 BL_PROFILE(
"REMORA::drop_dry_level0_boxes()");
296 amrex::Print() <<
"remora.drop_dry_boxes: no land mask (remora.mask_type = none), so no"
297 <<
" box is dropped.\n";
301#ifdef REMORA_USE_PARTICLES
302 constexpr bool with_particles =
true;
304 constexpr bool with_particles =
false;
306#ifdef REMORA_USE_MOAB
307 constexpr bool with_moab =
true;
309 constexpr bool with_moab =
false;
311 if (with_particles) {
314 amrex::Print() <<
"remora.drop_dry_boxes: built with particles, so no level-0 box is"
320 amrex::Print() <<
"remora.drop_dry_boxes: built with MOAB, so no level-0 box is dropped.\n";
327 amrex::Print() <<
"remora.drop_dry_boxes: amr.max_level > 1, so no level-0 box is"
333 amrex::Print() <<
"remora.drop_dry_boxes: coupled to an atmosphere driver, so no level-0"
334 <<
" box is dropped.\n";
338 bool unbounded =
false;
341 amrex::Print() <<
"remora.drop_dry_boxes: a refinement indicator has no box, so a finer"
342 <<
" level may cover any land; no level-0 box is dropped.\n";
346 const BoxArray ba2d = slab_boxes(ba);
347 MultiFab mskr(ba2d, DistributionMapping(ba2d), 1, IntVect(
NGROW+1,
NGROW+1,0));
349 amrex::Print() <<
"remora.drop_dry_boxes: the level-0 mask comes from remora.hires_grid_level"
350 <<
" and is not known before the level is made; no box is dropped.\n";
357 Box reach = makeSlab(geom[0].Domain(), 2, 0);
358 for (
int d = 0; d < 2; ++d) {
359 reach.grow(d, geom[0].isPeriodic(d) ?
NGROW+1 : 1);
361 Vector<int> keep(ba.size(), 0);
363#pragma omp parallel if (Gpu::notInLaunchRegion())
365 for (MFIter mfi(mskr); mfi.isValid(); ++mfi) {
366 const Real wet = mskr[mfi].max<RunOn::Device>(mfi.fabbox() & reach, 0);
367 keep[mfi.index()] = (wet >
zero) ? 1 : 0;
369 ParallelAllReduce::Max(keep.data(),
static_cast<int>(keep.size()),
370 ParallelContext::CommunicatorSub());
373 Long ndrop = 0, cells_drop = 0;
374 for (
int b = 0; b < ba.size(); ++b) {
375 bool k = keep[b] != 0;
377 for (Box p : protect) {
379 if (p.intersects(ba2d[b])) { k =
true;
break; }
383 kept.push_back(ba[b]);
386 cells_drop += ba[b].numPts();
389 if (kept.isEmpty()) {
390 amrex::Abort(
"remora.drop_dry_boxes: every level-0 box is land; there is no water to model");
393 amrex::Print() <<
"remora.drop_dry_boxes: level 0 keeps " << kept.size() <<
" of " << ba.size()
394 <<
" boxes; dropped " << ndrop <<
" all-land boxes, " << cells_drop <<
" of "
395 << ba.numPts() <<
" cells (" << Real(100.0)*Real(cells_drop)/Real(ba.numPts())
397 if (ndrop == 0) {
return ba; }
398 return BoxArray(std::move(kept));
408 if (grids.empty() || grids[0].empty()) {
return false; }
409 return grids[0].numPts() != geom[0].Domain().numPts();
421 const IntVect rr = ref_ratio[0];
423 for (
int d = 0; d < 2; ++d) { ng[d] = (
NGROW + 2 + rr[d] - 1) / rr[d] + 1; }
424 BoxArray need = amrex::coarsen(grids[1], rr);
427 for (
int b = 0; b < need.size(); ++b) {
428 Box bx = need[b] & geom[0].Domain();
429 if (bx.ok()) { bl.push_back(bx); }
431 if (!grids[0].contains(BoxArray(std::move(bl)))) {
432 amrex::Abort(
"remora.drop_dry_boxes: level 1, or the level-0 cells it needs, reaches a"
433 " dropped level-0 box. Set remora.drop_dry_boxes = false for this run.");
443 AmrCore::regrid(lbase,
time, initial);
455 const MultiFab& mskr = *
vec_mskr[0];
456 MultiFab probe(mskr.boxArray(), mskr.DistributionMap(), 1, mskr.nGrowVect());
458 MultiFab::Subtract(probe, mskr, 0, 0, 1, mskr.nGrowVect());
459 if (probe.norminf(0, 1, mskr.nGrowVect()) !=
zero) {
460 amrex::Abort(
"remora.drop_dry_boxes: level 0's mask differs from the one the boxes were"
466void add_if (Vector<MultiFab*>& v, MultiFab* mf) {
if (mf) { v.push_back(mf); } }
467void add_if (Vector<MultiFab*>& v,
const std::unique_ptr<MultiFab>& mf) {
if (mf) { v.push_back(mf.get()); } }
474struct DryGhostHoles {
477 std::map<int, Vector<Box>> holes;
479std::vector<DryGhostHoles>& dry_ghost_cache () {
static std::vector<DryGhostHoles> c;
return c; }
501 if (lev < v->size()) { add_if(f, (*v)[lev]); }
503#ifdef REMORA_USE_NETCDF
505 if (lev < v->size()) { add_if(f, (*v)[lev]); }
518 if (lev < v->size()) { add_if(f, (*v)[lev]); }
521 if (lev < nv.size()) { add_if(f, nv[lev]); }
538 const BoxArray& ba = mf.boxArray();
539 const IntVect ng = mf.nGrowVect();
540 auto& cache = dry_ghost_cache();
541 DryGhostHoles* entry =
nullptr;
542 for (
auto& e : cache) {
543 if (e.ng == ng && e.ba == ba) { entry = &e;
break; }
546 cache.push_back(DryGhostHoles{ba, ng, {}});
547 entry = &cache.back();
550 Box
dom = amrex::convert(geom[0].Domain(), mf.ixType());
551 const Box mb = ba.minimalBox();
552 dom.setRange(2, mb.smallEnd(2), mb.length(2));
555 for (MFIter mfi(mf); mfi.isValid(); ++mfi) {
556 if (entry->holes.count(mfi.index()) == 0) {
558 const Box fab = mfi.fabbox() &
dom;
560 for (
const Box& h : ba.complementIn(fab)) { hv.push_back(h); }
562 entry->holes.emplace(mfi.index(), std::move(hv));
567 const int nc = mf.nComp();
568 const auto& holes = entry->holes;
570#pragma omp parallel if (Gpu::notInLaunchRegion()) reduction(+:n)
572 for (MFIter mfi(mf); mfi.isValid(); ++mfi) {
573 Array4<Real>
const& a = mf.array(mfi);
574 for (
const Box& h : holes.at(mfi.index())) {
575 n += h.numPts() * nc;
576 ParallelFor(h, nc, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k,
int c)
noexcept
582 Gpu::streamSynchronize();
626 std::string which =
"dynamic";
627 ParmParse pp(
"remora");
628 pp.query(
"dry_ghost_fields", which);
629 if (which !=
"dynamic" && which !=
"all") {
630 amrex::Abort(
"remora.dry_ghost_fields must be dynamic or all, not " + which);
632 Real big = Real(1.e30);
633 pp.query(
"dry_ghost_value", big);
634 const Real val = (
dry_ghost_test == 1) ? std::numeric_limits<Real>::signaling_NaN() : big;
637 for (MultiFab* mf : f) {
640 ParallelDescriptor::ReduceLongSum(npoison);
641 amrex::Print() <<
"remora.dry_ghost_test = " <<
dry_ghost_test <<
": overwrote " << npoison
642 <<
" uncovered ghost values in " << f.size() <<
" level-0 fields\n";
constexpr amrex::Real one
constexpr amrex::Real zero
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lonr
longitude on rho-points (2D, degrees east); only filled when the grid NetCDF file carries lon_rho
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr_full_domain
Land/sea mask at cell centers on the whole domain at each potential level. Specified at hires_grid_le...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_EminusP
evaporation minus precipitation [kg/m^2/s], defined at rho-points
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rv2d
v velocity RHS (2D, includes horizontal and vertical advection)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_evap
evaporation rate [kg/m^2/s]
bool running_with_coupling_driver
True once REMORA has received forcing through the coupling driver.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_fcor
coriolis factor (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_u
metric products at u points, components MetricU (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_btflux
Bottom tracer flux; input arrays.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rubar
barotropic x velocity for the RHS (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h
multilevel data container for current step's z velocities (largely unused; W stored separately)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm
horizontal scaling factor: 1 / dx (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ZoBot
Bottom roughness length [m], defined at rho points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DU_avg2
correct time average of barotropic x velocity flux for coupling (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lrflx
longwave radiation
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yv
y_grid on v-points (2D)
amrex::Vector< amrex::MultiFab * > cons_new
multilevel data container for current step's scalar data: temperature, salinity, passive tracer
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_sustr_rho
Surface stress from a lat-lon file, east and north components on rho points before it is rotated onto...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vwind
Wind in the v direction, defined at rho-points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_svstr_rho
std::unique_ptr< ProblemBase > prob
Pointer to container of analytical functions for problem definition.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr
land/sea mask at cell centers (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_latr
latitude on rho-points (2D, degrees north); only filled when the grid NetCDF file carries lat_rho
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rain
precipitation rate [kg/m^2/s]
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_scratch_2d
Scratch for the barotropic step: the n_scratch_2d fields one pass of advance_2d hands the next (new d...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_tke
Turbulent kinetic energy.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_stflx
Surface tracer flux; working arrays.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_gls
Turbulent generic length scale.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_sustr
Surface stress in the u direction.
amrex::Vector< amrex::RealBox > refine_regions
Physical-space region of each refinement indicator, for level0_refine_footprint.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yp
y_grid on psi-points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xr
x_grid on rho points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dvbar_new
see vec_Dvbar_old (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ru2d
u velocity RHS (2D, includes horizontal and vertical advection)
amrex::Vector< amrex::MultiFab * > zvel_new
multilevel data container for current step's z velocities (largely unused; W stored separately)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_sstore
additional scratch space for calculations on temp, salt, etc
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xv
x_grid on v-points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Lscale
Vertical mixing turbulent length scale.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Hz
Width of cells in the vertical (z-) direction (3D, Hz in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akt
Vertical diffusion coefficient (3D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_msku
land/sea mask at x-faces (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rvfrc
v velocity RHS, integrated, including advection and bottom/surface stresses (2D)
bool level0_has_holes() const
Whether level 0's BoxArray leaves part of the domain out.
bool refine_region_unbounded
Whether some refinement indicator has no region, so it may refine anywhere.
amrex::Vector< amrex::MultiFab * > xvel_old
multilevel data container for last step's x velocities (u in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dubar_old
DU_avg2 per unit cell edge length, at the start and end of this level's step. What a subcycled finer ...
amrex::Vector< amrex::MultiFab * > yvel_new
multilevel data container for current step's y velocities (v in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_uwind
Wind in the u direction, defined at rho-points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rufrc
u velocity RHS, integrated, including advection and bottom/surface stresses (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_p
metric products at psi points, components MetricP (2D)
std::string load_balance_name() const
The remora.load_balance spelling of the current strategy.
bool wet_cells_per_box(int lev, const amrex::BoxArray &ba, amrex::Vector< amrex::Long > &wet)
Wet cells in each box of a prospective layout of level lev; false if unknown.
void check_dropped_level0_mask()
Check level 0's mask against the mask the dropping decision was made on.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_shflx
sensible heat flux
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_visc2_p
Harmonic viscosity defined on the psi points (corners of horizontal grid cells)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_dmde
d(1/m)/d(eta)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rvbar
barotropic y velocity for the RHS (2D)
amrex::Vector< amrex::MultiFab * > zvel_old
multilevel data container for last step's z velocities (largely unused; W stored separately)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_r
z coordinates at rho points (cell centers)
amrex::Vector< amrex::MultiFab * > xvel_new
multilevel data container for current step's x velocities (u in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lhflx
latent heat flux
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskp
land/sea mask at cell corners (2D)
virtual void regrid(int lbase, amrex::Real time, bool initial=false) override
Regrid (overrides AmrCore), then check that level 1 stays clear of dropped level-0 boxes.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bvf
Brunt-Vaisala frequency (3D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lonp
longitude on psi-points (2D, degrees east); only filled when the grid NetCDF file carries lon_psi
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskv
land/sea mask at y-faces (2D)
amrex::BoxArray drop_dry_level0_boxes(const amrex::BoxArray &ba)
The kept boxes of a level-0 BoxArray under remora.drop_dry_boxes.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rhoS
density perturbation
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_visc2_r
Harmonic viscosity defined on the rho points (centers)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_r
metric products of pm and pn at rho points, components MetricR (2D). Recomputed by set_derived_metric...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_svstr
Surface stress in the v direction.
void poison_dry_ghost_cells()
remora.dry_ghost_test: overwrite the ghost cells of kept level-0 boxes that lie in dropped boxes (1: ...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Huon
u-volume flux (3D)
amrex::Vector< amrex::MultiFab * > yvel_old
multilevel data container for last step's y velocities (v in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rhoA
vertically-averaged density
amrex::BoxList level0_refine_footprint(bool &unbounded) const
Level-0 index region a finer level may need; unbounded if it can go anywhere.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DV_avg1
time average of barotropic y velocity flux
bool probe_rho_mask(int lev, amrex::MultiFab &mskr)
The rho-point mask a level lev on mskr's layout would get, before that level exists; false if it cann...
void check_dry_box_nesting() const
Abort if level 1 or its coarse stencil reaches a dropped level-0 box.
static SolverChoice solverChoice
Container for algorithmic choices.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akk
Turbulent kinetic energy vertical diffusion coefficient.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rdrag2
Quadratic drag coefficient [unitless], defined at rho points.
amrex::Vector< amrex::MultiFab * > level0_fields(bool all)
The level-0 fields: the evolving ones, and with all the static ones too.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ru
u velocity RHS (3D, includes horizontal and vertical advection)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xp
x_grid on psi-points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_longwave_down
Downward longwave radiation.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta
free surface height (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vbar
barotropic y velocity (2D)
int dry_ghost_test
Debug: see poison_dry_ghost_cells.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DU_avg1
time average of barotropic x velocity flux (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_alpha
Thermal expansion coefficient (3D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ubar
barotropic x velocity (2D)
void fill_rho_mask_from_netcdf(int lev, amrex::MultiFab &mskr)
fill a rho-point mask on any layout of level lev from its NetCDF grid file(s)
amrex::Vector< amrex::MultiFab * > cons_old
multilevel data container for last step's scalar data: temperature, salinity, passive tracer
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bustr
Bottom stress in the u direction.
void zero_level0_dry_ghost_cells()
Zero those cells in every level-0 field (see set_dry_ghost_cells)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DV_avg2
correct time average of barotropic y velocity flux for coupling (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yu
y_grid on u-points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_dndx
d(1/n)/d(xi)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bvstr
Bottom stress in the v direction.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rzeta
free surface height for the RHS (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_angler
angle from east to the local xi axis on rho-points (2D, radians, positive counterclockwise: ROMS's an...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_phys_nd
z coordinates at psi points (cell nodes)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dvbar_old
DV_avg2 per unit cell edge length, see vec_Dubar_old (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xu
x_grid on u-points (2D)
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > vec_nudg_coeff
Climatology nudging coefficients.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn
horizontal scaling factor: 1 / dy (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akv
Vertical viscosity coefficient (3D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_stflux
Surface tracer flux; input arrays.
amrex::Real load_balance_land_weight
cost of a land cell relative to a wet one in the load-balance weights (remora.load_balance_land_weigh...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dubar_new
see vec_Dubar_old (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rdrag
Linear drag coefficient [m/s], defined at rho points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_cloud
cloud cover fraction [0-1], defined at rho-points
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Zt_avg1
Average of the free surface, zeta (2D)
amrex::Long set_dry_ghost_cells(amrex::MultiFab &mf, amrex::Real val)
Write val into the cells of a level-0 field inside the domain but in no box.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rv
v velocity RHS (3D, includes horizontal and vertical advection)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_btflx
Bottom tracer flux; working arrays.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_beta
Saline contraction coefficient (3D)
virtual amrex::DistributionMapping MakeDistributionMap(int lev, amrex::BoxArray const &ba) override
Distribution mapping for a new BoxArray on level lev, by remora.load_balance: each box weighs its wet...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr3d
land/sea mask at cell centers, copied to all z levels (3D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_srflx
Shortwave radiation flux [W/m²], defined at rho-points.
static amrex::Vector< REMORAErrorTag > ref_tags
Holds info for dynamically generated tagging criteria.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_v
metric products at v points, components MetricV (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DUon
Scratch for the barotropic step, kept per level rather than allocated on every fast step: the x and y...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Pair
Air pressure [mb], defined at rho-points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DVom
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_qair
Specific humidity [kg/kg], defined at rho-points.
int hires_grid_level
Which level the high resolution bathymetry is at.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_w
z coordinates at w points (faces between z-cells)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Tair
Air temperature [°C], defined at rho-points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yr
y_grid on rho points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Hvom
v-volume flux (3D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akp
Turbulent length scale vertical diffusion coefficient.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_diff2
Harmonic diffusivity for temperature / salinity.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_latp
latitude on psi-points (2D, degrees north); only filled when the grid NetCDF file carries lat_psi