1 #ifndef ERF_FLOOD_COUPLER_H
2 #define ERF_FLOOD_COUPLER_H
7 #include <AMReX_MultiFab.H>
8 #include <AMReX_Geometry.H>
9 #include <AMReX_BoxArray.H>
57 void initialize (
const ERF& erf,
int lev,
const amrex::MultiFab* z_phys_nd_atm);
73 const amrex::BoxArray& ba_atm,
74 const amrex::DistributionMapping& dm_atm,
75 const amrex::Geometry& geom_atm);
104 void advance (
double time,
double dt,
105 const amrex::MultiFab&
xvel,
const amrex::MultiFab&
yvel,
106 const amrex::MultiFab& z_phys_cc,
127 std::string
checkpoint_mismatch (
int chk_lev,
int chk_ratio,
const amrex::Box& chk_region)
const;
154 void fill_plot_var (
const std::string&
name, amrex::MultiFab& dst,
int dcomp,
int lev)
const;
The inputs of the atmosphere side of the flood coupling.
The interface between the flood coupling and a flood engine.
Flood grid data structure, construction and the maps between the flood grid and the atmospheric colum...
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:139
Definition: ERF_FloodCoupler.H:35
std::vector< std::string > m_plot_var_names
Definition: ERF_FloodCoupler.H:201
const std::vector< std::string > & plot_var_names() const
Flood fields the ERF plotfile can carry (FloodEngine::plot_var_names(), read at construction).
Definition: ERF_FloodCoupler.H:144
void initialize(const ERF &erf, int lev, const amrex::MultiFab *z_phys_nd_atm)
Check the configuration, build the flood grid and set the engine up.
Definition: ERF_FloodCoupler.cpp:71
void advance(double time, double dt, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &z_phys_cc, const SurfacePrecipAccumulationSources &precip_sources)
Advance the flood one step of its level.
Definition: ERF_FloodCoupler.cpp:119
const FloodCouplingParams & params() const
The coupling inputs.
Definition: ERF_FloodCoupler.H:160
amrex::Geometry m_geom_atm
geometry of the flood grid's level
Definition: ERF_FloodCoupler.H:186
void fill_plot_var(const std::string &name, amrex::MultiFab &dst, int dcomp, int lev) const
Fill component dcomp of an ERF plotfile MultiFab of level lev with the flood field name.
Definition: ERF_FloodCoupler.cpp:157
double fields_time() const
The time the engine's fields belong to [s], in ERF's double time.
Definition: ERF_FloodCoupler.H:176
amrex::BoxArray m_ba_cols
the k = 0 slab of each box of the level
Definition: ERF_FloodCoupler.H:187
amrex::DistributionMapping m_dm_cols
their owners (the level's)
Definition: ERF_FloodCoupler.H:188
int level() const
The level the flood grid refines (erf.flood.anchor_level, resolved at initialize).
Definition: ERF_FloodCoupler.H:157
double m_fields_time
Definition: ERF_FloodCoupler.H:189
void set_flood_grid(int lev, const FloodGrid &fg, const amrex::BoxArray &ba_atm, const amrex::DistributionMapping &dm_atm, const amrex::Geometry &geom_atm)
Lay the coupling out on a flood grid: what initialize() does after its start-up checks and before it ...
Definition: ERF_FloodCoupler.cpp:87
std::unique_ptr< FloodEngine > m_engine
Definition: ERF_FloodCoupler.H:182
FloodEngine & engine()
The flood engine.
Definition: ERF_FloodCoupler.H:163
FloodCoupler(const FloodCouplingParams ¶ms, std::unique_ptr< FloodEngine > engine)
Definition: ERF_FloodCoupler.cpp:47
std::string precip_ref_name() const
Definition: ERF_FloodCoupler.H:199
const FloodGrid & flood_grid() const
The flood grid.
Definition: ERF_FloodCoupler.H:167
void write_checkpoint(const std::string &checkpointname) const
Write the flood to a checkpoint: the engine's state (FloodEngine::write_checkpoint),...
Definition: ERF_FloodCoupler.cpp:186
bool m_grid_set
Definition: ERF_FloodCoupler.H:185
FloodGrid m_fg
Definition: ERF_FloodCoupler.H:183
const FloodEngine & engine() const
Definition: ERF_FloodCoupler.H:164
FloodCouplingParams m_params
Definition: ERF_FloodCoupler.H:181
std::string checkpoint_mismatch(int chk_lev, int chk_ratio, const amrex::Box &chk_region) const
Why a checkpoint's flood state does not belong to this run's flood grid, or an empty string when it d...
Definition: ERF_FloodCoupler.cpp:215
int m_lev
Definition: ERF_FloodCoupler.H:184
std::unique_ptr< amrex::MultiFab > m_precip_prev
Definition: ERF_FloodCoupler.H:193
void read_checkpoint(const std::string &restart_chkfile, int step)
Restore the engine's state on a restart.
Definition: ERF_FloodCoupler.cpp:233
void set_fields_time(double t)
Set fields_time() to t [s] (ERF only: start-up, restart, end of a coarser step).
Definition: ERF_FloodCoupler.H:178
void set_precip_reference(const SurfacePrecipAccumulationSources &precip_sources)
Take the current surface precipitation accumulation as the reference the next step's precipitation is...
Definition: ERF_FloodCoupler.cpp:110
bool m_precip_rest_frozen
The sources' rest_is_frozen at set_precip_reference(): which split the reference holds.
Definition: ERF_FloodCoupler.H:195
A flood engine behind the shared coupling layer.
Definition: ERF_FloodEngine.H:109
Definition: ERF_InterpolationUtils.H:15
@ fg
Definition: ERF_AdvanceMorrison.cpp:111
@ xvel
Definition: ERF_IndexDefines.H:232
@ yvel
Definition: ERF_IndexDefines.H:233
@ t
Definition: ERF_WSM6.H:295
Definition: ERF_FloodCouplingParams.H:20
2D horizontal flood grid
Definition: ERF_FloodGrid.H:42
Definition: ERF_SurfacePrecipitation.H:40