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

Flood grid data structure, construction and the maps between the flood grid and the atmospheric columns. More...

#include <ERF_SurfaceGrid.H>
#include <AMReX_BoxArray.H>
#include <AMReX_DistributionMapping.H>
#include <AMReX_Geometry.H>
#include <AMReX_MultiFab.H>
Include dependency graph for ERF_FloodGrid.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FloodGrid
 2D horizontal flood grid More...
 

Functions

const SurfaceCouplingNames & flood_coupling_names ()
 The flood coupling's names: erf.flood.<key>, "[FLOOD]", "flood grid". More...
 
FloodGrid create_flood_grid (const amrex::BoxArray &ba_atm, const amrex::DistributionMapping &dm_atm, const amrex::Geometry &geom_atm, int C)
 Construct a refined 2D flood grid over one atmospheric level's boxes. More...
 
bool flood_same_columns (const amrex::BoxArray &a, const amrex::BoxArray &b)
 surface_same_columns: box n of a and box n of b cover the same columns. More...
 
bool flood_pairs_with_atm (const amrex::MultiFab &flood_mf, const amrex::MultiFab &atm_mf, const FloodGrid &fg)
 
void flood_fill_boundary (amrex::MultiFab &mf, const amrex::Geometry &geom)
 
void fill_flood_from_atm_k0 (amrex::MultiFab &flood_mf, const amrex::MultiFab &atm_k0, const FloodGrid &fg, int fcomp=0, int acomp=0)
 
void coarsen_flood_to_atm (amrex::MultiFab &atm_out, const amrex::MultiFab &flood, const FloodGrid &fg)
 

Detailed Description

Flood grid data structure, construction and the maps between the flood grid and the atmospheric columns.

A 2D grid on the horizontal plane, refined by grid_ratio relative to one atmospheric AMR level (erf.flood.anchor_level, the finest level by default). The flood grid covers that level's boxes, keeps their x-y decomposition and their MPI owners, and its index space starts at zero at the lower corner of the region they cover. It is the surface grid of the surface-coupling layer (ERF_SurfaceGrid.H) under the flood coupling's name, as the fire grid is; the functions below call that layer with the flood coupling's names.

Function Documentation

◆ coarsen_flood_to_atm()

void coarsen_flood_to_atm ( amrex::MultiFab &  atm_out,
const amrex::MultiFab &  flood,
const FloodGrid &  fg 
)
inline

Average a flood-grid field over each atmospheric column (the C x C flood cells under it) into the k = 0 slabs of the flood grid's level (surface_coarsen_to_atm). Box n of the output is the k = 0 slab of atmospheric box n.

102 {
103  surface_coarsen_to_atm(atm_out, flood, fg, flood_coupling_names());
104 }
const SurfaceCouplingNames & flood_coupling_names()
The flood coupling's names: erf.flood.<key>, "[FLOOD]", "flood grid".
Definition: ERF_FloodGrid.H:26
void surface_coarsen_to_atm(amrex::MultiFab &atm_out, const amrex::MultiFab &surf, const SurfaceGrid &sg, const SurfaceCouplingNames &names)
Definition: ERF_SurfaceGrid.H:201
@ fg
Definition: ERF_AdvanceMorrison.cpp:111

Referenced by FloodCoupler::fill_plot_var().

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

◆ create_flood_grid()

FloodGrid create_flood_grid ( const amrex::BoxArray &  ba_atm,
const amrex::DistributionMapping &  dm_atm,
const amrex::Geometry &  geom_atm,
int  C 
)

Construct a refined 2D flood grid over one atmospheric level's boxes.

Parameters
[in]ba_atmBoxArray of the atmospheric level
[in]dm_atmDistributionMapping of the atmospheric level
[in]geom_atmGeometry of the atmospheric level
[in]CRefinement factor (erf.flood.grid_ratio, >= 1)
Returns
FloodGrid over the region the boxes cover; its lev is left at 0 for the caller to set. See create_surface_grid() for the algorithm.

◆ fill_flood_from_atm_k0()

void fill_flood_from_atm_k0 ( amrex::MultiFab &  flood_mf,
const amrex::MultiFab &  atm_k0,
const FloodGrid &  fg,
int  fcomp = 0,
int  acomp = 0 
)
inline

Copy component acomp of a k = 0 atmospheric field into component fcomp of a flood-grid field (surface_fill_from_atm_k0): every flood cell takes the value of the atmospheric column it lies in. A per-area quantity (precipitation in kg/m2) keeps its column total.

90 {
91  surface_fill_from_atm_k0(flood_mf, atm_k0, fg, flood_coupling_names(), fcomp, acomp);
92 }
void surface_fill_from_atm_k0(amrex::MultiFab &surf_mf, const amrex::MultiFab &atm_k0, const SurfaceGrid &sg, const SurfaceCouplingNames &names, int scomp=0, int acomp=0)
Definition: ERF_SurfaceGrid.H:170
Here is the call graph for this function:

◆ flood_coupling_names()

const SurfaceCouplingNames& flood_coupling_names ( )
inline

The flood coupling's names: erf.flood.<key>, "[FLOOD]", "flood grid".

27 {
28  static const SurfaceCouplingNames names{"flood", "Flood", "FLOOD"};
29  return names;
30 }
Definition: ERF_SurfaceCouplingNames.H:18

Referenced by coarsen_flood_to_atm(), create_flood_grid(), fill_flood_from_atm_k0(), flood_anchor_level(), flood_fill_boundary(), FloodCouplingParams::read(), register_flood_engine(), verify_flood_precip_source(), and verify_flood_prerequisites().

Here is the caller graph for this function:

◆ flood_fill_boundary()

void flood_fill_boundary ( amrex::MultiFab &  mf,
const amrex::Geometry &  geom 
)
inline

surface_fill_boundary: exchange the ghost cells of a cell-centred flood-grid MultiFab and fill the ones outside a non-periodic face.

78 {
80 }
void surface_fill_boundary(amrex::MultiFab &mf, const amrex::Geometry &geom, const SurfaceCouplingNames &names)
Definition: ERF_SurfaceGrid.H:130
Here is the call graph for this function:

◆ flood_pairs_with_atm()

bool flood_pairs_with_atm ( const amrex::MultiFab &  flood_mf,
const amrex::MultiFab &  atm_mf,
const FloodGrid &  fg 
)
inline

surface_pairs_with_atm: box n of the flood grid refines the columns of atmospheric box n for every n, with the same owners.

71 {
72  return surface_pairs_with_atm(flood_mf, atm_mf, fg);
73 }
bool surface_pairs_with_atm(const amrex::MultiFab &surf_mf, const amrex::MultiFab &atm_mf, const SurfaceGrid &sg)
Definition: ERF_SurfaceGrid.H:98
Here is the call graph for this function:

◆ flood_same_columns()

bool flood_same_columns ( const amrex::BoxArray &  a,
const amrex::BoxArray &  b 
)
inline

surface_same_columns: box n of a and box n of b cover the same columns.

63 {
64  return surface_same_columns(a, b);
65 }
bool surface_same_columns(const amrex::BoxArray &a, const amrex::BoxArray &b)
Definition: ERF_SurfaceGrid.H:79

Referenced by FloodCoupler::fill_plot_var().

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