22 amrex::Print() <<
"\n Timestep hierarchy"
24 <<
", remora.ndtfast = " <<
ndtfast
25 <<
", nfast = " <<
nfast <<
")\n"
26 <<
" ==================\n\n"
27 <<
" Level Ref ratio Substeps Fast steps Slow dt Fast dt\n"
28 <<
" per lev-1 per lev-0 (s) (s)\n";
37 std::ostringstream
ratio;
44 amrex::Print() <<
" " << std::setw(5) <<
lev
45 <<
" " << std::setw(9) <<
ratio.str()
48 <<
" " << std::setw(11) << std::fixed << std::setprecision(4) <<
dt[
lev]
49 <<
" " << std::setw(11) << std::fixed << std::setprecision(4)
53 amrex::Print() << std::endl;
66 ParallelDescriptor::ReduceRealMin(&
dt_tmp[0],
dt_tmp.size());
84 "REMORA::ComputeDt: computed a non-positive, "
85 "non-finite, or unusably large level-0 dt");
89 const Real
eps = Real(1.e-3)*
dt_0;
144#pragma omp parallel if (Gpu::notInLaunchRegion())
150 const Box&
bx =
mfi.tilebox();
169 Real
inv_adv = amrex::max(amrex::Math::abs(u(
i,
j,
k,0)) *
pm(
i,
j,0),
170 amrex::Math::abs(u(
i,
j,
k,1)) *
pn(
i,
j,0));
180 const Real
c = std::sqrt(
grav * amrex::Math::abs(
h(
i,
j,0,0)));
193 ParallelDescriptor::ReduceRealMax(
inv, 2);
205 amrex::Print() <<
"Using cfl = " <<
cfl << std::endl;
207 amrex::Print() <<
" advective limit at level " <<
level <<
": " <<
estdt_adv << std::endl;
209 amrex::Print() <<
" advective limit at level " <<
level <<
": none (velocity is zero)" << std::endl;
212 amrex::Print() <<
" gravity wave limit at level " <<
level <<
": " <<
estdt_bt
213 <<
" (ndtfast = " <<
ndtfast <<
")" << std::endl;
215 amrex::Print() <<
" gravity wave limit at level " <<
level <<
": none (no wet cell has a depth)" << std::endl;
219 amrex::Print() <<
"Slow dt at level " <<
level <<
" would be: " <<
estdt_lowM << std::endl;
221 amrex::Print() <<
"Slow dt at level " <<
level <<
" would be undefined " << std::endl;
223 amrex::Print() <<
"Fixed dt at level " <<
level <<
" is: " <<
fixed_dt << std::endl;
225 amrex::Print() <<
"Slow dt at level " <<
level <<
": " <<
estdt_lowM << std::endl;
238 amrex::Abort(
"REMORA::estTimeStep: cannot estimate a timestep at level " +
239 std::to_string(
level) +
". No wet cell (mskr > 0.5) has a nonzero "
240 "depth, so neither the advective nor the gravity wave limit is "
241 "defined. Check the bathymetry and the land mask, or set "
constexpr amrex::Real bogus_large_value
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
int nfast
Number of fast steps to take.
double stop_time
Whether max_step was set in the inputs; the default above is not a distinguishable sentinel.
static amrex::Real fixed_dt
User specified fixed baroclinic time step.
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_mskr
land/sea mask at cell centers (2D)
int do_substep
Whether to substep fine levels in time.
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_Hz
Width of cells in the vertical (z-) direction (3D, Hz in ROMS)
amrex::Vector< amrex::MultiFab * > yvel_new
multilevel data container for current step's y velocities (v in ROMS)
amrex::Vector< amrex::MultiFab * > xvel_new
multilevel data container for current step's x velocities (u in ROMS)
amrex::Vector< int > nsubsteps
How many substeps on each level?
void ComputeDt()
a wrapper for estTimeStep()
static amrex::Real change_max
Fraction maximum change in subsequent time steps.
amrex::Vector< amrex::Real > t_new
new time at each level, in seconds since start_time
static SolverChoice solverChoice
Container for algorithmic choices.
static int ndtfast
User specified, number of barotropic steps per baroclinic step.
amrex::Real estTimeStep(int lev) const
compute dt from CFL considerations
void print_timestep_hierarchy() const
report the per-level slow/fast timestep hierarchy; call after ComputeDt
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn
horizontal scaling factor: 1 / dy (2D)
static amrex::Real cfl
CFL condition.
amrex::Real elapsed_time(double time) const noexcept
Elapsed time since start_time of a time on the model clock.
static int verbose
Verbosity level of output.
amrex::Vector< amrex::Real > dt
time step at each level