|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Classes | |
| struct | HeightTable |
Functions | |
| std::string | TableProblem (bool is_usgs, int nx, int ny, const Vector< Real > &x, const Vector< Real > &y, const Vector< Real > &z, const GpuArray< Real, AMREX_SPACEDIM > &prob_lo, const GpuArray< Real, AMREX_SPACEDIM > &prob_hi, bool require_domain_coverage) |
| std::string | TableSummary (const std::string &fname, bool is_usgs, int nx, int ny, const Vector< Real > &x, const Vector< Real > &y, const Vector< Real > &z) |
| const HeightTable & | ReadHeightTable (const std::string &fname, bool is_usgs, const GpuArray< Real, AMREX_SPACEDIM > &prob_lo, const GpuArray< Real, AMREX_SPACEDIM > &prob_hi, bool require_domain_coverage) |
| Array< Real, 4 > | FaceBandSlopes (const MultiFab &z_phys_nd, const MultiFab &mf_mx, const MultiFab &mf_my, const Geometry &geom, int band) |
| std::string | OpenFaceSlopeWarning (int lev, int band, const Array< Real, 4 > &slopes, const Array< bool, 4 > &open, const Array< std::string, 4 > &bc_names) |
| const HeightTable & | ReadHeightTable (const std::string &fname, bool is_usgs, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &prob_lo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &prob_hi, bool require_domain_coverage=true) |
| std::string | TableProblem (bool is_usgs, int nx, int ny, const amrex::Vector< amrex::Real > &x, const amrex::Vector< amrex::Real > &y, const amrex::Vector< amrex::Real > &z, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &prob_lo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &prob_hi, bool require_domain_coverage=true) |
| std::string | TableSummary (const std::string &fname, bool is_usgs, int nx, int ny, const amrex::Vector< amrex::Real > &x, const amrex::Vector< amrex::Real > &y, const amrex::Vector< amrex::Real > &z) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | CellTerrainSlope (int i, int j, int k, const amrex::Array4< const amrex::Real > &z_nd, amrex::Real mfx, amrex::Real mfy, amrex::Real dxinv, amrex::Real dyinv) noexcept |
| amrex::Array< amrex::Real, 4 > | FaceBandSlopes (const amrex::MultiFab &z_phys_nd, const amrex::MultiFab &mf_mx, const amrex::MultiFab &mf_my, const amrex::Geometry &geom, int band) |
| std::string | OpenFaceSlopeWarning (int lev, int band, const amrex::Array< amrex::Real, 4 > &slopes, const amrex::Array< bool, 4 > &open, const amrex::Array< std::string, 4 > &bc_names) |
Variables | |
| constexpr amrex::Real | open_face_slope_warn = amrex::Real(0.3) |
|
noexcept |
Physical slope |grad h| of the terrain over cell (i,j,k): the terrain drops of ComputeTerrainCellDrops (the same drops as the diffusive limits and the slope factor) times the map factor over the cell size in each direction.
| [in] | i,j,k | cell indices |
| [in] | z_nd | nodal heights |
| [in] | mfx,mfy | map factors of the cell |
| [in] | dxinv,dyinv | inverse horizontal cell sizes |
Referenced by FaceBandSlopes().


