ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_FloodPrerequisites.H File Reference

Start-up checks of the atmosphere side of the flood coupling. More...

#include <string>
#include <ERF_SurfacePrecipitation.H>
Include dependency graph for ERF_FloodPrerequisites.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int flood_anchor_level (int anchor_level, int finest_level)
 The AMR level the flood grid refines: erf.flood.anchor_level, or the finest level when it is -1 (the default). More...
 
void verify_flood_precip_source (const std::string &engine_name, const SurfacePrecipAccumulationSources &sources)
 Start-up check for an engine that reads the precipitation (FloodEngine::wants_surface_precip): the microphysics scheme must provide surface precipitation accumulators. More...
 
void verify_flood_prerequisites (const ERF &erf, int lev)
 Verify the ERF configuration the flood coupling needs. More...
 

Detailed Description

Start-up checks of the atmosphere side of the flood coupling.

Verifies that ERF is configured so that a flood grid can be coupled to it, whichever flood engine runs on that grid. Each engine checks its own inputs after these (FloodEngine::verify_prerequisites). The checks are those of every surface coupling (ERF_SurfacePrerequisites.H); each aborts with a message that names the input to change.

Function Documentation

◆ flood_anchor_level()

int flood_anchor_level ( int  anchor_level,
int  finest_level 
)

The AMR level the flood grid refines: erf.flood.anchor_level, or the finest level when it is -1 (the default).

Aborts, naming the input, when the level is above the finest level.

9 {
10  return surface_anchor_level(anchor_level, finest_level, flood_coupling_names());
11 }
const SurfaceCouplingNames & flood_coupling_names()
The flood coupling's names: erf.flood.<key>, "[FLOOD]", "flood grid".
Definition: ERF_FloodGrid.H:26
int surface_anchor_level(int anchor_level, int finest_level, const SurfaceCouplingNames &names)
The level the surface grid refines: anchor_level, or the finest level when it is -1....
Definition: ERF_SurfacePrerequisites.cpp:10

Referenced by ERF::InitData_post().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verify_flood_precip_source()

void verify_flood_precip_source ( const std::string &  engine_name,
const SurfacePrecipAccumulationSources &  sources 
)

Start-up check for an engine that reads the precipitation (FloodEngine::wants_surface_precip): the microphysics scheme must provide surface precipitation accumulators.

Aborts, naming the engine and erf.moisture_model, when the sources are empty.

Parameters
[in]engine_nameThe engine's name (FloodEngine::name)
[in]sourcesMicrophysics::Get_Surface_Precip_Accumulation_Ptrs(lev)
16 {
17  verify_surface_precip_source(engine_name, sources, "precipitation", flood_coupling_names());
18 }
void verify_surface_precip_source(const std::string &engine_name, const SurfacePrecipAccumulationSources &sources, const std::string &what, const SurfaceCouplingNames &names)
Aborts, naming erf.moisture_model, when no microphysics surface precipitation accumulator exists for ...
Definition: ERF_SurfacePrerequisites.cpp:23

Referenced by ERF::InitData_post().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ verify_flood_prerequisites()

void verify_flood_prerequisites ( const ERF &  erf,
int  lev 
)

Verify the ERF configuration the flood coupling needs.

Checks, in order:

  1. 0 <= lev <= finest level
  2. On a level above 0: static refinement (erf.regrid_int <= 0)
  3. Every box of the level spans its full height (no z decomposition), so the level's k = 0 slabs are one box per atmospheric box
  4. The level's boxes cover one rectangle in x and y
  5. The domain starts at index 0 in x, y and z
22 {
23  // The checks every surface coupling makes on the level its grid refines
24  // (ERF_SurfacePrerequisites.H): the level exists, keeps its boxes above
25  // level 0, its boxes span the full height and cover one rectangle, and its
26  // domain starts at index 0.
28 }
void verify_surface_grid_level(const ERF &erf, int lev, const SurfaceCouplingNames &names)
The checks on the level the surface grid refines, each naming the inputs to change.
Definition: ERF_SurfacePrerequisites.cpp:41

Referenced by FloodCoupler::initialize().

Here is the call graph for this function:
Here is the caller graph for this function: