|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
A flood engine behind the shared coupling layer. More...
#include <ERF_FloodEngine.H>

Public Member Functions | |
| virtual | ~FloodEngine ()=default |
| virtual const char * | name () const =0 |
| Name of the engine, as erf.flood.engine selects it. More... | |
| virtual void | verify_prerequisites (const ERF &erf, int lev)=0 |
| Check the engine's own inputs against the ERF configuration. More... | |
| virtual void | initialize (const ERF &erf, int lev, const FloodGrid &fg, const amrex::MultiFab *z_phys_nd_atm)=0 |
| Set the engine up on the flood grid. More... | |
| virtual void | start_run (amrex::Real stop_time, int max_step, int steps_per_coarse_step) |
| Start-up after initialize(), once the run's end is known. More... | |
| virtual void | advance (const FloodForcing &forcing)=0 |
| Advance the flood over one step of its level. More... | |
| virtual bool | wants_surface_precip () const |
| The engine takes the surface precipitation in FloodForcing. More... | |
| virtual void | write_checkpoint (const std::string &checkpointname) const |
| Write the engine's own state to the checkpoint directory. More... | |
| virtual void | read_checkpoint (const std::string &restart_chkfile, int step) |
| Restore the engine's state from a checkpoint on a restart. More... | |
| virtual void | write_plotfile (const std::string &plotfile_prefix, amrex::Real time, int step) const |
| Write the engine's plotfile of the flood grid. More... | |
| virtual std::vector< std::string > | plot_var_names () const |
| Flood fields the ERF plotfile can carry, by name. More... | |
| virtual const amrex::MultiFab * | plot_var (const std::string &name) const |
| The field plot_var_names() lists as name, on the flood grid. More... | |
A flood engine behind the shared coupling layer.
The coupling calls, in this order:
|
virtualdefault |
|
pure virtual |
Advance the flood over one step of its level.
Implemented in FloodEngineTemplate.
|
pure virtual |
Set the engine up on the flood grid.
| [in] | erf | ERF instance (public AmrCore accessors only) |
| [in] | lev | The level the flood grid refines |
| [in] | fg | The flood grid the coupling built |
| [in] | z_phys_nd_atm | Nodal height of level lev [m]: the terrain the atmosphere sees, at k = 0 |
Implemented in FloodEngineTemplate.
|
pure virtual |
Name of the engine, as erf.flood.engine selects it.
Implemented in FloodEngineTemplate.
Referenced by plot_var(), and read_checkpoint().

|
inlinevirtual |
The field plot_var_names() lists as name, on the flood grid.
One component, on FloodGrid::ba and FloodGrid::dm, valid until the next advance(). The coupler averages it over each atmospheric column (the grid_ratio^2 flood cells under it) and writes it into the k = 0 layer of the ERF plotfile, zero elsewhere. nullptr writes zeros.
Reimplemented in FloodEngineTemplate.

|
inlinevirtual |
Flood fields the ERF plotfile can carry, by name.
The names the deck may list in erf.plot_vars_*. Each must start with "flood_" (the coupler stops otherwise), so they never collide with an ERF variable. The coupler asks once, when it is constructed, so the answer depends on the engine's inputs only. The default lists none.
Reimplemented in FloodEngineTemplate.
|
inlinevirtual |
Restore the engine's state from a checkpoint on a restart.
Called only when the checkpoint holds flood state (it was written with erf.flood.enable = true) and the coupling has checked that it belongs to this run's flood grid. A restart from a checkpoint without flood state (an atmosphere-only spin-up) skips this call, and the engine continues from its initial state.
| [in] | restart_chkfile | The checkpoint directory |
| [in] | step | The step count of the flood grid's level at the checkpoint |
The default stops the run: an engine that does not implement restart says so instead of continuing from its initial state.
Reimplemented in FloodEngineTemplate.

|
inlinevirtual |
Start-up after initialize(), once the run's end is known.
| [in] | stop_time | Elapsed time at which the run stops [s], on the clock the engine's step times use (ERF's stop_time less start_time); numeric_limits<amrex::Real>::max() when no stop time is set |
| [in] | max_step | ERF's max_step, counting level-0 steps; numeric_limits<int>::max() when unset (never negative) |
| [in] | steps_per_coarse_step | Steps of the flood grid's level per level-0 step |
Reimplemented in FloodEngineTemplate.
|
pure virtual |
Check the engine's own inputs against the ERF configuration.
Called once at start-up, after the coupling's checks of the grid (verify_flood_prerequisites) and before the flood grid is built. Aborts, naming the input, on a configuration the engine cannot run.
| [in] | erf | ERF instance (public AmrCore accessors only) |
| [in] | lev | The level the flood grid refines |
Implemented in FloodEngineTemplate.
|
inlinevirtual |
The engine takes the surface precipitation in FloodForcing.
True by default: the coupling then stops at start-up unless the microphysics scheme accumulates surface precipitation. An engine driven by other sources only (an inflow hydrograph) returns false.
Reimplemented in FloodEngineTemplate.
|
inlinevirtual |
Write the engine's own state to the checkpoint directory.
Everything the engine carries from one step to the next, under checkpointname/Level_<lev>/ of the flood grid's level. The default writes nothing; such an engine cannot restart (read_checkpoint).
Reimplemented in FloodEngineTemplate.
|
inlinevirtual |
Write the engine's plotfile of the flood grid.
| [in] | plotfile_prefix | erf.flood.plot_file (the step is appended) |
| [in] | time | Simulation time [s] |
| [in] | step | Level-0 step number |
The default writes nothing (the engine's fields may still reach the ERF plotfile through plot_var_names()).
Reimplemented in FloodEngineTemplate.