27#pragma omp parallel if (Gpu::notInLaunchRegion())
31 const Box&
vbx =
mfi.validbox();
32 const int klo =
vbx.smallEnd(2);
33 const int khi =
vbx.bigEnd(2);
37 const Box&
gbx =
mfi.fabbox();
63 const IntVect
ng =
mf.nGrowVect();
66#pragma omp parallel if (Gpu::notInLaunchRegion())
70 const Box&
vbx =
mfi.validbox();
71 const Box
gbx =
mfi.growntilebox(IntVect(
ng[0],
ng[1],0));
74 const int ilo =
vbx.smallEnd(0);
const int ihi =
vbx.bigEnd(0);
75 const int jlo =
vbx.smallEnd(1);
const int jhi =
vbx.bigEnd(1);
81 amrex::min(amrex::max(
j,
jlo),
jhi),
k);
100 const int tagval = TagBox::SET;
160#pragma omp parallel if (Gpu::notInLaunchRegion())
164 const Box&
bx =
mfi.tilebox();
170 derived::remora_dervort(
bx,
dfab, 0, 1,
sfab,
pm,
pn,
maskr,
Geom(
levc),
time,
nullptr,
levc);
187#ifdef REMORA_USE_PARTICLES
203 IntVect
rr = IntVect::TheUnitVector();
230 "'. Use a tracer name, x_velocity, y_velocity, z_velocity, "
231 "vorticity, mask, or <particle>_count.");
239 "'. Use a tracer name, x_velocity, y_velocity, z_velocity, "
240 "vorticity, or mask.");
250 const Box&
bx =
mfi.validbox();
253 const int klo =
bx.smallEnd(2);
254 const int khi =
bx.bigEnd(2);
311 amrex::Abort(
"Must only specify box for refinement using real OR index space with fine/coarse grid indices");
360 amrex::Print() <<
"Fine box on level " <<
lev_for_box <<
" adjusted from " <<
bx_old <<
" to " <<
bx <<
" to make it valid for refinement." << std::endl;
363 amrex::Print() <<
"Saving in 'boxes at level' as " <<
bx << std::endl;
373 amrex::Abort(
"Don't use n_error_buf > 0 when setting the box explicitly");
387 if (!domain.contains(
bx)) {
388 amrex::Print() <<
"\n";
389 amrex::Print() <<
"Box specified is " <<
bx << std::endl;
390 amrex::Print() <<
"But domain at level is " << domain << std::endl;
391 amrex::Error(
"Specified box doesn't fit in the domain");
403 amrex::Print()<<
"Requested ilo in x-direction : " <<
box_lo[0] << std::endl;
404 amrex::Print() <<
"ilo = " <<
box_lo[0] <<
" is not divisible by ref_ratio in x direction = " <<
406 amrex::Error(
"Adjust in_box_lo_indices in x-direction to be divisible by ref_ratio and try again");
409 amrex::Print()<<
"Requested ihi in x-direction : " <<
box_hi[0] << std::endl;
410 amrex::Print() <<
"ihi+1 = " <<
box_hi[0]+1 <<
" is not divisible by ref_ratio in x direction = " <<
412 amrex::Error(
"Adjust in_box_hi_indices in x-direction to be divisible by ref_ratio and try again");
415 amrex::Print()<<
"Requested jlo in y-direction : " <<
box_lo[1] << std::endl;
416 amrex::Print() <<
"jlo = " <<
box_lo[1] <<
" is not divisible by ref_ratio in y direction = " <<
418 amrex::Error(
"Adjust in_box_lo_indices in y-direction to be divisible by ref_ratio and try again");
421 amrex::Print()<<
"Requested jhi in y-direction : " <<
box_hi[1] << std::endl;
422 amrex::Print() <<
"jhi+1 = " <<
box_hi[1]+1 <<
" is not divisible by ref_ratio in y direction = " <<
424 amrex::Error(
"Adjust in_box_hi_indices in y-direction to be divisible by ref_ratio and try again");
427 amrex::Print()<<
"Requested klo in z-direction : " <<
box_lo[2] << std::endl;
428 amrex::Print() <<
"klo = " <<
box_lo[2] <<
" is not divisible by ref_ratio in z direction = " <<
430 amrex::Error(
"Adjust in_box_lo_indices in z-direction to be divisible by ref_ratio and try again");
433 amrex::Print()<<
"Requested khi in z-direction : " <<
box_hi[2] << std::endl;
434 amrex::Print() <<
"khi+1 = " <<
box_hi[2]+1 <<
" is not divisible by ref_ratio in z direction = " <<
436 amrex::Error(
"Adjust in_box_hi_indices in z-direction to be divisible by ref_ratio and try again");
440 Print() <<
"Saving in 'boxes at level' as " <<
bx << std::endl;
450 amrex::Abort(
"Don't use n_error_buf > 0 when setting the box explicitly");
464 amrex::Print() <<
"\n";
465 amrex::Print() <<
"(Coarse) Box specified is " <<
bx << std::endl;
466 amrex::Print() <<
"But (coarse) domain at level is " <<
geom[
lev_for_box-1].Domain() << std::endl;
467 amrex::Error(
"Specified box doesn't fit in the domain");
482 Print() <<
"Saving in 'boxes at level' as " <<
bx << std::endl;
491 if (
ppr.countval(
"start_time") > 0) {
495 if (
ppr.countval(
"end_time") > 0) {
499 if (
ppr.countval(
"max_level") > 0) {
504 if (
ppr.countval(
"value_greater")) {
511 else if (
ppr.countval(
"value_less")) {
518 else if (
ppr.countval(
"adjacent_difference_greater")) {
519 int num_val =
ppr.countval(
"adjacent_difference_greater");
536 Real
value = Real(0.5);
543 Real
value = Real(0.5);
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
int ncons
Number of conserved scalars in the state (temperature + salt + passive scalars + biology tracers)
int zvel_bc() const noexcept
int xvel_bc() const noexcept
amrex::Vector< std::string > cons_names
Names of scalars for plotfile output.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm
horizontal scaling factor: 1 / dx (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_mskr
land/sea mask at cell centers (2D)
int yvel_bc() const noexcept
amrex::Vector< amrex::MultiFab * > zvel_new
multilevel data container for current step's z velocities (largely unused; W stored separately)
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
the boxes specified at each level by tagging criteria
static amrex::Vector< amrex::AMRErrorTag > ref_tags
Holds info for dynamically generated tagging criteria.
amrex::Vector< amrex::MultiFab * > yvel_new
multilevel data container for current step's y velocities (v in ROMS)
amrex::Vector< int > num_boxes_at_level
how many boxes specified at each level by tagging criteria
amrex::Vector< amrex::MultiFab * > xvel_new
multilevel data container for current step's x velocities (u in ROMS)
void refinement_criteria_setup()
Set refinement criteria.
virtual void ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real time, int ngrow) override
Tag cells for refinement.
void FillBdyCCVels(int lev, amrex::MultiFab &mf_cc_vel)
Fill the physical boundary conditions for cell-centered velocity (diagnostic only)
std::string pp_prefix
default prefix for input file parameters
void FillPatch(int lev, amrex::Real time, amrex::MultiFab &mf_to_be_filled, amrex::Vector< amrex::MultiFab * > const &mfs, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const bool fill_set=false, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab())
Fill a new MultiFab by copying in phi from valid region and filling ghost cells.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn
horizontal scaling factor: 1 / dy (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr3d
land/sea mask at cell centers, copied to all z levels (3D)
static constexpr int cons_bc
static constexpr int t
cons component Temp_comp
static constexpr int null
void remora_dervort(const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::Array4< const amrex::Real > &pm, const amrex::Array4< const amrex::Real > &pn, const amrex::Array4< const amrex::Real > &, const amrex::Geometry &, amrex::Real, const int *, const int)