| amrex::Array<amrex::Real,4> erf_terrain_file::FaceBandSlopes | ( | const amrex::MultiFab & | z_phys_nd, |
| const amrex::MultiFab & | mf_mx, | ||
| const amrex::MultiFab & | mf_my, | ||
| const amrex::Geometry & | geom, | ||
| int | band | ||
| ) |
Largest CellTerrainSlope, on one level, over the surface cells within band cells of each lateral domain face, in the order xlo, xhi, ylo, yhi; -1 for a face whose band holds no cell of this level. Reduced over all ranks.
| [in] | z_phys_nd | nodal heights of the level (surface at the domain's lowest k) |
| [in] | mf_mx | map factor in x at cell centres (ERF's mapfac m_x, on ba2d) |
| [in] | mf_my | map factor in y at cell centres (m_y) |
| [in] | geom | geometry of the level |
| [in] | band | width of the band in cells (>= 1) |
| Array<Real,4> erf_terrain_file::FaceBandSlopes | ( | const MultiFab & | z_phys_nd, |
| const MultiFab & | mf_mx, | ||
| const MultiFab & | mf_my, | ||
| const Geometry & | geom, | ||
| int | band | ||
| ) |
Referenced by ERF::WarnSteepTerrainAtOpenFaces().


| std::string erf_terrain_file::OpenFaceSlopeWarning | ( | int | lev, |
| int | band, | ||
| const amrex::Array< amrex::Real, 4 > & | slopes, | ||
| const amrex::Array< bool, 4 > & | open, | ||
| const amrex::Array< std::string, 4 > & | bc_names | ||
| ) |
Warning text for the inflow and outflow faces of one level whose band slope (from FaceBandSlopes) exceeds open_face_slope_warn, or an empty string if there is none. The caller prints it only when no steep-terrain option is on at that level.
| [in] | lev | level, for the text |
| [in] | band | band width in cells, for the text |
| [in] | slopes | band slopes in the order xlo, xhi, ylo, yhi (-1 = no cells) |
| [in] | open | whether each face is an inflow or outflow face |
| [in] | bc_names | boundary type of each face, for the text |
| std::string erf_terrain_file::OpenFaceSlopeWarning | ( | int | lev, |
| int | band, | ||
| const Array< Real, 4 > & | slopes, | ||
| const Array< bool, 4 > & | open, | ||
| const Array< std::string, 4 > & | bc_names | ||
| ) |
Referenced by ERF::WarnSteepTerrainAtOpenFaces().

| const HeightTable& erf_terrain_file::ReadHeightTable | ( | const std::string & | fname, |
| bool | is_usgs, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | prob_lo, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | prob_hi, | ||
| bool | require_domain_coverage = true |
||
| ) |
The height table in file fname, read, checked (TableProblem) and summarised (TableSummary) on the I/O rank the first time the file is asked for, then broadcast; later calls return the same table without reading the file again. Aborts, naming the file and the line, on a file that cannot be read as the layout says.
| [in] | fname | file name |
| [in] | is_usgs | USGS layout |
| [in] | prob_lo,prob_hi | domain extent, for the coverage check |
| [in] | require_domain_coverage | false for local building patches; all other checks remain |
| const HeightTable& erf_terrain_file::ReadHeightTable | ( | const std::string & | fname, |
| bool | is_usgs, | ||
| const GpuArray< Real, AMREX_SPACEDIM > & | prob_lo, | ||
| const GpuArray< Real, AMREX_SPACEDIM > & | prob_hi, | ||
| bool | require_domain_coverage | ||
| ) |
Referenced by ProblemBase::read_custom_terrain().

| std::string erf_terrain_file::TableProblem | ( | bool | is_usgs, |
| int | nx, | ||
| int | ny, | ||
| const amrex::Vector< amrex::Real > & | x, | ||
| const amrex::Vector< amrex::Real > & | y, | ||
| const amrex::Vector< amrex::Real > & | z, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | prob_lo, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | prob_hi, | ||
| bool | require_domain_coverage = true |
||
| ) |
The first problem found in a height table, or an empty string if there is none. Problems: fewer points than the layout needs (ERF format: one in each direction, USGS: two; one value in a direction is not checked further), list sizes that do not match nx and ny, a value that is not finite, x or y values that do not increase strictly (in the USGS format: the x values of each row, and the y values from row to row), and a table that does not cover the domain: each end of the x and y lists may stop at most one table spacing inside prob_lo or prob_hi (the layout of a file with one height per cell starting at prob_lo), with an allowance of 1e-3 of that spacing for rounded coordinates. Beyond the table the reader only extends the heights from its edge: linearly before the first point, and (ERF format) by holding the last value after the last point; USGS extends linearly at both ends. Setting require_domain_coverage to false skips only the coverage check, for building files that describe a local patch. Coordinate ordering and all format checks still apply.
| [in] | is_usgs | USGS layout (x varies fastest, one x per point) |
| [in] | nx,ny | table size |
| [in] | x,y,z | table coordinates and heights |
| [in] | prob_lo,prob_hi | domain extent |
| [in] | require_domain_coverage | whether the table must cover the domain |
| std::string erf_terrain_file::TableProblem | ( | bool | is_usgs, |
| int | nx, | ||
| int | ny, | ||
| const Vector< Real > & | x, | ||
| const Vector< Real > & | y, | ||
| const Vector< Real > & | z, | ||
| const GpuArray< Real, AMREX_SPACEDIM > & | prob_lo, | ||
| const GpuArray< Real, AMREX_SPACEDIM > & | prob_hi, | ||
| bool | require_domain_coverage | ||
| ) |

| std::string erf_terrain_file::TableSummary | ( | const std::string & | fname, |
| bool | is_usgs, | ||
| int | nx, | ||
| int | ny, | ||
| const amrex::Vector< amrex::Real > & | x, | ||
| const amrex::Vector< amrex::Real > & | y, | ||
| const amrex::Vector< amrex::Real > & | z | ||
| ) |
Text describing a valid height table: its size and extent, the order its heights are read in, where the lowest and highest heights sit, and the largest slopes |dh/dx| and |dh/dy| between neighbouring table points with where they sit. Meant to be printed once per file, so that a transposed or mis-ordered file can be spotted at start-up.
| [in] | fname | file name, for the first line |
| [in] | is_usgs | USGS layout |
| [in] | nx,ny | table size |
| [in] | x,y,z | table coordinates and heights (must pass TableProblem) |
| std::string erf_terrain_file::TableSummary | ( | const std::string & | fname, |
| bool | is_usgs, | ||
| int | nx, | ||
| int | ny, | ||
| const Vector< Real > & | x, | ||
| const Vector< Real > & | y, | ||
| const Vector< Real > & | z | ||
| ) |
|
constexpr |
Terrain slope |grad h| above which a band next to an inflow or outflow face is reported.
Referenced by OpenFaceSlopeWarning(), and ERF::WarnSteepTerrainAtOpenFaces().