|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
#include <AMReX.H>#include <AMReX_Geometry.H>#include <AMReX_MultiFab.H>#include <ERF_IndexDefines.H>#include <ERF_Constants.H>

Go to the source code of this file.
Enumerations | |
| enum class | FineTerrain { None , Interpolate , Transform } |
Functions | |
| void | init_default_zphys (int lev, const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &z_phys_cc, amrex::Real z_offset=zero) |
| void | init_zlevels (amrex::Vector< amrex::Vector< amrex::Real >> &zlevels_stag, amrex::Vector< amrex::Vector< amrex::Real >> &stretched_dz_h, amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real >> &stretched_dz_d, amrex::Vector< amrex::Geometry > const &geom, amrex::Vector< amrex::IntVect > const &ref_ratio, const amrex::Real grid_stretching_ratio, const amrex::Real zsurf, const amrex::Real dz0) |
| FineTerrain | which_fine_terrain () |
| void | make_terrain_fitted_coords (int lev, const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::Vector< amrex::Real > const &z_levels_h, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type, FineTerrain fine_terrain=FineTerrain::None, amrex::MultiFab const *z_phys_interp=nullptr) |
| void | init_which_terrain_grid (int lev, const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::Vector< amrex::Real > const &z_levels_h, FineTerrain fine_terrain=FineTerrain::None, amrex::MultiFab const *z_phys_interp=nullptr) |
| void | init_fine_terrain_grid (int lev, const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::Vector< amrex::Real > const &z_levels_h, FineTerrain fine_terrain, amrex::MultiFab const *z_phys_interp) |
| amrex::Real | get_dzmin_terrain (amrex::MultiFab &z_phys_nd) |
| void | update_stretched_dz (int lev, amrex::Vector< amrex::Vector< amrex::Real >> const &zlevels_stag, amrex::Vector< amrex::Vector< amrex::Real >> &stretched_dz_h, amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real >> &stretched_dz_d) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_zeta_AtCellCenter (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_xi_AtCellCenter (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_eta_AtCellCenter (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_zeta_AtIface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_xi_AtIface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_eta_AtIface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_zeta_AtJface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_xi_AtJface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_eta_AtJface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_zeta_AtKface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_xi_AtKface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_eta_AtKface (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_zeta_AtEdgeCenterK (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_xi_AtEdgeCenterK (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_eta_AtEdgeCenterK (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_zeta_AtEdgeCenterJ (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_xi_AtEdgeCenterJ (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_eta_AtEdgeCenterJ (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_zeta_AtEdgeCenterI (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_xi_AtEdgeCenterI (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_h_eta_AtEdgeCenterI (const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_Z_AtCellCenter (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_Z_AtWFace (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_Zrel_AtCellCenter (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &z_nd) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | OmegaFromW (int &i, int &j, int &k, amrex::Real w, const amrex::Array4< const amrex::Real > &u_arr, const amrex::Array4< const amrex::Real > &v_arr, const amrex::Array4< const amrex::Real > &mf_u, const amrex::Array4< const amrex::Real > &mf_v, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real | WFromOmega (int &i, int &j, int &k, amrex::Real omega, const amrex::Array4< const amrex::Real > &u_arr, const amrex::Array4< const amrex::Real > &v_arr, const amrex::Array4< const amrex::Real > &mf_u, const amrex::Array4< const amrex::Real > &mf_v, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | rotate_scalar_flux (const int &i, const int &j, const int &klo, const amrex::Real &flux, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv, const amrex::Array4< const amrex::Real > &zphys_arr, const amrex::Array4< amrex::Real > &phi1_arr, const amrex::Array4< amrex::Real > &phi2_arr, const amrex::Array4< amrex::Real > &phi3_arr) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | rotate_stress_tensor (const int &i, const int &j, const int &klo, const amrex::Real &flux, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv, const amrex::Array4< const amrex::Real > &zphys_arr, const amrex::Array4< const amrex::Real > &u_arr, const amrex::Array4< const amrex::Real > &v_arr, const amrex::Array4< const amrex::Real > &w_arr, const amrex::Array4< amrex::Real > &tau11_arr, const amrex::Array4< amrex::Real > &tau22_arr, const amrex::Array4< amrex::Real > &tau33_arr, const amrex::Array4< amrex::Real > &tau12_arr, const amrex::Array4< amrex::Real > &tau21_arr, const amrex::Array4< amrex::Real > &tau13_arr, const amrex::Array4< amrex::Real > &tau31_arr, const amrex::Array4< amrex::Real > &tau23_arr, const amrex::Array4< amrex::Real > &tau32_arr) |
|
strong |
How the terrain-fitted mesh on a fine level is built when erf.terrain_smoothing != 0.
The STF and Sullivan TF transformations are not defined on a level that does not reach the top of the domain, so on a fine level we instead start from the mesh interpolated from the coarse level. A caller that has done that interpolation – and, for Transform, has also written the fine-resolution terrain into the k=0 slab and saved the pre-overwrite field – says so by passing anything other than None. Every other caller keeps the historical behavior of aborting, because it has not prepared z_phys_nd in a way this path can use.
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtCellCenter | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the eta metric term at the cell center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by Compute_InvDt_Compressible(), ComputeStrain_T(), ComputeStressConsVisc_T(), ComputeStressVarVisc_T(), ERFPhysBCFunct_cons::impose_vertical_cons_bcs(), rotate_scalar_flux(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), and ERF::Write3DPlotFile().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtEdgeCenterI | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the eta metric term at the i-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ComputeStrain_T(), ComputeStressConsVisc_T(), and ComputeStressVarVisc_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtEdgeCenterJ | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the eta metric term at the j-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ComputeStressConsVisc_T(), and ComputeStressVarVisc_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtEdgeCenterK | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the eta metric term at the k-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ComputeStrain_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtIface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the eta metric term at the i-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ERFPhysBCFunct_u::impose_vertical_xvel_bcs(), and rotate_stress_tensor().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtJface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the eta metric term at the j-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by DiffusionSrcForState_T(), erf_substep_MT(), erf_substep_T(), ERFPhysBCFunct_v::impose_vertical_yvel_bcs(), ERF::poisson_wall_dist(), and MOSTAverage::set_rotated_fields().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtKface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the eta metric term at the k-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by DiffusionSrcForState_T(), and ERF::poisson_wall_dist().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtCellCenter | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the xi metric term at the cell center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by Compute_InvDt_Compressible(), ComputeStrain_T(), ComputeStressConsVisc_T(), ComputeStressVarVisc_T(), ERFPhysBCFunct_cons::impose_vertical_cons_bcs(), rotate_scalar_flux(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), and ERF::Write3DPlotFile().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtEdgeCenterI | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the xi metric term at the i-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ComputeStressConsVisc_T(), and ComputeStressVarVisc_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtEdgeCenterJ | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the xi metric term at the j-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ComputeStrain_T(), ComputeStressConsVisc_T(), and ComputeStressVarVisc_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtEdgeCenterK | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the xi metric term at the k-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ComputeStrain_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtIface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the xi metric term at the i-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by DiffusionSrcForState_T(), erf_substep_MT(), erf_substep_T(), ERFPhysBCFunct_u::impose_vertical_xvel_bcs(), ERF::poisson_wall_dist(), rotate_stress_tensor(), and MOSTAverage::set_rotated_fields().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtJface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the xi metric term at the j-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by ERFPhysBCFunct_v::impose_vertical_yvel_bcs().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtKface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the xi metric term at the k-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by DiffusionSrcForState_T(), and ERF::poisson_wall_dist().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtCellCenter | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the zeta metric term at the cell center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by Compute_InvDt_Anelastic(), Compute_InvDt_Compressible(), MOSTAverage::compute_region_averages(), ComputeDiffusivityMRF(), ComputeDiffusivityMYJ(), ComputeDiffusivityMYNN25(), ComputeDiffusivityMYNNEDMF(), ComputeDiffusivityYSU(), ComputeDiffusivityYSUNew(), ComputeTurbulentViscosityLES(), ComputeTurbulentViscosityRANS(), ERF::estTimeStep(), ERFPhysBCFunct_cons::impose_vertical_cons_bcs(), ERF::poisson_wall_dist(), and ERF::Write3DPlotFile().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterI | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the zeta metric term at the i-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by AdvectionSrcForMom_TF(), AdvectionSrcForZMom(), ComputeStrain_T(), ComputeStressConsVisc_T(), and ComputeStressVarVisc_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterJ | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the zeta metric term at the j-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by AdvectionSrcForMom_TF(), AdvectionSrcForZMom(), ComputeStrain_T(), ComputeStressConsVisc_T(), and ComputeStressVarVisc_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterK | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the zeta metric term at the k-edge center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by AdvectionSrcForMom_TF(), AdvectionSrcForXMom(), AdvectionSrcForYMom(), ComputeStressConsVisc_T(), and ComputeStressVarVisc_T().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtIface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the zeta metric term at the i-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by erf_make_tau_terms(), erf_slow_rhs_pre(), erf_substep_MT(), erf_substep_T(), ERFPhysBCFunct_u::impose_vertical_xvel_bcs(), ERF::poisson_wall_dist(), and rotate_stress_tensor().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtJface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the zeta metric term at the j-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by erf_make_tau_terms(), erf_slow_rhs_pre(), erf_substep_MT(), erf_substep_T(), ERFPhysBCFunct_v::impose_vertical_yvel_bcs(), and ERF::poisson_wall_dist().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtKface | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | cellSizeInv, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the zeta metric term at the k-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | cellSizeInv | Inverse cell spacing. |
| [in] | z_nd | Nodal physical height field. |
Referenced by compute_gradp_interpz(), compute_gradp_z(), DiffusionSrcForState_T(), ImplicitDiffForMomLU_T(), ImplicitDiffForStateLU_T(), and ERF::poisson_wall_dist().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_Z_AtCellCenter | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the physical height at the cell center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | z_nd | Nodal physical height field. |
Referenced by sea_level_pressure_diagnostics::fill_sea_level_pressure(), ERFPhysBCFunct_cons::impose_vertical_cons_bcs(), SurfaceLayer::init_tke_from_ustar(), and plotfile2d::sampled_field_value().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_Z_AtWFace | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the physical height at the W-face.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | z_nd | Nodal physical height field. |
Referenced by DiffusionSrcForState_T(), sea_level_pressure_diagnostics::fill_sea_level_pressure(), get_dzmin_terrain(), OmegaFromW(), WFromOmega(), and ERF::Write2DPlotFile().

| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_Zrel_AtCellCenter | ( | const int & | i, |
| const int & | j, | ||
| const int & | k, | ||
| const amrex::Array4< const amrex::Real > & | z_nd | ||
| ) |
Compute the relative height above the terrain surface at the cell center.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | z_nd | Nodal physical height field. |
Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityMYJ(), ComputeDiffusivityMYNN25(), ComputeDiffusivityMYNNEDMF(), ComputeDiffusivityYSU(), ComputeDiffusivityYSUNew(), near_surface_diagnostics::fill(), SurfaceLayer::fill_qsurf_with_qsat(), and plotfile2d::sampled_field_value().

| amrex::Real get_dzmin_terrain | ( | amrex::MultiFab & | z_phys_nd | ) |
Compute the minimum vertical spacing with terrain.
| [in] | z_phys_nd | Nodal physical height field. |
| void init_default_zphys | ( | int | lev, |
| const amrex::Geometry & | geom, | ||
| amrex::MultiFab & | z_phys_nd, | ||
| amrex::MultiFab & | z_phys_cc, | ||
| amrex::Real | z_offset = zero |
||
| ) |
Routine to define default z_phys_nd and z_phys_cc
| void init_fine_terrain_grid | ( | int | lev, |
| const amrex::Geometry & | geom, | ||
| amrex::MultiFab & | z_phys_nd, | ||
| amrex::Vector< amrex::Real > const & | z_levels_h, | ||
| FineTerrain | fine_terrain, | ||
| amrex::MultiFab const * | z_phys_interp | ||
| ) |
Finish the terrain-fitted mesh on a fine level whose interior was set by interpolation from the coarse level (erf.terrain_smoothing != 0).
For FineTerrain::Transform this adds the fine-resolution terrain as a correction that decays linearly to zero at the top of the fine grids. For both modes it then fills the nodes outside the lateral domain boundary and the layer below the surface, which init_which_terrain_grid()'s BTF branch would otherwise have filled.
| [in] | lev | Level index. |
| [in] | geom | Geometry information. |
| [in,out] | z_phys_nd | Nodal physical height field. |
| [in] | z_levels_h | Host z-levels. |
| [in] | fine_terrain | Interpolate or Transform. |
| [in] | z_phys_interp | Mesh interpolated from the coarse level; see above. |
| void init_which_terrain_grid | ( | int | lev, |
| const amrex::Geometry & | geom, | ||
| amrex::MultiFab & | z_phys_nd, | ||
| amrex::Vector< amrex::Real > const & | z_levels_h, | ||
| FineTerrain | fine_terrain = FineTerrain::None, |
||
| amrex::MultiFab const * | z_phys_interp = nullptr |
||
| ) |
Initialize the terrain grid mapping.
| [in] | lev | Level index. |
| [in] | geom | Geometry information. |
| [out] | z_phys_nd | Nodal physical height field. |
| [in] | z_levels_h | Host z-levels. |
| [in] | fine_terrain | How a fine level with terrain_smoothing != 0 is to be built. |
| [in] | z_phys_interp | Mesh interpolated from the coarse level; see above. |
| void init_zlevels | ( | amrex::Vector< amrex::Vector< amrex::Real >> & | zlevels_stag, |
| amrex::Vector< amrex::Vector< amrex::Real >> & | stretched_dz_h, | ||
| amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real >> & | stretched_dz_d, | ||
| amrex::Vector< amrex::Geometry > const & | geom, | ||
| amrex::Vector< amrex::IntVect > const & | ref_ratio, | ||
| const amrex::Real | grid_stretching_ratio, | ||
| const amrex::Real | zsurf, | ||
| const amrex::Real | dz0 | ||
| ) |
Utility routines for constructing terrain metric terms Initialize staggered z-levels and stretched vertical spacing.
| [out] | zlevels_stag | Staggered z-levels. |
| [out] | stretched_dz_h | Host stretched vertical spacing. |
| [out] | stretched_dz_d | Device stretched vertical spacing. |
| [in] | geom | Geometry information. |
| [in] | ref_ratio | Refinement ratios. |
| [in] | grid_stretching_ratio | Ratio for grid stretching. |
| [in] | zsurf | Surface height. |
| [in] | dz0 | Initial vertical spacing. |
| void make_terrain_fitted_coords | ( | int | lev, |
| const amrex::Geometry & | geom, | ||
| amrex::MultiFab & | z_phys_nd, | ||
| amrex::Vector< amrex::Real > const & | z_levels_h, | ||
| amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > & | phys_bc_type, | ||
| FineTerrain | fine_terrain = FineTerrain::None, |
||
| amrex::MultiFab const * | z_phys_interp = nullptr |
||
| ) |
Construct terrain-fitted coordinates.
| [in] | lev | Level index. |
| [in] | geom | Geometry information. |
| [out] | z_phys_nd | Nodal physical height field. |
| [in] | z_levels_h | Host z-levels. |
| [in] | phys_bc_type | Physical boundary condition types. |
| [in] | fine_terrain | How a fine level with terrain_smoothing != 0 is to be built. |
| [in] | z_phys_interp | Mesh interpolated from the coarse level before the fine terrain was written into the k=0 slab; required by, and only used for, FineTerrain::Transform. |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real OmegaFromW | ( | int & | i, |
| int & | j, | ||
| int & | k, | ||
| amrex::Real | w, | ||
| const amrex::Array4< const amrex::Real > & | u_arr, | ||
| const amrex::Array4< const amrex::Real > & | v_arr, | ||
| const amrex::Array4< const amrex::Real > & | mf_u, | ||
| const amrex::Array4< const amrex::Real > & | mf_v, | ||
| const amrex::Array4< const amrex::Real > & | z_nd, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dxInv | ||
| ) |
Compute the contravariant vertical velocity omega from w.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | w | Vertical velocity. |
| [in] | u_arr | X-velocity array. |
| [in] | v_arr | Y-velocity array. |
| [in] | mf_u | X-velocity map factor. |
| [in] | mf_v | Y-velocity map factor. |
| [in] | z_nd | Nodal physical height field. |
| [in] | dxInv | Inverse cell spacing. |
Referenced by erf_make_tau_terms(), erf_slow_rhs_pre(), erf_substep_MT(), erf_substep_T(), ERF::estTimeStep(), and ERF::project_momenta().


| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void rotate_scalar_flux | ( | const int & | i, |
| const int & | j, | ||
| const int & | klo, | ||
| const amrex::Real & | flux, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dxInv, | ||
| const amrex::Array4< const amrex::Real > & | zphys_arr, | ||
| const amrex::Array4< amrex::Real > & | phi1_arr, | ||
| const amrex::Array4< amrex::Real > & | phi2_arr, | ||
| const amrex::Array4< amrex::Real > & | phi3_arr | ||
| ) |
Rotate a scalar flux vector into terrain-following coordinates.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | klo | z-index |
| [in] | flux | Scalar flux value. |
| [in] | dxInv | Inverse cell spacing. |
| [in] | zphys_arr | Physical height field. |
| [out] | phi1_arr | Rotated flux component 1. |
| [out] | phi2_arr | Rotated flux component 2. |
| [out] | phi3_arr | Rotated flux component 3. |
Referenced by SurfaceLayer::compute_SurfaceLayer_bcs().


| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void rotate_stress_tensor | ( | const int & | i, |
| const int & | j, | ||
| const int & | klo, | ||
| const amrex::Real & | flux, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dxInv, | ||
| const amrex::Array4< const amrex::Real > & | zphys_arr, | ||
| const amrex::Array4< const amrex::Real > & | u_arr, | ||
| const amrex::Array4< const amrex::Real > & | v_arr, | ||
| const amrex::Array4< const amrex::Real > & | w_arr, | ||
| const amrex::Array4< amrex::Real > & | tau11_arr, | ||
| const amrex::Array4< amrex::Real > & | tau22_arr, | ||
| const amrex::Array4< amrex::Real > & | tau33_arr, | ||
| const amrex::Array4< amrex::Real > & | tau12_arr, | ||
| const amrex::Array4< amrex::Real > & | tau21_arr, | ||
| const amrex::Array4< amrex::Real > & | tau13_arr, | ||
| const amrex::Array4< amrex::Real > & | tau31_arr, | ||
| const amrex::Array4< amrex::Real > & | tau23_arr, | ||
| const amrex::Array4< amrex::Real > & | tau32_arr | ||
| ) |
Rotate the stress tensor for the MOST model.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | klo | z-index |
| [in] | flux | Flux value used for rotation. |
| [in] | dxInv | Inverse cell spacing. |
| [in] | zphys_arr | Physical height field. |
| [in] | u_arr | X-velocity array. |
| [in] | v_arr | Y-velocity array. |
| [in] | w_arr | Z-velocity array. |
| [out] | tau11_arr | Stress component tau11. |
| [out] | tau22_arr | Stress component tau22. |
| [out] | tau33_arr | Stress component tau33. |
| [out] | tau12_arr | Stress component tau12. |
| [out] | tau21_arr | Stress component tau21. |
| [out] | tau13_arr | Stress component tau13. |
| [out] | tau31_arr | Stress component tau31. |
| [out] | tau23_arr | Stress component tau23. |
| [out] | tau32_arr | Stress component tau32. |
Referenced by SurfaceLayer::compute_SurfaceLayer_bcs().


| void update_stretched_dz | ( | int | lev, |
| amrex::Vector< amrex::Vector< amrex::Real >> const & | zlevels_stag, | ||
| amrex::Vector< amrex::Vector< amrex::Real >> & | stretched_dz_h, | ||
| amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real >> & | stretched_dz_d | ||
| ) |
Re-derive the stretched vertical spacing at one level from the nominal z-levels.
init_zlevels() fills both zlevels_stag and stretched_dz_* together, but zlevels_stag can be replaced after construction (init_from_wrfinput() does this when erf.avg_grid_faces_to_nodes = false, and restart reads it back from the checkpoint). Call this whenever zlevels_stag[lev] changes so that the cell heights never drift out of sync with the levels they are supposed to describe.
| [in] | lev | Level index. |
| [in] | zlevels_stag | Staggered z-levels (the source of truth). |
| [out] | stretched_dz_h | Host stretched vertical spacing. |
| [out] | stretched_dz_d | Device stretched vertical spacing. |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real WFromOmega | ( | int & | i, |
| int & | j, | ||
| int & | k, | ||
| amrex::Real | omega, | ||
| const amrex::Array4< const amrex::Real > & | u_arr, | ||
| const amrex::Array4< const amrex::Real > & | v_arr, | ||
| const amrex::Array4< const amrex::Real > & | mf_u, | ||
| const amrex::Array4< const amrex::Real > & | mf_v, | ||
| const amrex::Array4< const amrex::Real > & | z_nd, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dxInv | ||
| ) |
Compute the vertical velocity w from the contravariant omega.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | omega | Contravariant vertical velocity. |
| [in] | u_arr | X-velocity array. |
| [in] | v_arr | Y-velocity array. |
| [in] | mf_u | X-velocity map factor. |
| [in] | mf_v | Y-velocity map factor. |
| [in] | z_nd | Nodal physical height field. |
| [in] | dxInv | Inverse cell spacing. |
Referenced by erf_substep_MT(), erf_substep_T(), if(), ERFPhysBCFunct_w::impose_lateral_zvel_bcs(), ERFPhysBCFunct_w::impose_vertical_zvel_bcs(), ParallelFor(), and ERF::project_momenta().


| FineTerrain which_fine_terrain | ( | ) |
Read erf.amr_terrain_refinement and translate it into a FineTerrain.
Aborts on any value other than "interpolate" or "transform" so that a typo cannot silently select a path that leaves the fine mesh untransformed.
Translate erf.amr_terrain_refinement into a FineTerrain.
Referenced by ERF::init_zphys(), and ERF::remake_zphys().

