2#include "AMReX_PlotFileUtil.H"
41 if (ParallelDescriptor::IOProcessor()) {
44 VisMF::IO_Buffer
io_buffer(VisMF::IO_Buffer_Size);
48 std::ofstream::trunc |
49 std::ofstream::binary);
86 for (
int i = 0;
i <
istep.size(); ++
i) {
92 for (
int i = 0;
i <
dt.size(); ++
i) {
98 for (
int i = 0;
i <
t_new.size(); ++
i) {
115 for (
auto&
b :
bl2d) {
122 VisMF::Write(cons, amrex::MultiFabFileFullPrefix(
lev,
checkpointname,
"Level_",
"Cell"));
125 VisMF::Write(cons, amrex::MultiFabFileFullPrefix(
lev,
checkpointname,
"Level_",
"Cell_old"));
214#ifdef REMORA_USE_PARTICLES
222 amrex::Print() <<
"Restart from checkpoint " <<
restart_chkfile <<
"\n";
227 VisMF::IO_Buffer
io_buffer(VisMF::GetIOBufferSize());
246 amrex::Abort(
"Checkpoint file has more levels than amr.max_level");
259 amrex::Abort(
"Checkpoint holds " + std::to_string(
chk_ncomp) +
260 " cell-centered components but this run has " + std::to_string(
ncons) +
261 ". The count is set by remora.nscalar and by remora.biology_model; "
262 "both must match the run the checkpoint came from.");
312#ifdef AMREX_USE_FLOAT
326#ifdef AMREX_USE_FLOAT
342 DistributionMapping
dm {
ba, ParallelDescriptor::NProcs() };
351 for (
auto&
b :
bl2d) {
357 VisMF::Read(cons, amrex::MultiFabFileFullPrefix(
lev,
restart_chkfile,
"Level_",
"Cell"));
360 VisMF::Read(cons, amrex::MultiFabFileFullPrefix(
lev,
restart_chkfile,
"Level_",
"Cell_old"));
453#ifdef REMORA_USE_PARTICLES
mf_h setVal(geomdata.ProbHi(2))
static void GotoNextLine(std::istream &is)
utility to skip to next line in Header
int ncons
Number of conserved scalars in the state (temperature + salt + passive scalars + biology tracers)
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_h
multilevel data container for current step's z velocities (largely unused; W stored separately)
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< amrex::MultiFab * > cons_new
multilevel data container for current step's scalar data: temperature, salinity, passive tracer
void stretch_transform(int lev)
Calculate vertical stretched coordinates.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr
land/sea mask at cell centers (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_tke
Turbulent kinetic energy.
void ReadCheckpointFile()
read checkpoint file from disk
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_gls
Turbulent generic length scale.
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_Lscale
Vertical mixing turbulent length scale.
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)
std::string check_file
Checkpoint file prefix.
amrex::Vector< amrex::MultiFab * > xvel_old
multilevel data container for last step's x velocities (u in ROMS)
amrex::Vector< amrex::MultiFab * > yvel_new
multilevel data container for current step's y velocities (v in ROMS)
amrex::Vector< amrex::MultiFab * > zvel_old
multilevel data container for last step's z velocities (largely unused; W stored separately)
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_mskv
land/sea mask at y-faces (2D)
amrex::Vector< int > istep
which step?
void WriteCheckpointFile()
write checkpoint file to disk
static int file_min_digits
Minimum number of digits in plotfile name or chunked history file.
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_DV_avg1
time average of barotropic y velocity flux
amrex::Vector< amrex::Real > t_new
new time at each level
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< std::unique_ptr< amrex::MultiFab > > vec_ru
u velocity RHS (3D, includes horizontal and vertical advection)
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)
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_ubar
barotropic x velocity (2D)
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_DV_avg2
correct time average of barotropic y velocity flux for coupling (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akv
Vertical viscosity coefficient (3D)
virtual void MakeNewLevelFromScratch(int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initi...
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_Zt_avg1
Average of the free surface, zeta (2D)
std::string restart_chkfile
If set, restart from this checkpoint file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rv
v velocity RHS (3D, includes horizontal and vertical advection)
amrex::Vector< amrex::Real > dt
time step at each level
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akp
Turbulent length scale vertical diffusion coefficient.
BottomStressType bottom_stress_type
VertMixingType vert_mixing_type