ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
SolverChoice Struct Reference

#include <ERF_DataStruct.H>

Collaboration diagram for SolverChoice:

Public Member Functions

void init_params (int max_level, std::string pp_prefix)
 Read solver-wide algorithmic options from the input parameter database. More...
 
void check_params (int max_level, const amrex::Vector< amrex::Geometry > &geom_vect, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > phys_bc_type)
 Validate solver options after geometry and boundary conditions are known. More...
 
void display (int max_level, std::string pp_prefix)
 Print the configured solver, physics, and transport options. More...
 
void build_coriolis_forcings_const_lat (std::string pp_prefix)
 Build constant-latitude Coriolis forcing parameters. More...
 
bool read_int_string (int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
 Read one integer value or one value per AMR level. More...
 
bool if_drag_in_projection (int lev) const noexcept
 
bool use_building_immersed_forcing (const amrex::Geometry &geom) const noexcept
 
bool level_substeps (int lev) const noexcept
 
bool rayleigh_fast_uvT (int lev) const noexcept
 
bool rayleigh_fast_w (int lev) const noexcept
 
bool zcc_vertical_metric (int lev) const noexcept
 
bool rayleigh_implicit_w (int lev) const noexcept
 
bool rayleigh_slow_implicit_w (int lev) const noexcept
 
bool forest_fast (int lev) const noexcept
 
bool immersed_forcing_fast (int lev) const noexcept
 
bool use_perturbation (int lev) const
 Query whether any turbulent perturbation mode is enabled on a level. More...
 
bool use_direct_perturbation (int lev) const
 Query whether direct turbulent perturbations are enabled on a level. More...
 
bool use_source_perturbation (int lev) const
 Query whether source-term turbulent perturbations are enabled on a level. More...
 
bool use_wvel_perturbation (int lev) const
 Query whether vertical-velocity CPM perturbations are enabled on a level. More...
 
bool uses_shoc_family () const noexcept
 Query whether any SHOC-family PBL scheme is active. More...
 
bool host_owns_vertical_momentum_diffusion () const noexcept
 Test whether the host owns momentum diffusion. More...
 
bool host_owns_vertical_scalar_diffusion () const noexcept
 Test whether the host owns scalar diffusion. More...
 
bool pbl_suppresses_microphysics_condensation () const noexcept
 Query whether the active PBL scheme suppresses microphysics condensation. More...
 
bool any_perturbation () const
 Query whether any level uses a turbulent perturbation mode. More...
 
int perturbation_pblh_level (int lev) const
 
bool rad_uses_interface () const
 True for the models that run through the IRadiation interface (RRTMGP, Simple); the two-stream model has its own class. More...
 
bool rad_feeds_lsm () const
 True when the radiation model's outputs feed the land model (downwelling shortwave, downwelling longwave, solar zenith angle). RRTMGP writes them for any land model through lsm_output_ptrs; the two-stream model writes the broadband three for Noah-MP only (TwoStreamRadiation::write_land_forcing), since SLM wants the visible / near-infrared direct / diffuse split it does not compute. Both register the outputs in ERF::init_stuff and write them in ERF::advance_radiation; every site that encodes that rule must use this predicate so wiring another model in (e.g. Simple, which already runs through the interface) is one edit. More...
 

Static Public Member Functions

static void set_mesh_type (MeshType new_mesh_type)
 Override the globally selected mesh type. More...
 

Public Attributes

AdvChoice advChoice
 Advection-related options. More...
 
DiffChoice diffChoice
 Diffusion-related options. More...
 
DampingChoice dampingChoice
 Damping-related options. More...
 
SpongeChoice spongeChoice
 Sponge-layer options. More...
 
amrex::Vector< TurbChoice > turbChoice
 Turbulence options for each AMR level. More...
 
EBChoice ebChoice
 Embedded-boundary options. More...
 
RadChoice radChoice
 
RRTMGPSolarChoice rrtmgpSolarChoice
 
TopographicShadingChoice topographicChoice
 
int force_stage1_single_substep = 1
 Flag forcing a single substep in the first RK stage. More...
 
amrex::Vector< CompressibilityType > compressibility_type
 Per-level compressibility (FullyCompressible, Anelastic or PseudoIncompressible). More...
 
amrex::Vector< TimesteppingType > timestepping_type
 Per-level time integrator (RK3_ImplicitSubstep, RK3_NoSubstepping, RK2 or MidPoint). More...
 
amrex::Vector< int > fixed_density
 Per-level flag selecting fixed-density treatment; always 1 at an anelastic level and 0 at a pseudo-incompressible level. More...
 
amrex::Vector< int > project_initial_velocity
 Per-level flag for projecting the initial velocity. More...
 
amrex::Vector< int > buoyancy_type
 Per-level buoyancy formulation selector. More...
 
amrex::Vector< int > is_land
 Per-level land/water selector. More...
 
bool substepping_diag = false
 Whether to emit extra CFL diagnostics for compressible substepping. More...
 
amrex::Real beta_s = amrex::Real(0.1)
 Time off-centering coefficient for forward weighting. More...
 
int face_sync_int = 1
 
bool use_variable_beta_s = false
 Whether beta_s varies on the w-faces with the terrain slope and acoustic Courant number. More...
 
bool auto_variable_beta_s = true
 Whether erf.use_variable_beta_s may be turned on automatically (it is not set in the inputs). More...
 
amrex::Real beta_d = amrex::Real(0.1)
 Divergence damping coefficient used in the acoustic substepping. More...
 
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
 Per-level, per-stage implicit vertical diffusion factors. More...
 
bool implicit_thermal_diffusion = true
 Whether implicit vertical thermal diffusion is included. More...
 
bool implicit_moisture_diffusion = true
 Whether implicit vertical moisture diffusion is included. More...
 
bool implicit_ke_diffusion = true
 Whether implicit vertical TKE diffusion is included. More...
 
bool implicit_momentum_diffusion = true
 Whether implicit vertical momentum diffusion is included. More...
 
bool implicit_before_substep = true
 Whether implicit diffusion is applied before acoustic substepping. More...
 
bool implicit_terrain_metric = false
 Whether the compact terrain-metric part of the vertical diffusion is solved implicitly. More...
 
int ncorr = 1
 Number of projection correction iterations. More...
 
std::string wall_dist_type = "poisson"
 
TerrainPoissonSolver terrain_poisson_solver = TerrainPoissonSolver::gmres_fft
 Projection solver on a terrain-fitted mesh: gmres_fft (default), mlmg or gmres_mlmg. More...
 
amrex::Real poisson_abstol = amrex::Real(1e-8)
 Absolute tolerance for the Poisson solve. More...
 
amrex::Real poisson_reltol = amrex::Real(1e-8)
 Relative tolerance for the Poisson solve. More...
 
amrex::Real pi_drift_factor = myhalf
 
bool test_mapfactor = false
 Whether to use test map scale factors. More...
 
amrex::Real test_mapfactor_amp = amrex::Real(0)
 Amplitude of the spatially varying test map scale factors on level 0 (0: not used). More...
 
GradpType gradp_type = GradpType::ChainRule
 Terrain-fitted horizontal pressure-gradient formulation. More...
 
bool gradp_2nd_order_bndry = false
 Whether ChainRule takes dp/dz at the bottom and top from a second-order one-sided difference. More...
 
bool use_pert_pres_gradient = true
 Whether momentum equations use perturbational pressure gradients. More...
 
bool use_gravity = false
 Whether gravitational forcing is enabled. More...
 
bool use_coriolis = false
 Whether Coriolis forcing is enabled. More...
 
bool coriolis_3d = true
 Whether the three-dimensional Coriolis terms are included. More...
 
bool four_stream_radiation = false
 Whether the four-stream radiation approximation is enabled. More...
 
bool immersed_forcing_substep = false
 Whether immersed-forcing source terms are applied only during substeps. More...
 
bool forest_substep = false
 Whether canopy source terms are applied only during substeps. More...
 
amrex::Real if_Cd_momentum = amrex::Real(50.0)
 Immersed-forcing drag coefficient for momentum. More...
 
amrex::Real if_Cd_scalar = amrex::Real(10.0)
 Immersed-forcing drag coefficient for scalars. More...
 
bool if_implicit_drag = false
 
bool if_implicit_projection = false
 
amrex::Real if_z0 = amrex::Real(0.1)
 Immersed-forcing roughness length [m]. More...
 
amrex::Real if_surf_temp_flux = amrex::Real(1e-8)
 Immersed-forcing surface temperature flux [K m/s]. More...
 
amrex::Real if_init_surf_temp = zero
 Initial immersed-forcing surface temperature [K]. More...
 
amrex::Real if_surf_heating_rate = zero
 Immersed-forcing surface heating rate [K/hr]. More...
 
amrex::Real if_Olen_in = amrex::Real(1e-8)
 Input Obukhov length for immersed-forcing MOST [m]. More...
 
amrex::Real if_surf_moist_flux = zero
 
amrex::Real if_surf_moist = amrex::Real(-1.0)
 
bool if_use_most = false
 Whether immersed-forcing MOST is enabled. More...
 
bool if_snap_partial_cells = false
 
bool if_stability_correction = false
 Whether the immersed-forcing wall law applies the MOST similarity functions, in the momentum and the temperature kernels alike (off: the log law; a prescribed flux or Obukhov length still sets theta*). More...
 
similarity_funs most_sfuns
 
bool if_fraction_stress = false
 erf.if_wall_form = fraction_stress: the wall stress of ERF_ImmersedWallCell.H in the wall cell of each column, with the wall face closed to diffusion; false is the legacy MOST relaxation at fixed 0.5/1.5 dz (the default, unchanged). More...
 
int if_wall_face_spacing = 2
 Spacing the face above the fraction-stress wall cell differences over: 0 the cell height, 1 the centroid spacing, 2 (default) the log spacing (ib_wall::face_above_factor). More...
 
bool if_wall_tke = false
 Hold the k-eqn TKE of the fraction-stress wall cell at its flat-ground wall value (ib_wall::wall_tke), as erf.dirichlet_k does over flat ground. More...
 
amrex::Real if_wall_tke_time_factor = amrex::Real(1.0)
 1 (the default) pins the wall cell after every stage and in the implicit TKE solve; a larger value relaxes toward the wall value as a source over that many steps. More...
 
bool if_flat_wall_dissipation = false
 Partial fraction-stress wall cells dissipate TKE with the length scale of flat ground's first cell; on by default with the fraction-stress law. More...
 
amrex::Real if_ws_floor = 0.001
 Wind-speed floor [m/s] in the per-step change limit of the building wall-law forcing. More...
 
amrex::Real if_damp_alpha = 0.5
 Immersed-forcing damping coefficient. More...
 
amrex::Real if_stability_wind_floor = amrex::Real(0.0)
 Wind-speed floor [m/s] behind the friction velocity of the wall law's stability estimate (0: none). More...
 
amrex::Real if_psi_cap_factor = amrex::Real(1.0)
 Cap on psi_m in the immersed momentum wall law as a fraction of ln(z/z0) (1: none). More...
 
amrex::Real if_small_volfrac = amrex::Real(0.005)
 Immersed-forcing solid fraction below which a cell or face counts as fluid; read from eb2.small_volfrac (default 0.005), the same value the EB build uses. More...
 
std::string if_average_down = "plain"
 Cell average down over immersed-forcing levels: "plain" (the default, the plain cell average) or "fluid_mass" (the fine cells weighted by their fluid mass, coarse cells solid on their own level kept; see if_average_down in ERF_Utils.H). More...
 
amrex::Real if_cf_mismatch_warning = amrex::Real(0.75)
 Spread of the fine solid fractions under a coarse cell along a lateral coarse/fine face at or above which the start-up warning counts the cell (the levels describe the surface differently there); 0 turns the check off. More...
 
bool cf_loglaw_fill = false
 Share the flux of the first coarse face above a wall among its fine sub-faces at the lateral coarse/fine faces by ln(1 + z/z0) at their heights above the wall, instead of the linear interpolation; the immersed surface or a surface-layer bottom, constant dz. More...
 
amrex::Real cf_loglaw_z0 = amrex::Real(-1.0)
 Roughness length [m] of that share; by default erf.if_z0 with immersed forcing, else the inputs' erf.most.z0 or erf.zlo.most.z0 (0.1 m when neither is given). More...
 
bool use_lagged_delta_rt = true
 Whether to use lagged delta terms for moving terrain. More...
 
bool rebalance_wrf_input = true
 Whether to rebalance states from wrfinput and wrfbdy data. More...
 
amrex::Real gravity
 Effective gravitational acceleration. More...
 
amrex::Real c_p = Cp_d
 Specific heat at constant pressure for dry air [J/(kg-K)]. More...
 
amrex::Real rdOcp
 Ratio of dry-air gas constant to c_p. More...
 
amrex::Real grid_stretching_ratio = 0
 Vertical grid stretching ratio. More...
 
amrex::Real dz0 = zero
 Initial vertical grid spacing for stretched-grid setup. More...
 
amrex::Real coriolis_factor = zero
 Twice the planetary rotation rate used for Coriolis forcing. More...
 
amrex::Real cosphi = zero
 Cosine of the latitude used for Coriolis forcing. More...
 
amrex::Real sinphi = zero
 Sine of the latitude used for Coriolis forcing. More...
 
bool custom_rhotheta_forcing = false
 Whether custom rho-theta forcing is enabled. More...
 
bool custom_moisture_forcing = false
 Whether custom moisture forcing is enabled. More...
 
bool custom_w_subsidence = false
 Whether custom vertical subsidence is enabled. More...
 
bool do_theta_advection = true
 Whether custom vertical subsidence is applied to rho-theta. More...
 
bool do_mom_advection = true
 Whether custom vertical subsidence is applied to momentum. More...
 
bool custom_geostrophic_profile = false
 Whether a custom geostrophic wind profile is used. More...
 
bool custom_forcing_prim_vars = false
 Whether custom forcing operates on primitive variables. More...
 
bool spatial_rhotheta_forcing = false
 Whether spatially varying rho-theta forcing is enabled. More...
 
bool spatial_moisture_forcing = false
 Whether spatially varying moisture forcing is enabled. More...
 
bool nudging_from_input_sounding = false
 Whether solution fields are nudged toward input sounding data. More...
 
bool nudging_from_observations = false
 Whether solution fields are nudged toward observations at stations. More...
 
amrex::Real nudging_u_z1 = amrex::Real(-1.0e36)
 
amrex::Real nudging_u_z2 = amrex::Real(1.0e36)
 
amrex::Real nudging_t_z1 = zero
 
amrex::Real nudging_t_z2 = amrex::Real(10000.0)
 
amrex::Real nudging_q_z1 = zero
 
amrex::Real nudging_q_z2 = amrex::Real(10000.0)
 
bool nudging_u = true
 
bool nudging_t = true
 
bool nudging_q = true
 
bool large_scale_forcing = false
 
std::string lsf_file = ""
 
amrex::Real lsf_timescale = zero
 
bool use_rotate_surface_flux = false
 Whether MOST surface fluxes are rotated with terrain. More...
 
bool use_native_shoc = false
 Whether any level uses the native SHOC PBL scheme. More...
 
ShocTransportMode shoc_transport_mode = ShocTransportMode::StateUpdate
 
ShocMomentumTransport shoc_momentum_transport = ShocMomentumTransport::StateUpdate
 
bool transport_scalar = true
 Whether the passive scalar component is transported. More...
 
bool time_avg_vel = false
 Whether time-averaged velocity fields are output. More...
 
bool compute_mean_vars = false
 
std::string mean_vars_reset_mode = "plotfile"
 
amrex::Real mean_vars_reset_time = -one
 
amrex::Vector< int > zcc_vertical_metric_lev
 
amrex::Vector< PerturbationType > pert_type
 Turbulent perturbation type for each AMR level. More...
 
bool perturbation_auto {false}
 Select LES nests, using parent winds and a PBL ancestor's height, or the nearest LES ancestor's diagnostic when no PBL scheme is present. Defaults to true for WRFInput and Metgrid initialization, false otherwise. More...
 
amrex::Real perturbation_auto_period {amrex::Real(600.0)}
 Seconds between automatic parent-wind and PBL-height updates. More...
 
amrex::Real perturbation_auto_pbl_fraction {amrex::Real(0.9)}
 Fraction of the selected ancestor's PBL height occupied by perturbations. More...
 
bool use_num_diff {false}
 Whether sixth-order numerical diffusion is enabled. More...
 
amrex::Real num_diff_coeff {zero}
 Numerical diffusion coefficient after input scaling. More...
 
CouplingType coupling_type
 Multilevel coupling strategy. More...
 
MoistureType moisture_type
 Moisture or microphysics model. More...
 
int sbm_nbins {4}
 
int sbm_moment_mode {1}
 
int sbm_cloud_rain_split {-1}
 
bool sbm_amr_qualification_test {false}
 
bool sbm_amr_qualification_expect_zero_flow {false}
 
bool sbm_amr_qualification_expect_split {false}
 
bool sbm_amr_qualification_expect_empty_fine_rank {false}
 
bool sbm_amr_qualification_unique_profile {false}
 
bool sbm_amr_qualification_parent_store_fault {false}
 
bool sbm_amr_qualification_regrid {false}
 
bool sbm_amr_qualification_regrid_reject_fault {false}
 
bool sbm_amr_qualification_uniform_ratio {false}
 
bool sbm_test_native_qc_write_fault {false}
 
bool sbm_test_donor_cfl_fault {false}
 
bool sbm_budget_check {false}
 
amrex::Vector< amrex::Real > sbm_edges
 
amrex::Vector< amrex::Real > sbm_pivots
 
amrex::Vector< amrex::Real > sbm_fixture_initial_state
 
amrex::Vector< amrex::Real > sbm_fixture_initial_state_xhi
 
std::string sbm_particle_mixing {"None"}
 
amrex::Real sbm_particle_mixing_kh {0}
 
amrex::Real sbm_particle_mixing_kv {0}
 
bool sbm_particle_mixing_terrain_qualification {false}
 
WindFarmType windfarm_type
 Wind-farm model. More...
 
WindFarmLocType windfarm_loc_type
 Coordinate system for wind-farm turbine locations. More...
 
LandSurfaceType lsm_type
 Land-surface model. More...
 
UrbanType urban_type
 
amrex::Vector< int > urban_enabled_lev
 
RadiationType rad_type
 Radiation model. More...
 
bool use_coupled_sst = false
 
bool use_coupled_currents = false
 
ABLDriverType abl_driver_type
 Atmospheric boundary-layer driver type. More...
 
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
 Applied ABL pressure-gradient forcing vector. More...
 
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
 Applied geostrophic-wind forcing vector. More...
 
std::string abl_geo_wind_table
 Path to a time-varying geostrophic wind table. More...
 
bool have_geo_wind_profile {false}
 Whether a geostrophic wind profile has been configured. More...
 
bool variable_coriolis {false}
 Whether spatially varying Coriolis forcing is enabled. More...
 
int ave_plane {2}
 Averaging plane index used by diagnostics. More...
 
MoistureComponentIndices moisture_indices
 Index map of the moisture data carried by the active scheme: conserved-state components for the species and qmoist slots for the moist diagnostics. More...
 
bool moisture_tight_coupling {false}
 Whether moisture updates use tight coupling. More...
 
std::string windfarm_loc_table
 Wind-farm location table path. More...
 
std::string windfarm_spec_table
 Wind-farm turbine specification table path. More...
 
std::string windfarm_spec_table_extra
 Additional wind-farm turbine specification table path. More...
 
std::string windfarm_blade_table
 Wind-farm blade table path. More...
 
std::string windfarm_airfoil_tables
 Wind-farm airfoil table paths. More...
 
amrex::Real sampling_distance_by_D = -one
 Turbine inflow sampling distance normalized by rotor diameter. More...
 
amrex::Real turb_disk_angle = -one
 Turbine disk angle from the x axis [deg]. More...
 
amrex::Real windfarm_x_shift = -one
 Wind-farm x-coordinate shift. More...
 
amrex::Real windfarm_y_shift = -one
 Wind-farm y-coordinate shift. More...
 
amrex::Real bdy_nudge_factor = amrex::Real(10.0)
 Boundary sponge nudging factor. More...
 
bool use_wrf_bdy_density = true
 
amrex::Real bdy_rho_nudge_factor = amrex::Real(-1.0)
 
int bdy_moist_nudge_type = 1
 Moist-variable nudging strategy in boundary regions. More...
 
bool avg_grid_faces_to_nodes {false}
 
bool wrfinput_zlevels_from_file {true}
 
bool interp_atmos_from_coarse {false}
 
bool do_forest_drag {false}
 Whether forest canopy drag is enabled. More...
 
bool forest_biophysics {false}
 
bool forest_biophysics_heat {false}
 
amrex::Real forest_leaf_theta_fixed {-one}
 
CanopyTurbulence canopyTurb
 
amrex::Real const_massflux_u = zero
 Target constant mass flux in the x direction. More...
 
amrex::Real const_massflux_v = zero
 Target constant mass flux in the y direction. More...
 
amrex::Real const_massflux_tau = one
 Relaxation time scale for constant-mass-flux forcing. More...
 
amrex::Real const_massflux_layer_lo = amrex::Real(-bogus_large_value)
 Lower height of the constant-mass-flux forcing layer. More...
 
amrex::Real const_massflux_layer_hi = amrex::Real( bogus_large_value)
 Upper height of the constant-mass-flux forcing layer. More...
 
int massflux_klo {0}
 Lower vertical index for constant-mass-flux forcing. More...
 
int massflux_khi {0}
 Upper vertical index for constant-mass-flux forcing. More...
 
std::string hindcast_boundary_data_dir
 Directory containing hindcast lateral boundary data. More...
 
std::string hindcast_surface_data_dir
 Directory containing hindcast surface boundary data. More...
 
amrex::Real hindcast_data_interval_in_hrs = -one
 Time interval between hindcast data files [hr]. More...
 
bool hindcast_lateral_forcing = false
 Whether hindcast lateral forcing is enabled. More...
 
bool hindcast_surface_bcs = false
 Whether hindcast surface boundary conditions are enabled. More...
 
amrex::Real hindcast_lateral_sponge_strength = -one
 Strength of the hindcast lateral sponge layer. More...
 
amrex::Real hindcast_lateral_sponge_length = -one
 Length of the hindcast lateral sponge layer. More...
 
amrex::Real hindcast_zhi_sponge_strength = -one
 Strength of the upper hindcast sponge layer. More...
 
amrex::Real hindcast_zhi_sponge_length = -one
 Length of the upper hindcast sponge layer. More...
 
bool hindcast_zhi_sponge_damping = false
 Whether upper-boundary hindcast sponge damping is enabled. More...
 
bool io_hurricane_eye_tracker = false
 Whether hurricane-eye tracking output is enabled. More...
 
amrex::Real hurricane_eye_latitude = -1e10
 Initial hurricane-eye latitude. More...
 
amrex::Real hurricane_eye_longitude = -1e10
 Initial hurricane-eye longitude. More...
 
bool is_init_for_ensemble = false
 Whether initialization is for an ensemble simulation. More...
 
int n_ensemble = -1
 Number of ensemble members. More...
 
amrex::Real ens_pert_correlated_radius = -1.0
 Spatial correlation radius for ensemble perturbations. More...
 
amrex::Real ens_pert_amplitude = -1.0
 Amplitude of ensemble initialization perturbations. More...
 
std::string coarse_bckgnd_data_file
 Coarse background data file used for ensemble initialization. More...
 

Static Public Attributes

static InitType init_type = InitType::None
 Initial-condition source selected for the run. More...
 
static SoundingType sounding_type = SoundingType::Ideal
 Interpretation used for input sounding profiles. More...
 
static TerrainType terrain_type = TerrainType::None
 Terrain or immersed-boundary representation. More...
 
static bool flat_terrain = false
 Permit fixed-index planar averages after validating a flat fitted mesh. More...
 
static BuildingsType buildings_type = BuildingsType::None
 Building representation. More...
 
static bool buildings_fc_factories = false
 Use native face-centered EB factories for immersed buildings on a static fitted mesh. More...
 
static bool use_real_bcs = false
 Whether real-data lateral boundary conditions are used. More...
 
static MeshType mesh_type = MeshType::ConstantDz
 Vertical mesh representation. More...
 

Detailed Description

Container holding many of the algorithmic options and parameters

Member Function Documentation

◆ any_perturbation()

bool SolverChoice::any_perturbation ( ) const
inline

Query whether any level uses a turbulent perturbation mode.

Returns
True if at least one configured level has source, direct, CPM, or CPM_W perturbations.
3396  {
3397  for (const auto& type : pert_type) {
3398  if (type == PerturbationType::Source ||
3399  type == PerturbationType::Direct ||
3400  type == PerturbationType::CPM ||
3401  type == PerturbationType::CPM_W) {
3402  return true;
3403  }
3404  }
3405  return false;
3406  }
amrex::Vector< PerturbationType > pert_type
Turbulent perturbation type for each AMR level.
Definition: ERF_DataStruct.H:3423

Referenced by check_params().

Here is the caller graph for this function:

◆ build_coriolis_forcings_const_lat()

void SolverChoice::build_coriolis_forcings_const_lat ( std::string  pp_prefix)
inline

Build constant-latitude Coriolis forcing parameters.

Parameters
pp_prefixParmParse prefix for the ERF input namespace.
2909  {
2910  amrex::ParmParse pp(pp_prefix);
2911 
2912  // Read the rotational time period (in seconds)
2913  double rot_time_period = 86400.0;
2914  pp.queryAdd("rotational_time_period", rot_time_period);
2915 
2916  coriolis_factor = static_cast<amrex::Real>(4.0 * PI / rot_time_period);
2917 
2918  pp.queryAdd("coriolis_3d", coriolis_3d);
2919 
2920  // Convert to radians
2921  amrex::Real latitude_for_coriolis = amrex::Real(90.0);
2922  pp.queryAdd("latitude", latitude_for_coriolis);
2923  latitude_for_coriolis *= (PI/amrex::Real(180.));
2924  sinphi = std::sin(latitude_for_coriolis);
2925 
2926  // Note: cosphi defaults to 0
2927  if (coriolis_3d) {
2928  cosphi = std::cos(latitude_for_coriolis);
2929  }
2930 
2931  amrex::Print() << "Coriolis frequency, f = " << coriolis_factor * sinphi << " 1/s" << std::endl;
2932 
2933  if (abl_driver_type == ABLDriverType::GeostrophicWind) {
2934  // Read in the geostrophic wind -- we only use this to construct
2935  // the forcing term so no need to keep it
2936  amrex::Vector<amrex::Real> abl_geo_wind(3);
2937  pp.queryarr("abl_geo_wind",abl_geo_wind);
2938 
2939  if(!pp.queryAdd("abl_geo_wind_table",abl_geo_wind_table)) {
2940  abl_geo_forcing = {
2941  -coriolis_factor * (abl_geo_wind[1]*sinphi - abl_geo_wind[2]*cosphi),
2942  coriolis_factor * abl_geo_wind[0]*sinphi,
2943  -coriolis_factor * abl_geo_wind[0]*cosphi
2944  };
2945  } else {
2946  amrex::Print() << "NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
2947  }
2948  }
2949  }
ParmParse pp("prob")
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:46
amrex::Real coriolis_factor
Twice the planetary rotation rate used for Coriolis forcing.
Definition: ERF_DataStruct.H:3157
std::string abl_geo_wind_table
Path to a time-varying geostrophic wind table.
Definition: ERF_DataStruct.H:3496
amrex::Real cosphi
Cosine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:3158
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Applied geostrophic-wind forcing vector.
Definition: ERF_DataStruct.H:3495
ABLDriverType abl_driver_type
Atmospheric boundary-layer driver type.
Definition: ERF_DataStruct.H:3493
amrex::Real sinphi
Sine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:3159
bool coriolis_3d
Whether the three-dimensional Coriolis terms are included.
Definition: ERF_DataStruct.H:3097

Referenced by init_params().

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

◆ check_params()

void SolverChoice::check_params ( int  max_level,
const amrex::Vector< amrex::Geometry > &  geom_vect,
amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 >  phys_bc_type 
)
inline

Validate solver options after geometry and boundary conditions are known.

Parameters
max_levelMaximum AMR level configured for the run.
geom_vectGeometry for each AMR level.
phys_bc_typePhysical boundary-condition types.
2477  {
2478  // The weighted average down acts only where covered coarse cells are averaged down
2479  if (if_average_down == "fluid_mass") {
2480  if (max_level > 0 && coupling_type == CouplingType::TwoWay) {
2481  amrex::Print() << "Immersed forcing: erf.if_average_down = fluid_mass (the cell average down "
2482  << "over refined levels is weighted by the fluid mass of the fine cells)\n";
2483  } else {
2484  amrex::Warning("erf.if_average_down = fluid_mass has no effect without refined levels "
2485  "(amr.max_level > 0) and erf.coupling_type = TwoWay");
2486  }
2487  }
2488  if (if_fraction_stress) {
2489  // The face-above spacing factor is bounded only while z0 < dz/4 (then d2 > d1 for
2490  // every solid fraction and the fluid centroid of a full wall cell sits above 2 z0)
2491  for (int lev = 0; lev <= max_level; ++lev) {
2492  const amrex::Real dz = geom_vect[lev].CellSize(2);
2493  if (!(if_z0 < amrex::Real(0.25) * dz)) {
2494  amrex::Abort("erf.if_wall_form = fraction_stress needs erf.if_z0 < dz/4 on every level (level " +
2495  std::to_string(lev) + ": z0 = " + std::to_string(if_z0) + " m, dz = " +
2496  std::to_string(dz) + " m)");
2497  }
2498  }
2499  }
2501  bool any_keqn = false;
2502  for (int lev = 0; lev <= max_level; ++lev) {
2503  any_keqn = any_keqn || (turbChoice[lev].rans_type == RANSType::kEqn);
2504  }
2505  if (!any_keqn) {
2506  amrex::Abort("erf.if_wall_tke and erf.if_flat_wall_dissipation act on the k-eqn RANS closure: "
2507  "set erf.rans_type = kEqn on a level, or turn them off (erf.if_flat_wall_dissipation = false)");
2508  }
2509  }
2510  if (if_fraction_stress) {
2511  amrex::Print() << "Immersed forcing: erf.if_wall_form = fraction_stress (wall stress in the wall cell, "
2512  << "the wall face closed to diffusion; face spacing "
2513  << ((if_wall_face_spacing == 2) ? "log" : (if_wall_face_spacing == 1) ? "physical" : "grid")
2514  << ", wall TKE " << (if_wall_tke ? "on" : "off")
2515  << ", flat-wall dissipation " << (if_flat_wall_dissipation ? "on" : "off") << ")\n";
2517  amrex::Print() << "Immersed forcing: the moisture species see a closed wall "
2518  << "(no diffusion through the wall face, held in the solid); surface moisture condition: ";
2519  if (if_surf_moist_flux != zero) {
2520  amrex::Print() << "flux erf.if_surf_moist_flux = " << if_surf_moist_flux << " kg/kg m/s (q* = -F_q/u*)";
2521  } else if (if_surf_moist >= zero) {
2522  amrex::Print() << "surface mixing ratio erf.if_surf_moist = " << if_surf_moist << " kg/kg";
2523  } else {
2524  amrex::Print() << "none (q* = 0)";
2525  }
2527  (if_surf_temp_flux != amrex::Real(1e-8) || if_init_surf_temp > zero || if_Olen_in != amrex::Real(1e-8) ||
2529  amrex::Print() << "; the Obukhov length uses theta_v and theta_v* = theta* (1 + epsv qv) + epsv theta q*";
2530  }
2531  amrex::Print() << "\n";
2532  }
2533  }
2534  // The log-law coarse/fine fill acts only on refined levels
2535  if (cf_loglaw_fill) {
2536  const bool immersed = (terrain_type == TerrainType::ImmersedForcing ||
2537  buildings_type == BuildingsType::ImmersedForcing);
2538  if (!immersed && phys_bc_type[amrex::Orientation(amrex::Direction::z, amrex::Orientation::low)] != ERF_BC::surface_layer) {
2539  amrex::Abort("erf.cf_loglaw_fill needs an immersed surface (erf.terrain_type or "
2540  "erf.buildings_type = ImmersedForcing) or zlo.type = surface_layer");
2541  }
2542  if (max_level > 0) {
2543  amrex::Print() << "Coarse/fine faces: erf.cf_loglaw_fill = true (the wall coarse face's flux is shared "
2544  << "among its fine sub-faces by the integral of ln(1 + z/z0), z0 = " << cf_loglaw_z0 << " m)\n";
2545  } else {
2546  amrex::Warning("erf.cf_loglaw_fill has no effect without refined levels (amr.max_level > 0)");
2547  }
2548  }
2550  (terrain_type == TerrainType::EB || terrain_type == TerrainType::ImmersedForcing)) {
2551  amrex::Abort("Automatic perturbations currently support flat, stretched, and fitted-terrain meshes; "
2552  "immersed/embedded terrain requires a ground-relative parent PBL-height conversion");
2553  }
2554 #if 0
2555  // Warn for PBL models and moisture - these may not yet be compatible
2556  for (int lev = 0; lev <= max_level; lev++) {
2557  if ((moisture_type != MoistureType::None) && (turbChoice[lev].pbl_type != PBLType::None)) {
2558  amrex::Warning("\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
2559  }
2560  }
2561 #endif
2562  //
2563  // Buoyancy type check
2564  //
2565  for (int lev = 0; lev <= max_level; lev++) {
2566  if (buoyancy_type[lev] != 1 && buoyancy_type[lev] != 2 && buoyancy_type[lev] != 3 && buoyancy_type[lev] != 4) {
2567  amrex::Error("buoyancy_type must be 1, 2, 3 or 4");
2568  }
2569  }
2570 
2571  if (!use_lagged_delta_rt && !(terrain_type == TerrainType::MovingFittedMesh)) {
2572  amrex::Error("Can't turn off lagged_delta_rt when terrain not moving");
2573  }
2574 
2575  //
2576  // Wind farm checks
2577  //
2578  if (windfarm_type==WindFarmType::SimpleAD and sampling_distance_by_D < zero) {
2579  amrex::Error("To use simplified actuator disks, you need to provide a variable"
2580  " erf.sampling_distance_by_D in the inputs which specifies the upstream"
2581  " distance as a factor of the turbine diameter at which the incoming free stream"
2582  " velocity will be computed at.");
2583  }
2584  if ( (windfarm_type==WindFarmType::SimpleAD ||
2585  windfarm_type==WindFarmType::GeneralAD ) && turb_disk_angle < zero) {
2586  amrex::Error("To use simplified actuator disks, you need to provide a variable"
2587  " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
2588  " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
2589  " will have turb_disk_angle value of 90 deg.");
2590  }
2591 #ifdef ERF_USE_WINDFARM
2592  // Without a location type no turbine table is read, and the model would run on empty tables
2594  amrex::Error(std::string("erf.windfarm_type = ") + amrex::getEnumNameString(windfarm_type)
2595  + " needs erf.windfarm_loc_type, either lat_lon or x_y, with the turbine locations"
2596  " in erf.windfarm_loc_table and their specifications in erf.windfarm_spec_table.");
2597  }
2598 #endif
2599  if (windfarm_loc_type == WindFarmLocType::lat_lon and (windfarm_x_shift < zero or windfarm_y_shift < zero)) {
2600  amrex::Error("You are using windfarms with latitude-logitude option to position the turbines."
2601  " For this you should provide the inputs erf.windfarm_x_shift and"
2602  " erf.windfarm_y_shift which are the values by which the bounding box of the"
2603  " windfarm is shifted from the x and the y axes.");
2604  }
2605 
2606 
2607  if ( (const_massflux_u != 0) && !(geom_vect[0].isPeriodic(0)) ) {
2608  amrex::Error("Constant mass flux (in x) should be used with periodic boundaries");
2609  }
2610 
2611  if ( (const_massflux_v != 0) && !(geom_vect[0].isPeriodic(1)) ) {
2612  amrex::Error("Constant mass flux (in y) should be used with periodic boundaries");
2613  }
2614 
2615  // Mesoscale diffusion -- test if LES appropriate with this dx,dy
2616  for (int lev = 0; lev <= max_level; lev++) {
2617  if ((geom_vect[lev].CellSize(0) > amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) > amrex::Real(2000.)))
2618  {
2619  if ( (turbChoice[lev].les_type == LESType::Smagorinsky) && !turbChoice[lev].smag2d ) {
2620  amrex::Warning("Should use 2-D Smagorinsky for mesoscale resolution");
2621  } else if (turbChoice[lev].les_type == LESType::Deardorff) {
2622  amrex::Warning("Should not use Deardorff LES for mesoscale resolution");
2623  }
2624  }
2625  }
2626 
2627  // Turn off implicit solve if we have no diffusion
2628  bool l_use_kturb = turbChoice[0].use_kturb;
2629  for (int lev = 1; lev <= max_level; lev++) {
2630  l_use_kturb = (l_use_kturb || turbChoice[lev].use_kturb);
2631  }
2632  bool l_use_diff = ( (diffChoice.molec_diff_type != MolecDiffType::None) || l_use_kturb );
2633 
2634  for (int lev = 0; lev <= max_level; lev++) {
2635  bool l_implicit_diff = (vert_implicit_fac[lev][0] > zero ||
2636  vert_implicit_fac[lev][1] > zero ||
2637  vert_implicit_fac[lev][2] > zero);
2638  if (l_implicit_diff && !l_use_diff) {
2639  amrex:: Print() << "No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
2640  vert_implicit_fac[lev][0] = zero;
2641  vert_implicit_fac[lev][1] = zero;
2642  vert_implicit_fac[lev][2] = zero;
2643  }
2644  }
2645 
2646  // Two-way coupling refluxes the diffusive fluxes of the slow scalars, but not on an EB mesh
2647  if (coupling_type == CouplingType::TwoWay && terrain_type == TerrainType::EB &&
2648  max_level > 0 && l_use_diff) {
2649  amrex::Warning("erf.coupling_type = TwoWay with erf.terrain_type = EB does not reflux the "
2650  "diffusive fluxes: diffusion does not conserve the scalars across "
2651  "coarse/fine boundaries");
2652  }
2653 
2654  // The implicit terrain metric is a change to the vertical implicit solves on a
2655  // terrain-fitted mesh; refuse it where it could not do anything. This comes after
2656  // every block that can turn the implicit solve off.
2658  if (mesh_type != MeshType::VariableDz) {
2659  amrex::Abort("erf.implicit_terrain_metric = true requires a terrain-fitted mesh with "
2660  "non-flat terrain (erf.terrain_type = StaticFittedMesh or MovingFittedMesh); "
2661  "on a flat or a purely stretched mesh there are no terrain-metric terms");
2662  }
2663  // In a stage without the implicit solve the whole averaged metric term is explicit
2664  // for that stage. On the steep ridge test the option gained little with 1 1 0
2665  // and ran worse than without it with anelastic MidPoint (measured before the exact
2666  // split: 15 s instead of 30 s), while 1 1 1 recovered the full time step. The rule
2667  // is measured, not derived: every stage must solve implicitly.
2668  for (int lev = 0; lev <= max_level; lev++) {
2669  for (int i = 0; i < 3; ++i) {
2670  if (vert_implicit_fac[lev][i] <= zero) {
2671  amrex::Abort("erf.implicit_terrain_metric = true needs the vertical implicit solve "
2672  "in every Runge-Kutta stage at every level, but erf.vert_implicit_fac "
2673  "is not positive in stage " + std::to_string(i+1) + " at level " +
2674  std::to_string(lev) + ". Set erf.vert_implicit_fac = 1 1 1; the "
2675  "option cannot be used where the implicit solve is turned off "
2676  "(erf.vert_implicit = false, every erf.implicit_*_diffusion = false, "
2677  "no molecular or turbulent diffusion, or anelastic, which solves in "
2678  "its first stage only or not at all)");
2679  }
2680  }
2681  }
2682  // The momentum solves carry most of the stiffness; with them explicit the option
2683  // treats only the scalar metric terms implicitly
2685  amrex::Print() << "WARNING: erf.implicit_terrain_metric = true with "
2686  << "erf.implicit_momentum_diffusion = false: the momentum terrain-metric "
2687  << "terms stay explicit; only the scalars are treated implicitly" << std::endl;
2688  }
2689  } else if (mesh_type == MeshType::VariableDz) {
2690  // On a terrain-fitted mesh the projected horizontal stresses carry K_h, and their
2691  // terrain-metric part K_h h^2 d2/dz2 is explicit in any stage without the implicit
2692  // solve. On steep slopes that limits the time step (steep test ridge: 45 s before
2693  // #4214 was fixed, 15 s after, at the default 1 1 0). Say so once at start-up.
2694  bool explicit_stage_with_kh = false;
2695  for (int lev = 0; lev <= max_level; lev++) {
2696  if (turbChoice[lev].les_type == LESType::None) { continue; }
2697  for (int i = 0; i < 3; ++i) {
2698  if (vert_implicit_fac[lev][i] <= zero) { explicit_stage_with_kh = true; }
2699  }
2700  }
2701  if (explicit_stage_with_kh) {
2702  amrex::Print() << "NOTE: terrain-fitted mesh with an LES closure (horizontal eddy "
2703  << "viscosity K_h) and an explicit vertical-diffusion stage "
2704  << "(erf.vert_implicit_fac has a zero): the terrain-metric term "
2705  << "K_h h^2 d2/dz2 stays explicit there and limits the time step on "
2706  << "steep slopes. To relax it, use erf.vert_implicit_fac = 1 1 1 with "
2707  << "erf.implicit_terrain_metric = true, or erf.smag2d_slope_limiter = true "
2708  << "for Smagorinsky2D; erf.diffusive_dt_check reports the limit."
2709  << std::endl;
2710  }
2711  }
2712 
2713  // Countergradient validation: ensure required implicit diffusion is enabled
2714  for (int lev = 0; lev <= max_level; lev++) {
2715  if (turbChoice[lev].enable_mrf_countergradient) {
2717  vert_implicit_fac[lev][0] > zero ||
2718  vert_implicit_fac[lev][1] > zero ||
2719  vert_implicit_fac[lev][2] > zero,
2720  "enable_mrf_countergradient requires vert_implicit_fac > 0");
2723  "enable_mrf_countergradient requires implicit_thermal_diffusion = true");
2727  "enable_mrf_countergradient with moisture requires implicit_moisture_diffusion = true");
2728  }
2729  }
2730  }
2731 
2732  for (int lev = 0; lev <= max_level; lev++) {
2733  turbChoice[lev].check_params(phys_bc_type);
2734  }
2735  }
@ surface_layer
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
@ None
Definition: ERF_LSM_Types.H:6
@ dz
Definition: ERF_AdvanceWDM6.cpp:273
MolecDiffType molec_diff_type
Selected molecular transport model.
Definition: ERF_DiffStruct.H:97
static constexpr int absent
not carried by the active scheme
Definition: ERF_DataStruct.H:282
int qv
water vapor
Definition: ERF_DataStruct.H:290
WindFarmLocType windfarm_loc_type
Coordinate system for wind-farm turbine locations.
Definition: ERF_DataStruct.H:3461
amrex::Real const_massflux_v
Target constant mass flux in the y direction.
Definition: ERF_DataStruct.H:3552
amrex::Vector< TurbChoice > turbChoice
Turbulence options for each AMR level.
Definition: ERF_DataStruct.H:3020
bool if_fraction_stress
erf.if_wall_form = fraction_stress: the wall stress of ERF_ImmersedWallCell.H in the wall cell of eac...
Definition: ERF_DataStruct.H:3126
bool implicit_moisture_diffusion
Whether implicit vertical moisture diffusion is included.
Definition: ERF_DataStruct.H:3062
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:3433
amrex::Real if_Olen_in
Input Obukhov length for immersed-forcing MOST [m].
Definition: ERF_DataStruct.H:3117
amrex::Vector< int > buoyancy_type
Per-level buoyancy formulation selector.
Definition: ERF_DataStruct.H:3032
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:3432
amrex::Real const_massflux_u
Target constant mass flux in the x direction.
Definition: ERF_DataStruct.H:3551
amrex::Real sampling_distance_by_D
Turbine inflow sampling distance normalized by rotor diameter.
Definition: ERF_DataStruct.H:3510
amrex::Real windfarm_y_shift
Wind-farm y-coordinate shift.
Definition: ERF_DataStruct.H:3513
bool any_perturbation() const
Query whether any level uses a turbulent perturbation mode.
Definition: ERF_DataStruct.H:3395
amrex::Real if_z0
Immersed-forcing roughness length [m].
Definition: ERF_DataStruct.H:3113
bool implicit_thermal_diffusion
Whether implicit vertical thermal diffusion is included.
Definition: ERF_DataStruct.H:3061
bool perturbation_auto
Select LES nests, using parent winds and a PBL ancestor's height, or the nearest LES ancestor's diagn...
Definition: ERF_DataStruct.H:3424
static MeshType mesh_type
Vertical mesh representation.
Definition: ERF_DataStruct.H:3004
amrex::Real if_surf_moist
Definition: ERF_DataStruct.H:3121
amrex::Real if_surf_moist_flux
Definition: ERF_DataStruct.H:3120
amrex::Real turb_disk_angle
Turbine disk angle from the x axis [deg].
Definition: ERF_DataStruct.H:3511
amrex::Real cf_loglaw_z0
Roughness length [m] of that share; by default erf.if_z0 with immersed forcing, else the inputs' erf....
Definition: ERF_DataStruct.H:3139
amrex::Real windfarm_x_shift
Wind-farm x-coordinate shift.
Definition: ERF_DataStruct.H:3512
bool use_lagged_delta_rt
Whether to use lagged delta terms for moving terrain.
Definition: ERF_DataStruct.H:3142
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Per-level, per-stage implicit vertical diffusion factors.
Definition: ERF_DataStruct.H:3058
bool cf_loglaw_fill
Share the flux of the first coarse face above a wall among its fine sub-faces at the lateral coarse/f...
Definition: ERF_DataStruct.H:3138
bool implicit_terrain_metric
Whether the compact terrain-metric part of the vertical diffusion is solved implicitly.
Definition: ERF_DataStruct.H:3068
bool if_wall_tke
Hold the k-eqn TKE of the fraction-stress wall cell at its flat-ground wall value (ib_wall::wall_tke)...
Definition: ERF_DataStruct.H:3128
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:2989
bool if_flat_wall_dissipation
Partial fraction-stress wall cells dissipate TKE with the length scale of flat ground's first cell; o...
Definition: ERF_DataStruct.H:3130
std::string if_average_down
Cell average down over immersed-forcing levels: "plain" (the default, the plain cell average) or "flu...
Definition: ERF_DataStruct.H:3136
static BuildingsType buildings_type
Building representation.
Definition: ERF_DataStruct.H:2995
int if_wall_face_spacing
Spacing the face above the fraction-stress wall cell differences over: 0 the cell height,...
Definition: ERF_DataStruct.H:3127
amrex::Real if_init_surf_temp
Initial immersed-forcing surface temperature [K].
Definition: ERF_DataStruct.H:3115
DiffChoice diffChoice
Diffusion-related options.
Definition: ERF_DataStruct.H:3017
amrex::Real if_surf_temp_flux
Immersed-forcing surface temperature flux [K m/s].
Definition: ERF_DataStruct.H:3114
WindFarmType windfarm_type
Wind-farm model.
Definition: ERF_DataStruct.H:3460
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:3504
bool implicit_momentum_diffusion
Whether implicit vertical momentum diffusion is included.
Definition: ERF_DataStruct.H:3064
Here is the call graph for this function:

◆ display()

void SolverChoice::display ( int  max_level,
std::string  pp_prefix 
)
inline

Print the configured solver, physics, and transport options.

Parameters
max_levelMaximum AMR level configured for the run.
pp_prefixParmParse prefix used to display nested choices.
2743  {
2744  amrex::Print() << "SOLVER CHOICE: " << std::endl;
2745  if (perturbation_auto) {
2746  amrex::Print() << "Automatic LES-nest perturbations: parent update period = "
2747  << perturbation_auto_period << " s, PBL height fraction = "
2748  << perturbation_auto_pbl_fraction << std::endl;
2749  }
2750  for (int lev = 0; lev <= max_level; lev++) {
2751  amrex::Print() << "At level " << lev << " : " << std::endl;
2752  if (compressibility_type[lev] != CompressibilityType::FullyCompressible) {
2753  amrex::Print() << ((compressibility_type[lev] == CompressibilityType::PseudoIncompressible)
2754  ? " pseudo-incompressible" : " anelastic")
2755  << " with no substepping, using the "
2756  << ((timestepping_type[lev] == TimesteppingType::MidPoint) ? "MidPoint" : "RK2")
2757  << " integrator" << std::endl;
2758  } else {
2759  if (timestepping_type[lev] == TimesteppingType::RK3_NoSubstepping) {
2760  amrex::Print() << " compressible with no substepping" << std::endl;
2761  } else if (timestepping_type[lev] == TimesteppingType::RK3_ImplicitSubstep) {
2762  amrex::Print() << " compressible with implicit substepping" << std::endl;
2763  }
2764  }
2765  if (fixed_density[lev]) {
2766  amrex::Print() << " and fixed density" << std::endl;
2767  }
2768  }
2769 
2770  for (int lev = 0; lev <= max_level; lev++) {
2771  amrex::Print() << "vert_implicit_fac at level " << lev << " : "
2772  << vert_implicit_fac[lev][0] << " "
2773  << vert_implicit_fac[lev][1] << " "
2774  << vert_implicit_fac[lev][2];
2775  if (vert_implicit_fac[lev][0] > zero ||
2776  vert_implicit_fac[lev][1] > zero ||
2777  vert_implicit_fac[lev][2] > zero)
2778  {
2779  amrex::Print() << " (theta = " << implicit_thermal_diffusion
2780  << ", moisture = " << implicit_moisture_diffusion
2781  << ", tke = " << implicit_ke_diffusion
2782  << ", momenta = " << implicit_momentum_diffusion;
2784  amrex::Print() << "; terrain metric implicit";
2785  }
2786  amrex::Print() << ")";
2787  }
2788  }
2789  amrex::Print() << std::endl;
2790  amrex::Print() << "use_coriolis : " << use_coriolis << std::endl;
2791  amrex::Print() << "use_gravity : " << use_gravity << std::endl;
2792 
2793  if (moisture_type == MoistureType::SAM) {
2794  amrex::Print() << "Moisture Model: SAM" << std::endl;
2795  } else if (moisture_type == MoistureType::SAM_NoIce) {
2796  amrex::Print() << "Moisture Model: SAM No Ice" << std::endl;
2797  } else if (moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
2798  amrex::Print() << "Moisture Model: SAM No Precip No Ice" << std::endl;
2799  } else if (moisture_type == MoistureType::Morrison) {
2800  amrex::Print() << "Moisture Model: Morrison" << std::endl;
2801  } else if (moisture_type == MoistureType::Morrison_NoIce) {
2802  amrex::Print() << "Moisture Model: Morrison_NoIce" << std::endl;
2803  } else if (moisture_type == MoistureType::WSM6) {
2804  amrex::Print() << "Moisture Model: WSM6" << std::endl;
2805  } else if (moisture_type == MoistureType::WDM6) {
2806  amrex::Print() << "Moisture Model: WDM6" << std::endl;
2807  } else if (moisture_type == MoistureType::Kessler) {
2808  amrex::Print() << "Moisture Model: Kessler" << std::endl;
2809  } else if (moisture_type == MoistureType::Kessler_NoRain) {
2810  amrex::Print() << "Moisture Model: Kessler No Rain" << std::endl;
2811  } else if (moisture_type == MoistureType::SatAdj) {
2812  amrex::Print() << "Moisture Model: Saturation Adjustment" << std::endl;
2813  } else if (moisture_type == MoistureType::SuperDroplets) {
2814  amrex::Print() << "Moisture Model: SuperDroplets" << std::endl;
2815  } else if (moisture_type == MoistureType::MoistNoCondensation) {
2816  amrex::Print() << "Moisture Model: MoistNoCondensation" << std::endl;
2817  } else if (moisture_type == MoistureType::SBM) {
2818  amrex::Print() << "Moisture Model: SBM mapped spectral advection (M3)" << std::endl;
2819  } else {
2820  amrex::Print() << "Moisture Model: None" << std::endl;
2821  }
2822 
2823  if (terrain_type == TerrainType::StaticFittedMesh) {
2824  amrex::Print() << "Terrain Type: StaticFittedMesh" << std::endl;
2825  } else if (terrain_type == TerrainType::MovingFittedMesh) {
2826  amrex::Print() << "Terrain Type: MovingFittedMesh" << std::endl;
2827  } else if (terrain_type == TerrainType::EB) {
2828  amrex::Print() << "Terrain Type: EB" << std::endl;
2829  ebChoice.display();
2830  } else if (terrain_type == TerrainType::ImmersedForcing) {
2831  amrex::Print() << "Terrain Type: ImmersedForcing" << std::endl;
2832  } else {
2833  amrex::Print() << "Terrain Type: None" << std::endl;
2834  }
2835 
2836  amrex::Print() << "Flat fitted terrain: "
2837  << (flat_terrain ? "true" : "false") << std::endl;
2838 
2839  if (buildings_type == BuildingsType::ImmersedForcing) {
2840  amrex::Print() << "Buildings Type: ImmersedForcing" << std::endl;
2841  } else {
2842  amrex::Print() << "Buildings Type: None" << std::endl;
2843  }
2844 
2845  if (mesh_type == MeshType::ConstantDz) {
2846  amrex::Print() << " Mesh Type: ConstantDz" << std::endl;
2847  } else if (mesh_type == MeshType::StretchedDz) {
2848  amrex::Print() << " Mesh Type: StretchedDz" << std::endl;
2849  } else if (mesh_type == MeshType::VariableDz) {
2850  amrex::Print() << " Mesh Type: VariableDz" << std::endl;
2851  } else {
2852  amrex::Error("No mesh_type set!");
2853  }
2854 
2855  amrex::Print() << "ABL Driver Type: " << std::endl;
2857  amrex::Print() << " None" << std::endl;
2858  } else if (abl_driver_type == ABLDriverType::PressureGradient) {
2859  amrex::Print() << " Pressure Gradient "
2860  << amrex::RealVect(abl_pressure_grad[0],abl_pressure_grad[1],abl_pressure_grad[2])
2861  << std::endl;
2862  } else if (abl_driver_type == ABLDriverType::GeostrophicWind) {
2863  amrex::Print() << " Geostrophic Wind "
2864  << amrex::RealVect(abl_geo_forcing[0],abl_geo_forcing[1],abl_geo_forcing[2])
2865  << std::endl;
2866  }
2867 
2868  if (max_level > 0) {
2869  amrex::Print() << "Coupling Type: " << std::endl;
2870  if (coupling_type == CouplingType::TwoWay) {
2871  amrex::Print() << " Two-way" << std::endl;
2872  } else if (coupling_type == CouplingType::OneWay) {
2873  amrex::Print() << " One-way" << std::endl;
2874  }
2875  }
2876 
2877  if (rad_type == RadiationType::RRTMGP) {
2878  amrex::Print() << "Radiation Model: RRTMGP" << std::endl;
2879  } else if (rad_type == RadiationType::Simple) {
2880  amrex::Print() << "Radiation Model: Simple" << std::endl;
2881  } else if (rad_type == RadiationType::TwoStream) {
2882  amrex::Print() << "Radiation Model: TwoStream" << std::endl;
2883  } else {
2884  amrex::Print() << "Radiation Model: None" << std::endl;
2885  }
2886 
2887  amrex::Print() << "Gradp_type : " << amrex::getEnumNameString(gradp_type) << std::endl;
2888  amrex::Print() << "Gradp_2nd_order_bndry : " << gradp_2nd_order_bndry << std::endl;
2889 
2890  for (int lev = 0; lev <= max_level; lev++) {
2891  amrex::Print() << "Buoyancy_type at level " << lev << " : " << buoyancy_type[lev] << std::endl;
2892  }
2893 
2894  advChoice.display(pp_prefix);
2895  diffChoice.display();
2898 
2899  for (int lev = 0; lev <= max_level; lev++) {
2900  turbChoice[lev].display(lev);
2901  }
2902  }
void display(std::string &pp_prefix)
Print the configured advection choices.
Definition: ERF_AdvStruct.H:240
void display()
Print the configured damping options.
Definition: ERF_DampingStruct.H:76
void display()
Print the configured diffusion options.
Definition: ERF_DiffStruct.H:80
void display()
Print the configured embedded-boundary options.
Definition: ERF_EBStruct.H:74
static bool flat_terrain
Permit fixed-index planar averages after validating a flat fitted mesh.
Definition: ERF_DataStruct.H:2992
amrex::Vector< int > fixed_density
Per-level flag selecting fixed-density treatment; always 1 at an anelastic level and 0 at a pseudo-in...
Definition: ERF_DataStruct.H:3030
amrex::Vector< TimesteppingType > timestepping_type
Per-level time integrator (RK3_ImplicitSubstep, RK3_NoSubstepping, RK2 or MidPoint).
Definition: ERF_DataStruct.H:3029
amrex::Real perturbation_auto_period
Seconds between automatic parent-wind and PBL-height updates.
Definition: ERF_DataStruct.H:3425
EBChoice ebChoice
Embedded-boundary options.
Definition: ERF_DataStruct.H:3021
bool implicit_ke_diffusion
Whether implicit vertical TKE diffusion is included.
Definition: ERF_DataStruct.H:3063
bool use_gravity
Whether gravitational forcing is enabled.
Definition: ERF_DataStruct.H:3095
bool use_coriolis
Whether Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:3096
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:3016
amrex::Vector< CompressibilityType > compressibility_type
Per-level compressibility (FullyCompressible, Anelastic or PseudoIncompressible).
Definition: ERF_DataStruct.H:3028
SpongeChoice spongeChoice
Sponge-layer options.
Definition: ERF_DataStruct.H:3019
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Applied ABL pressure-gradient forcing vector.
Definition: ERF_DataStruct.H:3494
amrex::Real perturbation_auto_pbl_fraction
Fraction of the selected ancestor's PBL height occupied by perturbations.
Definition: ERF_DataStruct.H:3426
GradpType gradp_type
Terrain-fitted horizontal pressure-gradient formulation.
Definition: ERF_DataStruct.H:3088
DampingChoice dampingChoice
Damping-related options.
Definition: ERF_DataStruct.H:3018
bool gradp_2nd_order_bndry
Whether ChainRule takes dp/dz at the bottom and top from a second-order one-sided difference.
Definition: ERF_DataStruct.H:3090
RadiationType rad_type
Radiation model.
Definition: ERF_DataStruct.H:3465
void display()
Print the configured sponge-layer options.
Definition: ERF_SpongeStruct.H:85
Here is the call graph for this function:

◆ forest_fast()

bool SolverChoice::forest_fast ( int  lev) const
inlinenoexcept
3298  {
3299  return level_substeps(lev) && forest_substep;
3300  }
bool forest_substep
Whether canopy source terms are applied only during substeps.
Definition: ERF_DataStruct.H:3103
bool level_substeps(int lev) const noexcept
Definition: ERF_DataStruct.H:3242

Referenced by make_mom_sources().

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

◆ host_owns_vertical_momentum_diffusion()

bool SolverChoice::host_owns_vertical_momentum_diffusion ( ) const
inlinenoexcept

Test whether the host owns momentum diffusion.

Returns
True if ERF dycore does vertical diffusion of momentum.
3367  {
3368  if (!use_native_shoc) { return true; }
3370  }
bool shoc_disables_momentum_transport(ShocMomentumTransport mode)
Definition: ERF_ShocTransportStruct.H:47
bool use_native_shoc
Whether any level uses the native SHOC PBL scheme.
Definition: ERF_DataStruct.H:3199
ShocMomentumTransport shoc_momentum_transport
Definition: ERF_DataStruct.H:3203

Referenced by init_params().

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

◆ host_owns_vertical_scalar_diffusion()

bool SolverChoice::host_owns_vertical_scalar_diffusion ( ) const
inlinenoexcept

Test whether the host owns scalar diffusion.

Returns
True if ERF dycore does vertical diffusion of scalars.
3377  {
3378  if (!use_native_shoc) { return true; }
3379  return false;
3380  }

Referenced by init_params().

Here is the caller graph for this function:

◆ if_drag_in_projection()

bool SolverChoice::if_drag_in_projection ( int  lev) const
inlinenoexcept

True when the drag of the immersed solid is applied inside the projection on this level (erf.if_implicit_projection on a level that is not FullyCompressible). A FullyCompressible level has no projection, so it keeps the drag in the momentum source.

3224  {
3225  return if_implicit_projection &&
3226  (compressibility_type[lev] != CompressibilityType::FullyCompressible);
3227  }
bool if_implicit_projection
Definition: ERF_DataStruct.H:3111

Referenced by erf_slow_rhs_post(), and make_mom_sources().

Here is the caller graph for this function:

◆ immersed_forcing_fast()

bool SolverChoice::immersed_forcing_fast ( int  lev) const
inlinenoexcept
3304  {
3306  }
bool immersed_forcing_substep
Whether immersed-forcing source terms are applied only during substeps.
Definition: ERF_DataStruct.H:3102

Referenced by make_mom_sources(), and make_sources().

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

◆ init_params()

void SolverChoice::init_params ( int  max_level,
std::string  pp_prefix 
)
inline

Read solver-wide algorithmic options from the input parameter database.

Parameters
max_levelMaximum AMR level configured for the run.
pp_prefixParmParse prefix for the ERF input namespace.
751  {
752  amrex::ParmParse pp(pp_prefix);
753 
754  bool bogus_bool;
755  if (pp.query("use_terrain",bogus_bool) > 0) {
756  amrex::Error("The input use_terrain is deprecated. Set terrain_type instead.");
757  }
758 
759  if (pp.query("use_moist_background",bogus_bool) > 0) {
760  amrex::Error("The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
761  }
762 
763  // Do we set map scale factors to myhalf instead of 1 for testing?
764  pp.queryAdd("test_mapfactor", test_mapfactor);
765 
766  // For testing: if nonzero, the map scale factors on level 0 vary smoothly in space,
767  // m = 1 + test_mapfactor_amp sin(2 pi x / Lx) cos(2 pi y / Ly), as if read from an init file
768  // there; finer levels take theirs from the coarser level, as a level without a file does
769  pp.queryAdd("test_mapfactor_amp", test_mapfactor_amp);
770  if (test_mapfactor && test_mapfactor_amp != amrex::Real(0)) {
771  amrex::Abort("erf.test_mapfactor and erf.test_mapfactor_amp cannot be used together");
772  }
773 
774  // Which horizontal pressure gradient formulation to use with terrain fitted coords?
775  // (see GradpType). HydrostaticHybrid always uses the perturbational pressure,
776  // regardless of the setting of use_pert_pres_gradient.
777  //
778  // The integer values this used to take are still accepted, with a warning:
779  // 0 -> ChainRule, 2 -> HydrostaticHybrid; 1 (Klemp 2011) has been removed
780  if (pp.contains("gradp_type")) {
781  std::string gradp_str;
782  pp.get("gradp_type", gradp_str);
783  if (gradp_str == "0" || gradp_str == "1" || gradp_str == "2") {
784  if (gradp_str == "1") {
785  amrex::Abort("erf.gradp_type = 1 has been removed; use erf.gradp_type = HydrostaticHybrid");
786  }
787  gradp_type = (gradp_str == "0") ? GradpType::ChainRule : GradpType::HydrostaticHybrid;
788  amrex::Print() << "WARNING: integer values of erf.gradp_type are deprecated; use erf.gradp_type = "
789  << amrex::getEnumNameString(gradp_type) << std::endl;
790  } else {
791  // Case-insensitive and ignoring underscores, so that e.g. hydrostatic_hybrid
792  // selects HydrostaticHybrid
793  try {
794  pp.query_enum_sloppy("gradp_type", gradp_type, "_");
795  } catch (...) {
796  amrex::Abort("erf.gradp_type must be ChainRule or HydrostaticHybrid, not '"
797  + gradp_str + "'");
798  }
799  }
800  }
801 
802  // With ChainRule, whether dp/dz at the bottom and top of the domain is the second-order
803  // one-sided difference through three cells rather than the first-order two-point one
804  pp.query("gradp_2nd_order_bndry", gradp_2nd_order_bndry);
805 
806  // For the lateral pressure gradient to be used in the momentum equation, should we
807  // take the x- and y-derivatives of the perturbational pressure or the full pressure?
808  pp.queryAdd("use_pert_pres_gradient", use_pert_pres_gradient);
809 
810  // What type of moisture model to use?
811  moisture_type = MoistureType::None; // Default
812  if (pp.query("moisture_type",moisture_type) > 0) {
813  amrex::Error("The input moisture_type is deprecated. Set moisture_model instead.");
814  }
815 
816  pp.query_enum_case_insensitive("moisture_model",moisture_type);
817 
818 #ifdef ERF_SBM_AMR_QUALIFICATION
819  pp.queryAdd("sbm_amr_qualification_test", sbm_amr_qualification_test);
820  pp.queryAdd("sbm_amr_qualification_expect_zero_flow",
822  pp.queryAdd("sbm_amr_qualification_expect_split",
824  pp.queryAdd("sbm_amr_qualification_expect_empty_fine_rank",
826  pp.queryAdd("sbm_amr_qualification_unique_profile",
828  pp.queryAdd("sbm_amr_qualification_parent_store_fault",
830  pp.queryAdd("sbm_amr_qualification_regrid",
832  pp.queryAdd("sbm_amr_qualification_regrid_reject_fault",
834  pp.queryAdd("sbm_amr_qualification_uniform_ratio",
836 #else
837  for (const char* name : {"sbm_amr_qualification_test",
838  "sbm_amr_qualification_expect_zero_flow",
839  "sbm_amr_qualification_expect_split",
840  "sbm_amr_qualification_expect_empty_fine_rank",
841  "sbm_amr_qualification_unique_profile",
842  "sbm_amr_qualification_parent_store_fault",
843  "sbm_amr_qualification_regrid",
844  "sbm_amr_qualification_regrid_reject_fault",
845  "sbm_amr_qualification_uniform_ratio"}) {
846  if (pp.contains(name)) {
847  amrex::Error(std::string("erf.") + name + " is available only in "
848  "the isolated ERF_ENABLE_SBM_AMR_QUALIFICATION build");
849  }
850  }
851 #endif
852 
853  // Test-only SBM failure injections. They remain disabled unless an
854  // integration test explicitly enables the corresponding option.
855  pp.queryAdd("sbm_test_native_qc_write_fault", sbm_test_native_qc_write_fault);
856  pp.queryAdd("sbm_test_donor_cfl_fault", sbm_test_donor_cfl_fault);
857  if (moisture_type != MoistureType::SBM &&
859  amrex::Error("SBM test fault-injection options require moisture_model=SBM");
860  }
861  pp.queryAdd("sbm_budget_check", sbm_budget_check);
862  if (moisture_type != MoistureType::SBM && sbm_budget_check) {
863  amrex::Error("erf.sbm_budget_check requires erf.moisture_model = SBM");
864  }
865 
866  // Register the moisture data this scheme carries: conserved-state
867  // components and qmoist diagnostic slots alike. MoistureComponentIndices
868  // is the one place that mapping lives, and every consumer -- source terms,
869  // turbulence closures, and the plotfile/subvolume writers -- queries it
870  // instead of testing moisture_type.
872 
873  if (moisture_type == MoistureType::SBM) {
874  if (pp.contains("sbm_zero_transport_fixture")) {
875  bool legacy_zero_transport = false;
876  pp.get("sbm_zero_transport_fixture", legacy_zero_transport);
877  if (legacy_zero_transport) {
878  amrex::Error("erf.sbm_zero_transport_fixture=true is obsolete; M3 advances the mapped spectral state, so remove this option");
879  }
880  }
881  pp.queryAdd("sbm_nbins", sbm_nbins);
882  pp.queryAdd("sbm_moment_mode", sbm_moment_mode);
883  pp.queryAdd("sbm_cloud_rain_split", sbm_cloud_rain_split);
884  pp.queryarr("sbm_edges", sbm_edges);
885  pp.queryarr("sbm_pivots", sbm_pivots);
886  pp.queryarr("sbm_fixture_initial_state", sbm_fixture_initial_state);
887  pp.queryarr("sbm_fixture_initial_state_xhi", sbm_fixture_initial_state_xhi);
888  pp.queryAdd("sbm_particle_mixing", sbm_particle_mixing);
889  pp.queryAdd("sbm_particle_mixing_kh", sbm_particle_mixing_kh);
890  pp.queryAdd("sbm_particle_mixing_kv", sbm_particle_mixing_kv);
891  pp.queryAdd("sbm_particle_mixing_terrain_qualification",
893 
894  if (sbm_nbins < 2 || (sbm_moment_mode != 1 && sbm_moment_mode != 2)) {
895  amrex::Error("SBM requires sbm_nbins >= 2 and sbm_moment_mode equal to 1 or 2");
896  }
897  if (sbm_edges.empty()) {
898  sbm_edges.resize(static_cast<std::size_t>(sbm_nbins + 1));
899  sbm_pivots.resize(static_cast<std::size_t>(sbm_nbins));
900  for (int b = 0; b <= sbm_nbins; ++b) {
901  const amrex::Real fraction = static_cast<amrex::Real>(b) /
902  static_cast<amrex::Real>(sbm_nbins);
903  sbm_edges[static_cast<std::size_t>(b)] =
904  std::pow(amrex::Real(10.0), amrex::Real(-18.0) + amrex::Real(6.0) * fraction);
905  }
906  for (int b = 0; b < sbm_nbins; ++b) {
907  sbm_pivots[static_cast<std::size_t>(b)] = std::sqrt(
908  sbm_edges[static_cast<std::size_t>(b)] * sbm_edges[static_cast<std::size_t>(b + 1)]);
909  }
910  } else {
911  sbm_nbins = static_cast<int>(sbm_edges.size()) - 1;
912  if (sbm_nbins < 2) amrex::Error("sbm_edges must define at least two bins");
913  if (sbm_pivots.empty()) {
914  sbm_pivots.resize(static_cast<std::size_t>(sbm_nbins));
915  for (int b = 0; b < sbm_nbins; ++b) {
916  sbm_pivots[static_cast<std::size_t>(b)] = std::sqrt(
917  sbm_edges[static_cast<std::size_t>(b)] * sbm_edges[static_cast<std::size_t>(b + 1)]);
918  }
919  }
920  }
921  if (sbm_pivots.size() != static_cast<amrex::Long>(sbm_nbins)) {
922  amrex::Error("sbm_pivots must contain one value per SBM bin");
923  }
925  if (sbm_cloud_rain_split <= 0 || sbm_cloud_rain_split >= sbm_nbins) {
926  amrex::Error("sbm_cloud_rain_split must be strictly inside the liquid bin range");
927  }
928  int expected_sbm_components = sbm_nbins * (sbm_moment_mode == 2 ? 2 : 1);
929 #ifdef ERF_SBM_AMR_QUALIFICATION
931  expected_sbm_components += sbm_nbins;
932  }
933 #endif
934  if (!sbm_fixture_initial_state.empty() &&
935  sbm_fixture_initial_state.size() != static_cast<amrex::Long>(expected_sbm_components)) {
936  amrex::Error("sbm_fixture_initial_state must match the full runtime SBM component count");
937  }
938  for (const amrex::Real value : sbm_fixture_initial_state) {
939  if (!std::isfinite(value) || value < amrex::Real(0.0)) {
940  amrex::Error("sbm_fixture_initial_state values must be finite and nonnegative");
941  }
942  }
943  if (!sbm_fixture_initial_state_xhi.empty() &&
945  amrex::Error("sbm_fixture_initial_state_xhi must have as many values as "
946  "sbm_fixture_initial_state");
947  }
948  for (const amrex::Real value : sbm_fixture_initial_state_xhi) {
949  if (!std::isfinite(value) || value < amrex::Real(0.0)) {
950  amrex::Error("sbm_fixture_initial_state_xhi values must be finite and nonnegative");
951  }
952  }
953  }
954 
955  // Set a default for both dry and moist
956  buoyancy_type.resize(max_level+1);
957  for (int i = 0; i <= max_level; ++i) {
958  buoyancy_type[i] = 1; // uses Rhoprime
959  }
960 
962  pp.queryAdd("moisture_tight_coupling",moisture_tight_coupling);
963  }
964 
965  // Which expression (1,2/3 or 4) to use for buoyancy
966  int default_buoyancy_type = buoyancy_type[0];
967  read_int_string(max_level, "buoyancy_type", buoyancy_type, default_buoyancy_type);
968 
969  // What type of land surface model to use
970  lsm_type = LandSurfaceType::None; // Default
971  pp.query_enum_case_insensitive("land_surface_model",lsm_type);
972 
973  // What type of urban model to use and whether it is active at the given level
975  pp.query_enum_case_insensitive("urban_model", urban_type);
976  read_int_string(max_level, "urban_lev_active", urban_enabled_lev, 1);
977  for (int lev = 0; lev <= max_level; ++lev) {
978  if (urban_enabled_lev[lev] != 0 && urban_enabled_lev[lev] != 1) {
979  amrex::Error("urban_lev_active should be 0 or 1");
980  }
981  }
982 
983  // Will an external ocean coupler supply SST for part or all of the water
984  // cells this run? The surface layer needs to know this it in time to select
985  // ThetaCalcType::SURFACE_TEMPERATURE, which is long before the first
986  // ApplyOceanSurfaceState call.
987  pp.queryAdd("use_coupled_sst", use_coupled_sst);
988 
989  // Will an external ocean coupler supply the surface current? The surface layer
990  // allocates the current with each level, before the first ApplyOceanSurfaceState
991  // call, and takes the wind relative to it.
992  pp.queryAdd("use_coupled_currents", use_coupled_currents);
993 
994  read_int_string(max_level, "is_land", is_land, 1);
995  for (int lev = 0; lev <= max_level; ++lev) {
996  if (is_land[lev] == 1) {
997  amrex::Print() << "Level " << lev << " is land" << std::endl;
998  } else if (is_land[lev] == 0) {
999  amrex::Print() << "Level " << lev << " is water" << std::endl;
1000  } else {
1001  amrex::Error("is_land should be 0 or 1");
1002  }
1003  }
1004 
1005  // What type of radiation model to use
1006  rad_type = RadiationType::None; // Default
1007  pp.query_enum_case_insensitive("radiation_model", rad_type);
1008 
1009  // Verify that radiation model cannot be RRTMGP if ERF was not compiled with RRTMGP
1010 #ifndef ERF_USE_RRTMGP
1011  if (rad_type == RadiationType::RRTMGP)
1012  {
1013  amrex::Error("ERF was not compiled with RRTMGP enabled!");
1014  }
1015 #endif
1016 
1017  // Is the terrain none, static or moving?
1018  std::string terrain_type_temp = "";
1019  pp.queryAdd("terrain_type", terrain_type_temp);
1020  if (terrain_type_temp == "Moving") {
1021  amrex::Error("erf.terrain_type = Moving is no longer supported; please replace Moving by MovingFittedMesh");
1022  } else if (terrain_type_temp == "Static") {
1023  amrex::Error("erf.terrain_type = Static is no longer supported; please replace Static by StaticFittedMesh");
1024  } else {
1025  pp.query_enum_case_insensitive("terrain_type",terrain_type);
1026  }
1027 
1028  // Whether the terrain is flat - this allows planar averages (lsf, nudging) with StaticFittedMesh
1029  pp.queryAdd("flat_terrain", flat_terrain);
1030 
1031  // Get buildings type
1032  std::string buildings_type_temp = "";
1033  pp.queryAdd("buildings_type", buildings_type_temp);
1034  if (buildings_type_temp == "ImmersedForcing") {
1035  buildings_type = BuildingsType::ImmersedForcing;
1036  }
1037  pp.queryAdd("buildings_fc_factories", buildings_fc_factories);
1038 
1039  //
1040  // Read the init_type here to make sure we correctly set the mesh and terrain types
1041  //
1042  std::string init_type_temp_string;
1043 
1044  int found = pp.queryAdd("init_type",init_type_temp_string);
1045 
1046  if ( (init_type_temp_string == "Real") || (init_type_temp_string == "real") ) {
1047  amrex::Error("erf.init_type = Real is deprecated; please replace Real by WRFInput");
1048  } else if ( (init_type_temp_string == "Ideal") || (init_type_temp_string == "ideal") ) {
1049  amrex::Error("erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
1050  } else {
1051  pp.query_enum_case_insensitive("init_type",init_type);
1052  use_real_bcs = ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) );
1053  }
1054 
1055  if ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) {
1056  if (terrain_type != TerrainType::StaticFittedMesh) {
1057  amrex::Error("Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
1058  }
1059  }
1060 
1061  if (init_type == InitType::MoistBaseState) {
1063  amrex::Error("Makes no sense to have moist base state with no moisture model");
1064  }
1065  }
1066 
1067  if (init_type == InitType::WRFInput) {
1069  amrex::Error("Can't have moisture_type = None with init_type = WRFInput");
1070  }
1071 
1072  // NetCDF wrfbdy lateral boundary file
1073  std::string nc_bdy_file_temp_string;
1074  bool has_bdy = pp.queryAdd("nc_bdy_file", nc_bdy_file_temp_string);
1075  if (!has_bdy) use_real_bcs = false;
1076 
1077  bool use_real_bcs_temp = use_real_bcs;
1078  pp.queryAdd("use_real_bcs", use_real_bcs_temp);
1079  if (use_real_bcs && !use_real_bcs_temp) {
1080  use_real_bcs = false;
1081  }
1082  }
1083 
1084  if (found == 0 || init_type == InitType::None) {
1085  amrex::Print() << "init_type must now be set. The options are " << std::endl;
1086  amrex::Print() << " Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
1087  amrex::Print() << " ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
1088  amrex::Error("Please add a string for init_type to your inputs file or command line");
1089  }
1090 
1091  // How to interpret input_sounding
1092  if (init_type == InitType::Input_Sounding) {
1093  pp.query_enum_case_insensitive("sounding_type",sounding_type);
1094  }
1095 
1096  if (terrain_type == TerrainType::StaticFittedMesh ||
1097  terrain_type == TerrainType::MovingFittedMesh) {
1098  mesh_type = MeshType::VariableDz;
1099  }
1100 
1101  if (flat_terrain && terrain_type != TerrainType::StaticFittedMesh) {
1102  amrex::Error("erf.flat_terrain requires terrain_type = StaticFittedMesh");
1103  }
1104 
1105  // Refined levels over moving terrain are not supported: erf_substep_MT does not take the
1106  // fluxes through coarse/fine faces from the coarse level (cf_flux_history_active)
1107  if (terrain_type == TerrainType::MovingFittedMesh && max_level > 0) {
1108  amrex::Error("erf.terrain_type = MovingFittedMesh requires amr.max_level = 0");
1109  }
1110 
1111  // Immersed-forcing buildings need the terrain blanking that init_zphys builds, and
1112  // init_zphys returns before building it when the terrain is EB
1113  if (terrain_type == TerrainType::EB && buildings_type == BuildingsType::ImmersedForcing) {
1114  amrex::Error("erf.buildings_type = ImmersedForcing is not supported with erf.terrain_type = EB");
1115  }
1116 
1117  // Each surface builds its own EB index space, and the factories use only the last one
1118  // (the buildings), so the terrain would be dropped without warning (#5188)
1119  if (terrain_type == TerrainType::ImmersedForcing && buildings_type == BuildingsType::ImmersedForcing) {
1120  amrex::Error("erf.terrain_type = ImmersedForcing and erf.buildings_type = ImmersedForcing "
1121  "cannot be used together");
1122  }
1123 
1124  if ( (moisture_type == MoistureType::SAM ||
1125  moisture_type == MoistureType::SAM_NoIce ||
1126  moisture_type == MoistureType::SAM_NoPrecip_NoIce ) &&
1127  (mesh_type == MeshType::VariableDz) )
1128  {
1129  amrex::Abort("SAM is not correct with variable dz -- choose another moisture model");
1130  }
1131 
1132  // queryAdd puts the default in the table, so ask whether the ratio was given first
1133  const bool have_stretching_ratio = pp.contains("grid_stretching_ratio");
1134  pp.queryAdd("grid_stretching_ratio", grid_stretching_ratio);
1135  if (grid_stretching_ratio != 0) {
1137  "The grid stretching ratio must be greater than 1");
1138  }
1139  // erf.initial_dz on its own asks for the stretching ratio to be solved for, so that
1140  // a first layer that thick stretches geometrically to close on prob_hi[2]. An
1141  // explicit erf.grid_stretching_ratio = 0 still means no stretching at all.
1142  const bool solve_stretching_ratio = !have_stretching_ratio && pp.contains("initial_dz");
1143  if (grid_stretching_ratio >= 1 || solve_stretching_ratio) {
1145  terrain_type = TerrainType::StaticFittedMesh;
1146  }
1147  if (mesh_type == MeshType::ConstantDz) {
1148  mesh_type = MeshType::StretchedDz;
1149  }
1150  pp.get("initial_dz", dz0);
1151  }
1152 
1153  // The stretched levels start at geometry.prob_lo[2]; erf.zsurface used to set the
1154  // bottom separately, and a flat surface did not follow it (#4442)
1155  if (pp.contains("zsurface")) {
1156  amrex::Abort("erf.zsurface is no longer supported: a stretched vertical grid now starts "
1157  "at geometry.prob_lo[2], so set the bottom of the domain there instead");
1158  }
1159 
1160  int n_zlevels = pp.countval("terrain_z_levels");
1161  if (n_zlevels > 0)
1162  {
1164  terrain_type = TerrainType::StaticFittedMesh;
1165  }
1166  if (mesh_type == MeshType::ConstantDz) {
1167  mesh_type = MeshType::StretchedDz;
1168  }
1169  }
1170 
1171  // Use lagged_delta_rt in the fast integrator?
1172  pp.queryAdd("use_lagged_delta_rt", use_lagged_delta_rt);
1173 
1174  // Average the input z-face heights onto the nodes, or reconstruct our own
1175  pp.queryAdd("avg_grid_faces_to_nodes",avg_grid_faces_to_nodes);
1176 
1177  // Build the ERF vertical grid from the file's own mean layer-thickness profile,
1178  // or from a single geometric stretch anchored on the file's first layer?
1179  pp.queryAdd("wrfinput_zlevels_from_file",wrfinput_zlevels_from_file);
1180 
1181  // Catch the old name for the flag above so the error says what to do
1182  // rather than silently ignoring the setting.
1183  if (pp.contains("use_wrf_height_grid")) {
1184  amrex::Abort("erf.use_wrf_height_grid has been renamed. "
1185  "Set erf.avg_grid_faces_to_nodes instead; it carries "
1186  "the same meaning (average the input z-face heights "
1187  "onto the nodes rather than reconstructing them).");
1188  }
1189 
1190  // Interpolate atmospheric state from coarse level instead of reading from wrfinput
1191  // when creating a finer level from coarse at a later time?
1192  pp.queryAdd("interp_atmos_from_coarse", interp_atmos_from_coarse);
1193 
1194  // Rebalance wrf state?
1195  pp.queryAdd("rebalance_wrf_input", rebalance_wrf_input);
1196 
1197  // Must rebalance if the nodal heights were reconstructed rather than averaged
1199  amrex::Print() << "Must rebalance when not averaging the input height grid. Setting rebalance_wrf_input to true \n";
1200  rebalance_wrf_input = true;
1201  }
1202 
1203  // These default to true but are used for unit testing
1204  pp.queryAdd("use_gravity", use_gravity);
1205 
1206  // Initializing from Metgrid or WRFInput without gravity makes no sense
1207  if ( !use_gravity && ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) ) {
1208  amrex::Print() << "Setting use_gravity to true due to init_type = WRFInput / Metgrid " << std::endl;
1209  use_gravity = true;
1210  }
1211 
1213 
1214  pp.queryAdd("c_p", c_p);
1215  rdOcp = R_d / c_p;
1216 
1217  // *******************************************************************************
1218  // Read compressibility_type etc and over-ride if necessary
1219  // *******************************************************************************
1220 
1221  compressibility_type.resize(max_level+1);
1222  for (int i = 0; i <= max_level; ++i) {
1223  compressibility_type[i] = CompressibilityType::FullyCompressible;
1224  }
1225  if (pp.contains("compressibility_type") && pp.contains("anelastic")) {
1226  amrex::Abort("Specify only one of erf.compressibility_type and erf.anelastic "
1227  "(erf.anelastic is deprecated)");
1228  }
1229  if (pp.contains("anelastic")) {
1230  amrex::Print() << "WARNING: erf.anelastic is deprecated; use erf.compressibility_type"
1231  << " = FullyCompressible, Anelastic or PseudoIncompressible" << std::endl;
1232  amrex::Vector<int> anelastic;
1233  read_int_string(max_level, "anelastic", anelastic, 0);
1234  for (int i = 0; i <= max_level; ++i) {
1235  if (anelastic[i] != 0 && anelastic[i] != 1) {
1236  amrex::Abort("erf.anelastic must be 0 or 1");
1237  }
1238  compressibility_type[i] = (anelastic[i] != 0) ? CompressibilityType::Anelastic
1239  : CompressibilityType::FullyCompressible;
1240  }
1241  } else {
1242  for (int i = 0; i <= max_level; ++i) {
1244  pp, "compressibility_type", compressibility_type[i], i, max_level);
1245  }
1246  }
1247  const bool fixed_density_given =
1248  read_int_string(max_level, "fixed_density", fixed_density, 0);
1249  read_int_string(max_level, "project_initial_velocity", project_initial_velocity, 0);
1250 
1251  // The anelastic equations hold the density at its base-state value, so
1252  // fixed_density is forced to 1 at every anelastic level. The pseudo-incompressible
1253  // equations evolve the density (continuity equation) with the density-departure
1254  // buoyancy -(rho - rho0) g, so fixed_density is forced to 0 and buoyancy_type to 1 there.
1255  // A user value that disagrees is ignored, and we say so rather than drop it silently.
1256  bool any_anelastic = false;
1257  bool any_compress = false;
1258  for (int i = 0; i <= max_level; ++i) {
1259  if (compressibility_type[i] == CompressibilityType::Anelastic) {
1260  if (fixed_density_given && fixed_density[i] == 0) {
1261  amrex::Print() << "WARNING: erf.fixed_density = 0 is ignored at level " << i
1262  << " because erf.compressibility_type is Anelastic there; the anelastic"
1263  << " equations always hold the density fixed in time." << std::endl;
1264  }
1265  project_initial_velocity[i] = 1;
1266  fixed_density[i] = 1; // Always fixed when anelastic
1267  buoyancy_type[i] = 3; // (This isn't actually used when anelastic is set)
1268  any_anelastic = true;
1269  } else if (compressibility_type[i] == CompressibilityType::PseudoIncompressible) {
1270  if (fixed_density_given && fixed_density[i] == 1) {
1271  amrex::Print() << "WARNING: erf.fixed_density = 1 is ignored at level " << i
1272  << " because erf.compressibility_type is PseudoIncompressible there; the"
1273  << " pseudo-incompressible equations evolve the density." << std::endl;
1274  }
1275  if (buoyancy_type[i] != 1) {
1276  amrex::Print() << "WARNING: erf.buoyancy_type = " << buoyancy_type[i] << " is replaced by 1 at level "
1277  << i << " because erf.compressibility_type is PseudoIncompressible there; the"
1278  << " pseudo-incompressible buoyancy is -(rho - rho0) g." << std::endl;
1279  }
1280  project_initial_velocity[i] = 1;
1281  fixed_density[i] = 0; // The density evolves
1282  buoyancy_type[i] = 1; // -(rho - rho0) g
1283  any_anelastic = true;
1284  } else {
1285  any_compress = true;
1286  }
1287  }
1288 
1289  // Want to have different immersed forcing defaults depending on anelastic / pseudo-incompressible
1290  // (any_anelastic is true for either) or fully compressible.
1291  // We should have different starting values because the stability of the method is dependent on dt.
1292  // dt is coarser when the pressure comes from the projection (no acoustic substeps)
1293  // --> need to loosen stiffness of immersed forcing.
1294  if (any_anelastic) {
1295  immersed_forcing_substep = false;
1296  if_Cd_momentum = amrex::Real(50.0);
1297  if_Cd_scalar = amrex::Real(5.0);
1298  } else {
1299  immersed_forcing_substep = true;
1300  if_Cd_momentum = amrex::Real(500.0);
1301  if_Cd_scalar = amrex::Real(50.0);
1302  }
1303 
1304  // *******************************************************************************
1305  // Read timestepping_type and allow for different values at each level. The default
1306  // depends on the level's compressibility: RK3_ImplicitSubstep at a FullyCompressible
1307  // level, MidPoint otherwise.
1308  // *******************************************************************************
1309  timestepping_type.resize(max_level+1);
1310  for (int i = 0; i <= max_level; i++) {
1311  timestepping_type[i] = (compressibility_type[i] == CompressibilityType::FullyCompressible)
1312  ? TimesteppingType::RK3_ImplicitSubstep : TimesteppingType::MidPoint;
1313  }
1314 
1315  const bool substepping_type_given = pp.contains("substepping_type");
1316  const bool anelastic_type_given = pp.contains("anelastic_type");
1317  if (pp.contains("timestepping_type")) {
1318  if (substepping_type_given || anelastic_type_given) {
1319  amrex::Abort("Specify erf.timestepping_type or the deprecated erf.substepping_type / "
1320  "erf.anelastic_type, not both");
1321  }
1322  for (int i = 0; i <= max_level; i++) {
1324  pp, "timestepping_type", timestepping_type[i], i, max_level);
1325  }
1326  } else {
1327  // The deprecated inputs: erf.substepping_type applied only at FullyCompressible
1328  // levels and erf.anelastic_type only at the others
1329  if (substepping_type_given) {
1330  amrex::Print() << "WARNING: erf.substepping_type is deprecated; use erf.timestepping_type"
1331  << " = RK3_ImplicitSubstep or RK3_NoSubstepping" << std::endl;
1332  for (int i = 0; i <= max_level; i++) {
1333  SubsteppingType sub = SubsteppingType::Implicit;
1334  query_one_or_per_level_enum_case_insensitive(pp, "substepping_type", sub, i, max_level);
1335  if (compressibility_type[i] == CompressibilityType::FullyCompressible) {
1337  ? TimesteppingType::RK3_NoSubstepping
1338  : TimesteppingType::RK3_ImplicitSubstep;
1339  }
1340  }
1341  }
1342  if (anelastic_type_given) {
1343  amrex::Print() << "WARNING: erf.anelastic_type is deprecated; use erf.timestepping_type"
1344  << " = RK2 or MidPoint" << std::endl;
1345  if (!any_anelastic) {
1346  amrex::Print() << "Ignoring erf.anelastic_type because every level is FullyCompressible"
1347  << std::endl;
1348  }
1349  for (int i = 0; i <= max_level; i++) {
1350  AnelasticType anelastic_scheme = AnelasticType::MidPoint;
1351  query_one_or_per_level_enum_case_insensitive(pp, "anelastic_type", anelastic_scheme, i, max_level);
1352  if (compressibility_type[i] != CompressibilityType::FullyCompressible) {
1353  timestepping_type[i] = (anelastic_scheme == AnelasticType::MidPoint)
1354  ? TimesteppingType::MidPoint : TimesteppingType::RK2;
1355  }
1356  }
1357  }
1358  }
1359 
1360  // RK3_* are the FullyCompressible integrators and RK2 / MidPoint the others
1361  for (int i = 0; i <= max_level; i++) {
1362  const bool fc = (compressibility_type[i] == CompressibilityType::FullyCompressible);
1363  const bool rk3 = (timestepping_type[i] == TimesteppingType::RK3_ImplicitSubstep ||
1364  timestepping_type[i] == TimesteppingType::RK3_NoSubstepping);
1365  if (fc != rk3) {
1366  amrex::Abort("erf.timestepping_type at level " + std::to_string(i) + " must be " +
1367  (fc ? "RK3_ImplicitSubstep or RK3_NoSubstepping because the level is "
1368  "FullyCompressible"
1369  : "RK2 or MidPoint because the level is not FullyCompressible"));
1370  }
1371  }
1372 
1373  // A moving mesh is advanced only by the RK3 integrators (erf_substep_MT with
1374  // RK3_ImplicitSubstep, the update without substeps with RK3_NoSubstepping), which by the
1375  // check above are those of a FullyCompressible level
1376  if (terrain_type == TerrainType::MovingFittedMesh) {
1377  for (int i = 0; i <= max_level; i++) {
1378  if (compressibility_type[i] != CompressibilityType::FullyCompressible) {
1379  amrex::Abort("erf.terrain_type = MovingFittedMesh requires erf.timestepping_type = "
1380  "RK3_ImplicitSubstep or RK3_NoSubstepping (a FullyCompressible level) "
1381  "at level " + std::to_string(i));
1382  }
1383  }
1384  }
1385 
1386  pp.queryAdd("substepping_diag", substepping_diag);
1387 
1388  pp.queryAdd("beta_s", beta_s);
1389 
1390  // Divergence damping coefficient for the forward projection of (rho theta)
1391  pp.queryAdd("beta_d", beta_d);
1392  if (!(beta_d >= amrex::Real(0.0) && beta_d <= amrex::Real(1.0))) {
1393  amrex::Abort("erf.beta_d must lie in [0, 1]; got " + std::to_string(beta_d));
1394  }
1395 
1396  // Number of steps between the synchronization of the two copies of a periodic face
1397  // velocity (0 = never)
1398  pp.query("face_sync_int", face_sync_int);
1399 
1400  // Spatially varying beta_s on the w-faces (implicit substepping only), set from the
1401  // terrain slope and the vertical acoustic Courant number (see make_fast_coeffs).
1402  // If it is not given, it is turned on during the run on a terrain-fitted mesh where
1403  // beta_s is below the stability limit min(sigma^2, 1) (ERF::CheckVariableBetaS);
1404  // an explicit false keeps the constant beta_s
1405  auto_variable_beta_s = !pp.contains("use_variable_beta_s");
1406  pp.queryAdd("use_variable_beta_s", use_variable_beta_s);
1407 
1408  // *******************************************************************************
1409  // Error check on deprecated input
1410  // *******************************************************************************
1411  int nvals_old = pp.countval("no_substepping");
1412  if (nvals_old > 0) {
1413  amrex::Error("The no_substepping flag is deprecated -- set erf.timestepping_type instead");
1414  }
1415 
1416  nvals_old = pp.countval("beta_s_min");
1417  if (nvals_old > 0) {
1418  amrex::Error("The beta_s_min flag is deprecated -- remove it from the inputs file");
1419  }
1420  nvals_old = pp.countval("beta_s_max");
1421  if (nvals_old > 0) {
1422  amrex::Error("The beta_s_max flag is deprecated -- remove it from the inputs file");
1423  }
1424 
1425  pp.queryAdd("ncorr", ncorr);
1426  // Wall distance on a terrain-fitted mesh (RANS): "poisson" (Tucker 2003
1427  // differential-equation distance) or "terrain_height" (height above the
1428  // local surface projected on its normal, no linear solve)
1429  pp.queryAdd("wall_dist_type", wall_dist_type);
1430  if (wall_dist_type != "poisson" && wall_dist_type != "terrain_height") {
1431  amrex::Error("erf.wall_dist_type must be poisson or terrain_height");
1432  }
1433  pp.queryAdd("poisson_abstol", poisson_abstol);
1434  pp.queryAdd("pi_drift_factor", pi_drift_factor);
1435  if (pi_drift_factor < zero) {
1436  amrex::Abort("erf.pi_drift_factor must be non-negative");
1437  }
1438  pp.queryAdd("poisson_reltol", poisson_reltol);
1439  // Solver for the projection on a terrain-fitted mesh: FFT-preconditioned GMRES (default),
1440  // or amrex::MLTerrainPoisson with multigrid, alone or under GMRES
1441  pp.query_enum_case_insensitive("terrain_poisson_solver", terrain_poisson_solver);
1442  if (pp.contains("terrain_poisson_solver") &&
1443  (mesh_type != MeshType::VariableDz || terrain_type == TerrainType::EB)) {
1444  amrex::Print() << "WARNING: erf.terrain_poisson_solver is ignored: it applies only to the "
1445  << "projection on a terrain-fitted mesh (erf.terrain_type = StaticFittedMesh "
1446  << "or MovingFittedMesh)" << std::endl;
1447  }
1448 #ifdef AMREX_USE_FLOAT
1449  poisson_abstol = amrex::max(poisson_abstol,amrex::Real(1e-6));
1450  poisson_reltol = amrex::max(poisson_reltol,amrex::Real(1e-6));
1451 #endif
1452  pp.queryAdd("force_stage1_single_substep", force_stage1_single_substep);
1453 
1454  // Include Coriolis forcing?
1455  pp.queryAdd("use_coriolis", use_coriolis);
1456  pp.queryAdd("variable_coriolis", variable_coriolis);
1457 
1458  // Include four stream radiation approximation
1459  pp.queryAdd("four_stream_radiation", four_stream_radiation);
1460 
1461  // flags for whether to apply other source terms in substep only
1462  pp.queryAdd("immersed_forcing_substep", immersed_forcing_substep); // apply immersed forcing source terms in substep only
1463  pp.queryAdd("forest_substep", forest_substep); // apply canopy-related source terms in substep only
1464 
1465  // Fixed-leaf-temperature canopy heat exchange
1466  pp.query("forest_biophysics", forest_biophysics);
1467  pp.query("forest_biophysics_heat", forest_biophysics_heat);
1468  pp.query("forest_leaf_theta_fixed", forest_leaf_theta_fixed);
1469 
1472  "forest_biophysics_heat requires forest_biophysics = true");
1476  "forest_biophysics_heat requires a positive forest_leaf_theta_fixed");
1479  "forest_leaf_theta_fixed requires forest_biophysics_heat = true");
1480 
1481  // Canopy terms of the k-eqn RANS model (erf.forest_canopy_*); the
1482  // checks that need the forest and the turbulence model are in
1483  // ERF::ReadParameters, once both are known
1485 
1486  // immersed forcing parameters
1487  pp.queryAdd("if_Cd_momentum", if_Cd_momentum);
1488  pp.queryAdd("if_Cd_scalar", if_Cd_scalar);
1489  pp.queryAdd("if_implicit_drag", if_implicit_drag); // flag for implicit vs. explicit drag formulation
1490  pp.queryAdd("if_z0", if_z0);
1491  pp.queryAdd("if_surf_temp_flux", if_surf_temp_flux);
1492  pp.queryAdd("if_init_surf_temp", if_init_surf_temp);
1493 
1494  pp.queryAdd("if_surf_heating_rate", if_surf_heating_rate);
1495 
1496  // Modify rate to be in units of K / s rather than K / hr
1497  if_surf_heating_rate /= amrex::Real(3600.0); // [K/s]
1498 
1499  pp.queryAdd("if_Olen", if_Olen_in);
1500  pp.queryAdd("if_surf_moist_flux", if_surf_moist_flux);
1501  pp.queryAdd("if_surf_moist", if_surf_moist);
1502  pp.queryAdd("if_use_most",if_use_most);
1503  pp.queryAdd("if_snap_partial_cells",if_snap_partial_cells);
1504  // The snapped staircase puts full-strength forcing on every wall face,
1505  // whose explicit relaxation rate (Cd / dx per substep) sits at the
1506  // stability limit and fails where faces stack at rims and corners; the
1507  // point-implicit form holds at any rate, so the snap uses it.
1509  amrex::Print() << "erf.if_snap_partial_cells: using the point-implicit drag (erf.if_implicit_drag = true)\n";
1510  if_implicit_drag = true;
1511  }
1512  pp.queryAdd("if_stability_correction",if_stability_correction);
1513 
1514  // Wall law of the terrain immersed forcing (erf-model/ERF#4134): "legacy" (the default)
1515  // relaxes the top partial cell toward the log law at fixed 0.5/1.5 dz;
1516  // "fraction_stress" applies the wall stress of ERF_ImmersedWallCell.H in the wall cell
1517  // and closes the wall face to diffusion (form 7 of the kynema-sgf immersed terrain)
1518  std::string if_wall_form_in = "legacy";
1519  pp.queryAdd("if_wall_form", if_wall_form_in);
1520  if (if_wall_form_in == "fraction_stress") {
1521  if_fraction_stress = true;
1522  } else if (if_wall_form_in != "legacy") {
1523  amrex::Abort("erf.if_wall_form must be legacy or fraction_stress, not " + if_wall_form_in);
1524  }
1525  // Spacing of the face above the wall cell (fraction_stress only): "log" (default) gives
1526  // that face the relative error of flat ground's first interior face for a log profile,
1527  // "physical" the centroid spacing, "grid" the cell height (ib_wall::face_above_factor)
1528  // (the keys below are accepted at their default values with the legacy law, so one deck
1529  // can run both laws; any other value belongs to fraction_stress)
1530  std::string if_wall_face_spacing_in = "log";
1531  pp.queryAdd("if_wall_face_spacing", if_wall_face_spacing_in);
1532  if (if_wall_face_spacing_in != "log" && !if_fraction_stress) {
1533  amrex::Abort("erf.if_wall_face_spacing belongs to erf.if_wall_form = fraction_stress");
1534  }
1535  if (if_wall_face_spacing_in == "grid") { if_wall_face_spacing = 0; }
1536  else if (if_wall_face_spacing_in == "physical") { if_wall_face_spacing = 1; }
1537  else if (if_wall_face_spacing_in == "log") { if_wall_face_spacing = 2; }
1538  else { amrex::Abort("erf.if_wall_face_spacing must be log, physical or grid"); }
1539  // Wall value of the k-eqn TKE in the fraction-stress wall cell, (u*^3 + kappa B d1)^(2/3)
1540  // / Cmu0^2 (the value erf.dirichlet_k holds over flat ground): with a time factor of 1
1541  // (the default) the wall cell is held at it after every stage and in the implicit TKE
1542  // solve, as flat ground is; a larger factor relaxes toward it as a source over that many
1543  // steps (the kynema-sgf form)
1544  pp.queryAdd("if_wall_tke", if_wall_tke);
1545  pp.queryAdd("if_wall_tke_time_factor", if_wall_tke_time_factor);
1547  amrex::Abort("erf.if_wall_tke = true and erf.if_wall_tke_time_factor != 1 belong to erf.if_wall_form = fraction_stress");
1548  }
1549  if (!(if_wall_tke_time_factor >= one)) {
1550  amrex::Abort("erf.if_wall_tke_time_factor must be >= 1 (steps over which the wall TKE is relaxed)");
1551  }
1552  // Partial wall cells of the fraction-stress law dissipate TKE with the length scale of flat
1553  // ground's first cell (kynema-sgf KLAxell.flat_wall_dissipation); on by default with it.
1554  // query, not queryAdd: the default depends on erf.if_wall_form, so storing it would make a
1555  // later init_params in the same process (the unit tests) see it as given (cf. #4940)
1557  pp.query("if_flat_wall_dissipation", if_flat_wall_dissipation);
1559  amrex::Abort("erf.if_flat_wall_dissipation = true belongs to erf.if_wall_form = fraction_stress");
1560  }
1561  if (if_fraction_stress) {
1562  if (terrain_type != TerrainType::ImmersedForcing) {
1563  amrex::Abort("erf.if_wall_form = fraction_stress needs erf.terrain_type = ImmersedForcing");
1564  }
1565  if (buildings_type == BuildingsType::ImmersedForcing) {
1566  amrex::Abort("erf.if_wall_form = fraction_stress is not available with erf.buildings_type = ImmersedForcing");
1567  }
1568  if (!if_use_most) {
1569  amrex::Abort("erf.if_wall_form = fraction_stress is a wall law: it needs erf.if_use_most = true");
1570  }
1571  if (mesh_type != MeshType::ConstantDz) {
1572  amrex::Abort("erf.if_wall_form = fraction_stress needs a constant-dz mesh");
1573  }
1574  // The wall heat flux and the wall TKE are written by the slow scalar source; the
1575  // compressible fast substep (erf.immersed_forcing_substep) does not carry them
1577  amrex::Abort("erf.if_wall_form = fraction_stress runs only where erf.compressibility_type is not FullyCompressible on "
1578  "every level; it does not support erf.immersed_forcing_substep = true");
1579  }
1580  // ... and the solid cells are held (rho, theta, the moisture species) by the update of an
1581  // anelastic or pseudo-incompressible level only
1582  for (int lev = 0; lev <= max_level; ++lev) {
1583  if (compressibility_type[lev] == CompressibilityType::FullyCompressible) {
1584  amrex::Abort("erf.if_wall_form = fraction_stress needs erf.compressibility_type not FullyCompressible on every level (level " +
1585  std::to_string(lev) + " is compressible)");
1586  }
1587  }
1588  // One surface condition (heat flux, surface temperature - optionally changing at
1589  // erf.if_surf_heating_rate - or Obukhov length; none is neutral, checked below); the
1590  // MOST stability functions always apply, as on the flat surface layer, so
1591  // erf.if_stability_correction (a legacy switch) must not be set
1593  amrex::Abort("erf.if_surf_heating_rate needs erf.if_init_surf_temp");
1594  }
1596  amrex::Abort("erf.if_wall_form = fraction_stress always applies the stability functions; "
1597  "erf.if_stability_correction is for the legacy wall law");
1598  }
1599  }
1600  // Surface moisture condition of the fraction-stress law: a given kinematic moisture flux or
1601  // a given surface mixing ratio (not both), as erf.most.surf_moist_flux / erf.most.surf_moist
1602  // on flat ground; it needs a moisture model that carries water vapor (the wall cell's qv
1603  // and the cell above's enter q* and the Obukhov length)
1604  {
1605  const bool moist_flux_set = (if_surf_moist_flux != zero);
1606  const bool moist_surf_set = (if_surf_moist >= zero);
1607  if (moist_flux_set || moist_surf_set) {
1608  if (!if_fraction_stress) {
1609  amrex::Abort("erf.if_surf_moist_flux and erf.if_surf_moist belong to erf.if_wall_form = fraction_stress");
1610  }
1611  if (moist_flux_set && moist_surf_set) {
1612  amrex::Abort("erf.if_surf_moist_flux and erf.if_surf_moist: give one surface moisture condition, not both");
1613  }
1615  amrex::Abort("erf.if_surf_moist_flux / erf.if_surf_moist need a moisture model that carries water vapour "
1616  "(erf.moisture_model)");
1617  }
1618  if (!(std::abs(if_surf_moist_flux) <= amrex::Real(0.01))) {
1619  amrex::Abort("erf.if_surf_moist_flux must be in [-0.01, 0.01] kg/kg m/s (a kinematic surface moisture flux; "
1620  "0.0001 is a strong evaporation)");
1621  }
1622  if (moist_surf_set && !(if_surf_moist <= amrex::Real(0.1))) {
1623  amrex::Abort("erf.if_surf_moist must be in [0, 0.1] kg/kg (a surface water vapour mixing ratio)");
1624  }
1625  }
1626  }
1627  // The wall laws that evaluate the stability functions (the legacy law with
1628  // erf.if_stability_correction, the fraction_stress law) take the surface layer's
1629  // similarity functions (the unqualified erf.most.stable_functions, erf.most.qnse_*);
1630  // read here because an immersed run need not have a surface-layer boundary
1632  most_sfuns = read_most_similarity_funs(pp, "Immersed wall law");
1633  }
1634  pp.queryAdd("if_ws_floor",if_ws_floor);
1635  pp.queryAdd("if_damp_alpha",if_damp_alpha);
1636  // Opt-in WRF-style bounds on the wall law (erf-model/ERF#4016): the wind floor behind the
1637  // friction velocity of its stability estimate, and the cap on psi_m in the momentum law as
1638  // a fraction of ln(z/z0); 0 and 1 (the defaults) turn them off
1639  pp.queryAdd("if_stability_wind_floor",if_stability_wind_floor);
1640  pp.queryAdd("if_psi_cap_factor",if_psi_cap_factor);
1641  if (!(if_stability_wind_floor >= zero)) {
1642  amrex::Abort("erf.if_stability_wind_floor must be >= 0 [m/s] (0 leaves the wind as it is)");
1643  }
1644  if (!(if_psi_cap_factor > zero && if_psi_cap_factor <= one)) {
1645  amrex::Abort("erf.if_psi_cap_factor must be in (0, 1] (1 caps psi at ln(z/z0))");
1646  }
1647  // The cell average down over immersed-forcing levels (erf-model/ERF#4918): the plain
1648  // average (the default), or one weighted by the fluid mass of the fine cells
1649  pp.queryAdd("if_average_down", if_average_down);
1650  if (if_average_down != "plain" && if_average_down != "fluid_mass") {
1651  amrex::Abort("erf.if_average_down must be plain or fluid_mass");
1652  }
1653  // (queryAdd puts the default into the table, so the test is on the value, not on contains)
1654  if (if_average_down == "fluid_mass" &&
1655  terrain_type != TerrainType::ImmersedForcing && buildings_type != BuildingsType::ImmersedForcing)
1656  {
1657  amrex::Abort("erf.if_average_down = fluid_mass needs erf.terrain_type = ImmersedForcing "
1658  "or erf.buildings_type = ImmersedForcing");
1659  }
1660  // Warn at start-up where a lateral coarse/fine boundary crosses the immersed surface so
1661  // that the levels disagree: spread of the fine solid fractions under a coarse edge cell
1662  // at least this (0 turns the check off)
1663  pp.queryAdd("if_cf_mismatch_warning", if_cf_mismatch_warning);
1665  amrex::Abort("erf.if_cf_mismatch_warning must be in [0, 1] (a spread of solid fractions; 0 turns it off)");
1666  }
1667  // Log-law share of the wall coarse face's flux among its fine sub-faces at the lateral
1668  // coarse/fine faces (erf-model/ERF#4920): the immersed surface or a surface-layer bottom
1669  // (checked in check_params); constant dz, not EB terrain. The roughness length defaults
1670  // to erf.if_z0 with immersed forcing and to the inputs' erf.most.z0 or erf.zlo.most.z0
1671  // (0.1 m when neither is given) otherwise.
1672  pp.queryAdd("cf_loglaw_fill", cf_loglaw_fill);
1673  const bool z0_given = pp.query("cf_loglaw_z0", cf_loglaw_z0);
1674  if (z0_given && !cf_loglaw_fill) {
1675  amrex::Abort("erf.cf_loglaw_z0 belongs to erf.cf_loglaw_fill = true");
1676  }
1677  if (cf_loglaw_fill) {
1678  if (mesh_type != MeshType::ConstantDz) {
1679  amrex::Abort("erf.cf_loglaw_fill needs a constant-dz mesh");
1680  }
1681  if (terrain_type == TerrainType::EB) {
1682  amrex::Abort("erf.cf_loglaw_fill is not implemented for erf.terrain_type = EB "
1683  "(its wall is not the bottom of the domain)");
1684  }
1685  if (!z0_given) {
1686  if (terrain_type == TerrainType::ImmersedForcing || buildings_type == BuildingsType::ImmersedForcing) {
1687  cf_loglaw_z0 = if_z0;
1688  } else {
1689  // the roughness given in the inputs for the bottom surface layer
1690  // (erf.most.z0, or erf.zlo.most.z0 when the faces are set one by one); a
1691  // roughness a land model supplies later is not seen here
1692  cf_loglaw_z0 = amrex::Real(0.1);
1693  pp.query("most.z0", cf_loglaw_z0);
1694  pp.query("zlo.most.z0", cf_loglaw_z0);
1695  }
1696  }
1697  if (!(cf_loglaw_z0 > zero)) {
1698  amrex::Abort("erf.cf_loglaw_z0 must be > 0 [m] (the roughness length of the log-law coarse/fine fill)");
1699  }
1700  }
1701  // Say so when a bound is set and the wall law's stability estimate is in use
1702  if ((terrain_type == TerrainType::ImmersedForcing || buildings_type == BuildingsType::ImmersedForcing) &&
1703  (if_use_most || if_surf_temp_flux != amrex::Real(1e-8) || if_Olen_in != amrex::Real(1e-8)) &&
1704  (if_psi_cap_factor < one || if_stability_wind_floor > zero))
1705  {
1706  amrex::Print() << "Immersed wall law: erf.if_psi_cap_factor = " << if_psi_cap_factor
1707  << ", erf.if_stability_wind_floor = " << if_stability_wind_floor
1708  << " m/s (WRF-style bounds; the defaults 1 and 0 turn them off)\n";
1709  }
1710 
1711  if ((if_init_surf_temp > zero && if_surf_temp_flux != amrex::Real(1e-8)) ||
1712  (if_init_surf_temp > zero && if_Olen_in != amrex::Real(1e-8)) ||
1713  (if_Olen_in != amrex::Real(1e-8) && if_surf_temp_flux != amrex::Real(1e-8)))
1714  {
1715  amrex::Error("Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
1716  }
1717  if (if_Olen_in == zero &&
1718  (terrain_type == TerrainType::ImmersedForcing || buildings_type == BuildingsType::ImmersedForcing)) {
1719  amrex::Abort("erf.if_Olen = 0 is not an Obukhov length: give a nonzero length [m] (a large |L| is near neutral)");
1720  }
1721 
1722  // The immersed forcing's "almost fluid" threshold (erf-model/ERF#4226). It is recorded
1723  // under eb2.small_volfrac here, in ReadParameters, before ERF::initializeEB runs, so the
1724  // EB build (which covers cells below it), the blanking and the forcing kernels all use
1725  // the same value, and a deck without the key gets 0.005 rather than AMReX's 1e-14.
1726  if (terrain_type == TerrainType::ImmersedForcing || buildings_type == BuildingsType::ImmersedForcing) {
1727  amrex::ParmParse pp_eb2("eb2");
1728  pp_eb2.queryAdd("small_volfrac", if_small_volfrac);
1729  if (!(if_small_volfrac >= zero && if_small_volfrac < one)) {
1730  amrex::Abort("eb2.small_volfrac must be in [0, 1) with immersed forcing");
1731  }
1732  }
1733 
1734  // Implicit drag of the immersed forcing inside the projection (erf-model/ERF#4919
1735  // for terrain, #4887 for buildings): each face momentum becomes (m* - grad phi) / (1 + dt rate),
1736  // with rate the drag rate of the source term on that face, and the solid is not frozen
1737  // afterwards, so the projected field stays divergence free in the solid too
1738  pp.queryAdd("if_implicit_projection", if_implicit_projection);
1739  if (if_implicit_projection) {
1740  const bool if_terrain = (terrain_type == TerrainType::ImmersedForcing);
1741  const bool if_buildings = (buildings_type == BuildingsType::ImmersedForcing);
1742  if (!if_terrain && !if_buildings) {
1743  amrex::Abort("erf.if_implicit_projection needs erf.terrain_type = ImmersedForcing or "
1744  "erf.buildings_type = ImmersedForcing");
1745  }
1746  if (mesh_type == MeshType::VariableDz) {
1747  amrex::Abort("erf.if_implicit_projection needs a mesh without terrain-fitted coordinates "
1748  "(constant or stretched dz)");
1749  }
1750  // The drag is inside the projection on the levels that project; a FullyCompressible
1751  // level has no projection and keeps the drag in the momentum source (if_drag_in_projection)
1752  bool any_projecting_level = false;
1753  for (int lev = 0; lev <= max_level; ++lev) {
1754  if (compressibility_type[lev] != CompressibilityType::FullyCompressible) {
1755  any_projecting_level = true;
1756  }
1757  }
1758  if (!any_projecting_level) {
1759  amrex::Abort("erf.if_implicit_projection needs erf.compressibility_type not FullyCompressible on at least one level");
1760  }
1761  }
1762 
1763  // Flag to do MOST rotations with terrain
1764  pp.queryAdd("use_rotate_surface_flux",use_rotate_surface_flux);
1766  AMREX_ASSERT_WITH_MESSAGE(terrain_type != TerrainType::None,"MOST stress rotations are only valid with terrain!");
1767  }
1768 
1769  // Which external forcings?
1770  abl_driver_type = ABLDriverType::None; // Default: no ABL driver for simulating classical fluid dynamics problems
1771  pp.query_enum_case_insensitive("abl_driver_type",abl_driver_type);
1772  pp.queryAdd("const_massflux_u", const_massflux_u);
1773  pp.queryAdd("const_massflux_v", const_massflux_v);
1774  pp.queryAdd("const_massflux_tau", const_massflux_tau);
1775  // The control divides by tau; tau <= 0 gives no source or one that drives the flow
1776  // away from the target
1777  if (!(const_massflux_tau > amrex::Real(0))) {
1778  amrex::Abort("erf.const_massflux_tau must be > 0 (got " +
1779  std::to_string(const_massflux_tau) + ")");
1780  }
1781  pp.queryAdd("const_massflux_layer_lo", const_massflux_layer_lo);
1782  pp.queryAdd("const_massflux_layer_hi", const_massflux_layer_hi);
1783 
1784  // Which type of inflow turbulent generation
1785  // Real-data initialization uses parent controls unless explicitly overridden.
1786  perturbation_auto = (init_type == InitType::WRFInput || init_type == InitType::Metgrid);
1787  pp.queryAdd("perturbation_auto", perturbation_auto);
1788  pp.queryAdd("perturbation_auto_period", perturbation_auto_period);
1789  pp.queryAdd("perturbation_auto_pbl_fraction", perturbation_auto_pbl_fraction);
1790  if (perturbation_auto &&
1791  (!(perturbation_auto_period > zero) || !std::isfinite(perturbation_auto_period) ||
1793  amrex::Abort("Automatic perturbations require perturbation_auto_period > 0 and "
1794  "0 < perturbation_auto_pbl_fraction <= 1");
1795  }
1796  pert_type.resize(max_level+1);
1797  for (int lev = 0; lev <= max_level; ++lev) {
1798  pert_type[lev] = PerturbationType::None; // Default
1800  pp, "perturbation_type", pert_type[lev], lev, max_level);
1801  }
1802 
1803  amrex::Vector<amrex::Real> abl_pressure_grad_in = {zero, zero, zero};
1804  pp.queryarr("abl_pressure_grad",abl_pressure_grad_in);
1805  for(int i = 0; i < AMREX_SPACEDIM; ++i) abl_pressure_grad[i] = abl_pressure_grad_in[i];
1806 
1807  amrex::Vector<amrex::Real> abl_geo_forcing_in = {zero, zero, zero};
1808  if(pp.queryarr("abl_geo_forcing",abl_geo_forcing_in)) {
1809  amrex::Print() << "Specified abl_geo_forcing: (";
1810  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
1811  abl_geo_forcing[i] = abl_geo_forcing_in[i];
1812  amrex::Print() << abl_geo_forcing[i] << " ";
1813  }
1814  amrex::Print() << ")" << std::endl;
1815  }
1816 
1817  if (use_coriolis)
1818  {
1820  }
1821 
1822  pp.queryAdd("add_custom_rhotheta_forcing", custom_rhotheta_forcing);
1823  pp.queryAdd("add_custom_moisture_forcing", custom_moisture_forcing);
1824  pp.queryAdd("add_custom_w_subsidence", custom_w_subsidence);
1825  pp.queryAdd("add_do_theta_advection", do_theta_advection); // If true, apply custom subsidence to (rho*theta) when add_custom_w_subsidence is used
1826  pp.queryAdd("add_do_mom_advection", do_mom_advection); // If true, apply custom subsidence to momentum when add_custom_w_subsidence is used
1827  pp.queryAdd("add_custom_geostrophic_profile", custom_geostrophic_profile);
1828  pp.queryAdd("custom_forcing_uses_primitive_vars", custom_forcing_prim_vars);
1829  pp.queryAdd("spatial_rhotheta_forcing", spatial_rhotheta_forcing);
1830  pp.queryAdd("spatial_moisture_forcing", spatial_moisture_forcing);
1831 
1832  pp.queryAdd("nudging_from_input_sounding", nudging_from_input_sounding);
1833 
1834  // Nudging towards observations at stations; the stations and the
1835  // parameters are read by the ObsNudging class, under erf.obs_nudging
1836  pp.queryAdd("nudging_from_observations", nudging_from_observations);
1837  if (nudging_from_observations && terrain_type == TerrainType::EB) {
1838  amrex::Abort("erf.nudging_from_observations does not support erf.terrain_type = EB; "
1839  "use a terrain-fitted mesh or immersed forcing");
1840  }
1841 
1842  int nudging_u_z1_set = pp.queryAdd("nudging_u_z1", nudging_u_z1);
1843  int nudging_u_z2_set = pp.queryAdd("nudging_u_z2", nudging_u_z2);
1844  pp.queryAdd("nudging_t_z1", nudging_t_z1);
1845  pp.queryAdd("nudging_t_z2", nudging_t_z2);
1846  pp.queryAdd("nudging_q_z1", nudging_q_z1);
1847  pp.queryAdd("nudging_q_z2", nudging_q_z2);
1848 
1850  "nudging_u_z1 must be less than or equal to nudging_u_z2");
1852  "nudging_t_z1 must be less than or equal to nudging_t_z2");
1854  "nudging_q_z1 must be less than or equal to nudging_q_z2");
1855 
1856  pp.queryAdd("nudging_u", nudging_u);
1857  pp.queryAdd("nudging_t", nudging_t);
1858  pp.queryAdd("nudging_q", nudging_q);
1859 
1860  pp.queryAdd("large_scale_forcing", large_scale_forcing);
1861 
1863  if (!nudging_u) {
1864  amrex::Print() << "WARNING: erf.nudging_u = false has no effect when erf.large_scale_forcing "
1865  "= true; momentum nudging is then controlled solely by large_scale_forcing.\n";
1866  }
1867  if (nudging_u_z1_set || nudging_u_z2_set) {
1868  amrex::Print() << "WARNING: erf.nudging_u_z1/erf.nudging_u_z2 are ignored when "
1869  "erf.large_scale_forcing = true; momentum nudging is then applied "
1870  "at all heights.\n";
1871  }
1872  }
1873 
1876  "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
1877 
1878  pp.queryAdd("Ave_Plane", ave_plane);
1879 
1880  // Use numerical diffusion?
1881  // The 6th-order numerical diffusion is deactivated until its known issues are resolved;
1882  // a nonzero coefficient aborts rather than being silently ignored. To restore it, bring
1883  // back the [0, 1] range check, use_num_diff = (num_diff_coeff > 0) and the 2^-6 scaling
1884  // of num_diff_coeff that this block had before erf-model/ERF#5246.
1885  pp.queryAdd("num_diff_coeff",num_diff_coeff);
1887  "erf.num_diff_coeff must be 0: the 6th-order numerical diffusion is currently "
1888  "deactivated. Remove erf.num_diff_coeff or set it to 0.");
1889  use_num_diff = false;
1890 
1891  advChoice.init_params(pp_prefix);
1892  diffChoice.init_params(pp_prefix);
1893  dampingChoice.init_params(pp_prefix);
1894  spongeChoice.init_params(pp_prefix);
1895 
1896  // A level with thin immersed bodies is projected by project_velocity_tb, which has no
1897  // drag coefficient, while erf.if_implicit_projection takes the drag out of the momentum
1898  // source and leaves the solid faces unfrozen: the immersed solid would get no drag at all
1900  amrex::Abort("erf.if_implicit_projection is not supported with thin immersed bodies "
1901  "(erf.zero_xflux_faces, erf.zero_yflux_faces, erf.zero_zflux_faces): "
1902  "set erf.if_implicit_projection = false or remove the thin bodies");
1903  }
1904 
1905  // project_velocity_tb solves the constant-coefficient (anelastic) Poisson equation; it has
1906  // no beta = rho0 theta0 / rho, so it would not enforce the pseudo-incompressible constraint
1908  for (int lev = 0; lev <= max_level; ++lev) {
1909  if (compressibility_type[lev] == CompressibilityType::PseudoIncompressible) {
1910  amrex::Abort("Thin immersed bodies (erf.zero_xflux_faces, erf.zero_yflux_faces, "
1911  "erf.zero_zflux_faces) are not supported with "
1912  "erf.compressibility_type = PseudoIncompressible (level " +
1913  std::to_string(lev) + ")");
1914  }
1915  }
1916  }
1917 
1918  // EB advection (EBAdvectionSrcForScalars, EBAdvectionSrcForMom) has only the centered and
1919  // upwind schemes; with any other the fluxes are never set and, in a Release build, the
1920  // fields are not advected at all. The moist scalars default to WENO3, so they are checked
1921  // only when they are advected.
1922  bool any_projection = false;
1923  if (terrain_type == TerrainType::EB) {
1924  auto eb_supports = [] (AdvType t) {
1925  return (t == AdvType::Centered_2nd || t == AdvType::Upwind_3rd ||
1928  };
1929  auto check_eb_adv = [&] (const std::string& name, AdvType t) {
1930  if (!eb_supports(t)) {
1931  amrex::Abort("erf." + name + " = " + advChoice.adv_type_convert_int_to_string(t) +
1932  " is not supported with erf.terrain_type = EB; use Centered_2nd, "
1933  "Upwind_3rd, Centered_4th, Upwind_5th or Centered_6th");
1934  }
1935  };
1936  check_eb_adv("dycore_horiz_adv_type", advChoice.dycore_horiz_adv_type);
1937  check_eb_adv("dycore_vert_adv_type", advChoice.dycore_vert_adv_type);
1938  check_eb_adv("dryscal_horiz_adv_type", advChoice.dryscal_horiz_adv_type);
1939  check_eb_adv("dryscal_vert_adv_type", advChoice.dryscal_vert_adv_type);
1941  check_eb_adv("moistscal_horiz_adv_type", advChoice.moistscal_horiz_adv_type);
1942  check_eb_adv("moistscal_vert_adv_type", advChoice.moistscal_vert_adv_type);
1943  }
1944 
1945  // Covering zero-area faces is required if any level projects every step
1946  for (int lev = 0; lev <= max_level; ++lev) {
1947  any_projection |= (compressibility_type[lev] != CompressibilityType::FullyCompressible);
1948  }
1949  }
1950  ebChoice.init_params(pp_prefix, any_projection);
1951 
1952  // SlowImplicit damps w implicitly in the update of a level without acoustic substeps; a
1953  // level with substeps has FastImplicit for that
1955  for (int lev = 0; lev <= max_level; ++lev) {
1956  if (level_substeps(lev)) {
1957  amrex::Abort("erf.rayleigh_damping_type = SlowImplicit needs a level without acoustic"
1958  " substeps (anelastic, pseudo-incompressible or RK3_NoSubstepping); level " +
1959  std::to_string(lev) + " takes them: use FastImplicit");
1960  }
1961  }
1962  }
1963 
1964  // A level that takes no acoustic substeps applies these terms on the slow step instead
1965  // (level_substeps); say so when they were asked for
1966  for (int lev = 0; lev <= max_level; ++lev) {
1967  if (level_substeps(lev)) { continue; }
1970  amrex::Print() << "Level " << lev << " takes no acoustic substeps: Rayleigh damping is"
1971  << " applied on the slow step there" << std::endl;
1972  }
1973  if (forest_substep) {
1974  amrex::Print() << "Level " << lev << " takes no acoustic substeps: erf.forest_substep is"
1975  << " ignored there and canopy drag is applied on the slow step" << std::endl;
1976  }
1977  if (immersed_forcing_substep && pp.contains("immersed_forcing_substep")) {
1978  amrex::Print() << "Level " << lev << " takes no acoustic substeps: erf.immersed_forcing_substep"
1979  << " is ignored there and immersed forcing is applied on the slow step" << std::endl;
1980  }
1981  }
1982 
1983  turbChoice.resize(max_level+1);
1984  for (int lev = 0; lev <= max_level; lev++) {
1985  turbChoice[lev].init_params(lev,max_level,pp_prefix);
1986  // the moist TKE buoyancy of the k-eqn RANS reads the water vapor and its flux
1987  if (turbChoice[lev].rans_moist_buoyancy &&
1989  amrex::Abort("erf.rans_moist_buoyancy needs a moisture model that carries water vapour "
1990  "(erf.moisture_model; level " + std::to_string(lev) + ")");
1991  }
1992  // the log-consistent shear of the k-eqn RANS assumes the log law of the ground below
1993  // the cell: not with a cut-cell or immersed surface, nor with thin immersed bodies
1994  if (turbChoice[lev].rans_shear_stencil == RANSShearStencil::log_law) {
1995  if (terrain_type == TerrainType::EB || terrain_type == TerrainType::ImmersedForcing ||
1996  buildings_type == BuildingsType::ImmersedForcing) {
1997  amrex::Abort("erf.rans_shear_stencil = log_law is not available with erf.terrain_type = EB or "
1998  "ImmersedForcing or erf.buildings_type = ImmersedForcing");
1999  }
2000  // the wall distance is that of the initial mesh, the height differences move
2001  if (terrain_type == TerrainType::MovingFittedMesh) {
2002  amrex::Abort("erf.rans_shear_stencil = log_law is not available with erf.terrain_type = "
2003  "MovingFittedMesh");
2004  }
2006  amrex::Abort("erf.rans_shear_stencil = log_law is not available with thin immersed bodies "
2007  "(erf.zero_xflux_faces, erf.zero_yflux_faces, erf.zero_zflux_faces)");
2008  }
2009  }
2010  }
2011 
2012  if (perturbation_auto) {
2013  // Automatic forcing has a parent and a three-dimensional LES closure.
2014  // A horizontal Smagorinsky closure paired with a PBL scheme is mesoscale.
2015  for (int lev = 0; lev <= max_level; ++lev) {
2016  const auto& tc = turbChoice[lev];
2017  if (lev == 0 || tc.les_type == LESType::None || tc.smag2d ||
2018  tc.pbl_type != PBLType::None) {
2020  }
2021  }
2022  }
2023 
2024  // WRF's Smagorinsky-2D slope limiter divides K_h by the terrain slope factor of the
2025  // mesh, which is 1 everywhere without a terrain-fitted mesh; and the EB closure
2026  // (ComputeTurbulentViscosityLES_EB) applies neither limit.
2027  bool smag2d_requested = false;
2028  bool smag2d_somewhere = false;
2029  for (int lev = 0; lev <= max_level; lev++) {
2030  smag2d_requested = smag2d_requested || turbChoice[lev].smag2d_limits_requested;
2031  smag2d_somewhere = smag2d_somewhere || turbChoice[lev].smag2d;
2032  }
2033  if (smag2d_requested && !smag2d_somewhere) {
2034  amrex::Error("erf.smag2d_slope_limiter and erf.smag2d_kh_cap apply only to "
2035  "erf.les_type = Smagorinsky2D, which no level uses");
2036  }
2037  for (int lev = 0; lev <= max_level; lev++) {
2038  const bool fitted = (terrain_type == TerrainType::StaticFittedMesh ||
2039  terrain_type == TerrainType::MovingFittedMesh);
2040  if (turbChoice[lev].smag2d_slope_limiter && !fitted) {
2041  amrex::Error("erf.smag2d_slope_limiter requires erf.terrain_type = StaticFittedMesh "
2042  "or MovingFittedMesh");
2043  }
2044  if (turbChoice[lev].smag2d_kh_cap > zero && terrain_type == TerrainType::EB) {
2045  amrex::Error("erf.smag2d_kh_cap is not supported with erf.terrain_type = EB");
2046  }
2047  }
2048 
2049  // erf.radiation_model = TwoStream selects the two-stream model; its
2050  // erf.radiation.* sub-options are read only then.
2051  radChoice.init_params(rad_type == RadiationType::TwoStream, pp_prefix);
2052  if (rad_type == RadiationType::RRTMGP) {
2053  rrtmgpSolarChoice.read(pp_prefix);
2054  }
2056  if (topographicChoice.active()) {
2057  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(terrain_type == TerrainType::StaticFittedMesh,
2058  "Topographic radiation requires erf.terrain_type = StaticFittedMesh");
2059  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(rad_type == RadiationType::RRTMGP,
2060  "Topographic radiation currently requires erf.radiation_model = RRTMGP");
2061  }
2062 
2063  // Noah-MP integrates on the downwelling shortwave, downwelling longwave and solar
2064  // zenith angle a radiation model writes into it. Only RRTMGP and TwoStream register
2065  // those outputs with the land model (rad_feeds_lsm, ERF::init_stuff), so under any
2066  // other choice they are never written and Noah-MP runs with no radiative forcing at
2067  // all -- the inputs it reads fall back to zero. That is a legitimate thing to want
2068  // in a test, and rarely what anyone running a land model means, so say it at
2069  // start-up.
2070  if (lsm_type == LandSurfaceType::NOAHMP && !rad_feeds_lsm()) {
2071  amrex::Print() << "WARNING: erf.land_surface_model = NOAHMP with erf.radiation_model = "
2072  << amrex::getEnumNameString(rad_type)
2073  << ": only RRTMGP and TwoStream supply the downwelling shortwave, "
2074  "downwelling longwave and solar zenith angle Noah-MP needs. Noah-MP "
2075  "will run with no radiative forcing (zero SWDOWN, GLW and COSZEN).\n";
2076  }
2077 
2078  vert_implicit_fac.resize(max_level+1);
2079  for (int lev = 0; lev <= max_level; lev++) {
2080  vert_implicit_fac[lev].resize(3);
2081  vert_implicit_fac[lev][0] = one;
2082  vert_implicit_fac[lev][1] = one;
2083  vert_implicit_fac[lev][2] = zero;
2084  }
2085 
2086  // YSU PBL: use consistent coriolis frequency
2087  for (int lev = 0; lev <= max_level; lev++) {
2088  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
2089  if (use_coriolis) {
2090  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
2091  if (lev == 0) {
2092  amrex::Print() << "YSU PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
2093  }
2094  } else {
2095  amrex::Error("YSU cannot use ERF coriolis frequency if not using coriolis");
2096  }
2097  }
2098  }
2099  // MRF
2100  for (int lev = 0; lev <= max_level; lev++) {
2101  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
2102  if (use_coriolis) {
2103  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
2104  if (lev == 0) {
2105  amrex::Print() << "MRF PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
2106  }
2107  } else {
2108  amrex::Error("MRF cannot use ERF coriolis frequency if not using coriolis");
2109  }
2110  }
2111  }
2112 
2113  // What's the strength of the bdy nudging?
2114  pp.queryAdd("bdy_nudge_factor",bdy_nudge_factor);
2115 
2116  // Optionally use the dry-air density reconstructed from wrfbdy. It defaults to true only
2117  // when level 0 is FullyCompressible: an anelastic level holds rho at rho0, and a
2118  // pseudo-incompressible level ties rho theta to rho0 theta0, so neither can take the WRF
2119  // density. An explicit true there still aborts (ERF::ParameterSanityChecks).
2120  if (!compressibility_type.empty() &&
2121  compressibility_type[0] != CompressibilityType::FullyCompressible) {
2122  use_wrf_bdy_density = false;
2123  }
2124  pp.queryAdd("use_wrf_bdy_density", use_wrf_bdy_density);
2125 
2126  if (!use_real_bcs || init_type != InitType::WRFInput) {
2127  use_wrf_bdy_density = false;
2128  }
2129 
2130  pp.queryAdd("bdy_rho_nudge_factor", bdy_rho_nudge_factor);
2131 
2132  // Which approach to nudging the moist variables in the boundary region?
2133  pp.queryAdd("bdy_moist_nudge_type",bdy_moist_nudge_type);
2134  if (bdy_moist_nudge_type < 0 || bdy_moist_nudge_type > 2) {
2135  amrex::Error("erf.bdy_moist_nudge_type must be one of 0, 1, or 2");
2136  }
2137 
2138  // Are me transporting the scalar component?
2139  pp.queryAdd("transport_scalar",transport_scalar);
2140 
2141  for (int lev = 0; lev <= max_level; ++lev) {
2142  if (turbChoice[lev].uses_native_shoc()) {
2143  use_native_shoc = true;
2145  }
2146  }
2147 
2148  // Set up the vertical implicit diffusion solve
2149  int n_impfac = pp.countval("vert_implicit_fac");
2150  AMREX_ALWAYS_ASSERT(n_impfac == 0 || n_impfac == 1 || n_impfac==3);
2151  if (n_impfac == 1) {
2152  amrex::Real fac_in;
2153  pp.get("vert_implicit_fac", fac_in);
2154  for (int lev = 0; lev <= max_level; lev++) {
2155  for (int i=0; i<3; ++i) {
2156  vert_implicit_fac[lev][i] = fac_in;
2157  }
2158  }
2159  } else if (n_impfac == 3) {
2160  for (int lev = 0; lev <= max_level; lev++) {
2161  pp.getarr("vert_implicit_fac", vert_implicit_fac[lev]);
2162  }
2163  }
2164 
2165  // Record whether the user explicitly requested these
2166  const bool user_set_imp_thermal = pp.contains("implicit_thermal_diffusion");
2167  const bool user_set_imp_moisture = pp.contains("implicit_moisture_diffusion");
2168  const bool user_set_imp_ke = pp.contains("implicit_ke_diffusion");
2169  const bool user_set_imp_momentum = pp.contains("implicit_momentum_diffusion");
2170 
2171  // If true (default), include implicit contributions to vertical thermal diffusion
2172  pp.queryAdd("implicit_thermal_diffusion", implicit_thermal_diffusion);
2173 
2174  // If true (default), include implicit contributions to vertical moisture diffusion
2175  pp.queryAdd("implicit_moisture_diffusion", implicit_moisture_diffusion);
2176 
2177  // If true (default), include implicit contributions to vertical KE diffusion
2178  pp.queryAdd("implicit_ke_diffusion", implicit_ke_diffusion);
2179 
2180  // If true (default), include implicit contributions in tau13, tau23,
2181  pp.queryAdd("implicit_momentum_diffusion", implicit_momentum_diffusion);
2182 
2183  // If true (default false), also solve the compact terrain-metric part of the vertical
2184  // diffusion, K_h M d2/dz2 (ERF_TerrainImplicitMetric.H), implicitly (terrain-fitted
2185  // meshes only)
2186  pp.queryAdd("implicit_terrain_metric", implicit_terrain_metric);
2187 
2188  // The default is true (i.e. that it happens before the acoustic substepping).
2189  pp.queryAdd("implicit_before_substep", implicit_before_substep);
2190  for (int lev = 0; lev <= max_level; lev++) {
2191  if ( (timestepping_type[lev] != TimesteppingType::RK3_ImplicitSubstep) && !implicit_before_substep) {
2192  amrex::Print() << "implicit_before_substep cannot be false without substepping; setting to true." << "\n";
2193  implicit_before_substep = true;
2194  }
2195  }
2196 
2197  // Handle shoc case -- SHOC owns whatever vertical diffusion the host does not
2198  if (uses_shoc_family()) {
2199  const bool host_owns_scalars = host_owns_vertical_scalar_diffusion();
2200  const bool host_owns_momentum = host_owns_vertical_momentum_diffusion();
2201  if (!host_owns_scalars &&
2202  ( (user_set_imp_thermal && implicit_thermal_diffusion ) ||
2203  (user_set_imp_moisture && implicit_moisture_diffusion) ||
2204  (user_set_imp_ke && implicit_ke_diffusion ) ) ) {
2205  amrex::Print() << "Ignoring erf.implicit_{thermal,moisture,ke}_diffusion = true; "
2206  << "SHOC owns vertical scalar diffusion." << "\n";
2207  }
2208  if (!host_owns_momentum && user_set_imp_momentum && implicit_momentum_diffusion) {
2209  amrex::Print() << "Ignoring erf.implicit_momentum_diffusion = true; "
2210  << "SHOC owns vertical momentum diffusion." << "\n";
2211  }
2212 
2213  implicit_thermal_diffusion = (implicit_thermal_diffusion && host_owns_scalars);
2215  implicit_ke_diffusion = (implicit_ke_diffusion && host_owns_scalars);
2216  implicit_momentum_diffusion = (implicit_momentum_diffusion && host_owns_momentum);
2217 
2218  // Make the resulting configuration visible in the run log
2219  if (!host_owns_scalars && !host_owns_momentum) {
2220  amrex::Print() << "Turning off vertical implicit solve for all components since SHOC owns diffusion." << "\n";
2221  } else {
2222  amrex::Print() << "SHOC hands vertical diffusion of"
2223  << (host_owns_scalars ? " scalars" : "")
2224  << (host_owns_momentum ? " momentum" : "")
2225  << " to the host; keeping the vertical implicit solve on (theta = "
2227  << ", moisture = " << implicit_moisture_diffusion
2228  << ", tke = " << implicit_ke_diffusion
2229  << ", momenta = " << implicit_momentum_diffusion << ")." << "\n";
2230  }
2231  } // uses_shoc_family
2232 
2233  // Do not allow implicit vertical diff if user turns it off
2234  bool do_vert_implicit = true;
2235  pp.queryAdd("vert_implicit", do_vert_implicit);
2236  if (!do_vert_implicit) {
2237  for (int lev = 0; lev <= max_level; lev++) {
2238  amrex::Print() << "Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
2239  vert_implicit_fac[lev][0] = zero;
2240  vert_implicit_fac[lev][1] = zero;
2241  vert_implicit_fac[lev][2] = zero;
2242  }
2243  }
2244 
2245  // The implicit vertical diffusion is only second order at an anelastic or
2246  // pseudo-incompressible level (the RK2 / MidPoint integrators) when
2247  // the two stages are the midpoint method and the solve is done in the first stage
2248  // alone: S^* = S^n + (dt/2) F(S^*) and S^{n+1} = S^n + dt F(S^*) give
2249  // S^* = (S^n + S^{n+1})/2, i.e. the implicit midpoint rule. Solving again in the
2250  // second stage would reduce the pair to backward Euler, and with the RK2 (Heun)
2251  // stages there is no stage that plays the role of the midpoint at all.
2252  for (int lev = 0; lev <= max_level; lev++) {
2253  if (compressibility_type[lev] != CompressibilityType::FullyCompressible) {
2254  if (timestepping_type[lev] == TimesteppingType::RK2) {
2255  amrex::Print() << "Turning off native vertical implicit solve flag because anelastic at level " << lev
2256  << " with RK2 scheme." << std::endl;
2257  vert_implicit_fac[lev][0] = zero;
2258  vert_implicit_fac[lev][1] = zero;
2259  vert_implicit_fac[lev][2] = zero;
2260  } else if (timestepping_type[lev] == TimesteppingType::MidPoint) {
2261  if (do_vert_implicit && vert_implicit_fac[lev][0] != one) {
2262  amrex::Print() << "Forcing implicit factor 1 in first stage of MidPoint to ensure second-order accuracy." << std::endl;
2263  vert_implicit_fac[lev][0] = one;
2264  }
2265  if (vert_implicit_fac[lev][1] > zero) {
2266  amrex::Print() << "Turning off the second-stage vertical implicit solve at level " << lev
2267  << " because anelastic with MidPoint solves in the first stage only."
2268  << std::endl;
2269  }
2270  // The anelastic / pseudo-incompressible integrator only takes two stages, so [2] is never used
2271  vert_implicit_fac[lev][1] = zero;
2272  vert_implicit_fac[lev][2] = zero;
2273  }
2274  }
2275  }
2276 
2277  // Do not allow implicit vertical diff with EB
2278  if (terrain_type == TerrainType::EB) {
2279  for (int lev = 0; lev <= max_level; lev++) {
2280  if (do_vert_implicit) {
2281  amrex::Print() << "Implicit diffusion is not supported with EB; turning off at level " << lev << "\n";
2282  vert_implicit_fac[lev][0] = zero;
2283  vert_implicit_fac[lev][1] = zero;
2284  vert_implicit_fac[lev][2] = zero;
2285  }
2286  }
2287  }
2288 
2289  // The EB diffusion path adds no buoyancy, shear or dissipation source for
2290  // a prognostic TKE closure
2291  if (terrain_type == TerrainType::EB) {
2292  for (int lev = 0; lev <= max_level; lev++) {
2293  if (turbChoice[lev].use_keqn) {
2294  amrex::Error("erf.terrain_type = EB cannot be used with erf.les_type = Deardorff "
2295  "or erf.rans_type = kEqn: the EB diffusion path has no TKE sources");
2296  }
2297  }
2298  }
2299 
2300  // Do not allow implicit vertical diff when all the components are false
2305  amrex::Print() << "Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
2306  for (int lev = 0; lev <= max_level; lev++) {
2307  vert_implicit_fac[lev][0] = zero;
2308  vert_implicit_fac[lev][1] = zero;
2309  vert_implicit_fac[lev][2] = zero;
2310  }
2311  }
2312 
2313  // Which type of multilevel coupling
2314  coupling_type = CouplingType::TwoWay; // Default
2315  pp.query_enum_case_insensitive("coupling_type",coupling_type);
2316 
2317  // Test for hybrid (compressible + anelastic or pseudo-incompressible) -- in this case we must
2318  // use one-way coupling
2319  if (any_anelastic && any_compress) {
2320  coupling_type = CouplingType::OneWay;
2321  }
2322 
2323  // Which type of windfarm model
2324  windfarm_type = WindFarmType::None; // Default
2325  pp.query_enum_case_insensitive("windfarm_type",windfarm_type);
2326 
2328  pp.query_enum_case_insensitive("windfarm_loc_type",windfarm_loc_type);
2329 
2330  pp.queryAdd("windfarm_loc_table", windfarm_loc_table);
2331  pp.queryAdd("windfarm_spec_table", windfarm_spec_table);
2332  pp.queryAdd("windfarm_blade_table", windfarm_blade_table);
2333  pp.queryAdd("windfarm_airfoil_tables", windfarm_airfoil_tables);
2334  pp.queryAdd("windfarm_spec_table_extra", windfarm_spec_table_extra);
2335 
2336  // Sampling distance upstream of the turbine to find the
2337  // incoming free stream velocity as a factor of the diameter of the
2338  // turbine. ie. the sampling distance will be this number multiplied
2339  // by the diameter of the turbine
2340  pp.queryAdd("sampling_distance_by_D", sampling_distance_by_D);
2341  pp.queryAdd("turb_disk_angle_from_x", turb_disk_angle);
2342 
2343  pp.queryAdd("windfarm_x_shift",windfarm_x_shift);
2344  pp.queryAdd("windfarm_y_shift",windfarm_y_shift);
2345  // Test if time averaged data is to be output
2346  pp.queryAdd("time_avg_vel",time_avg_vel);
2347 
2348  // Interval means and resolved turbulent moments for plotfile output
2349  pp.queryAdd("compute_mean_vars", compute_mean_vars);
2350  pp.queryAdd("mean_vars_reset_mode", mean_vars_reset_mode);
2351  pp.queryAdd("mean_vars_reset_time", mean_vars_reset_time);
2352 
2353  if (compute_mean_vars &&
2354  mean_vars_reset_mode != "plotfile" && mean_vars_reset_mode != "time") {
2355  amrex::Error("erf.mean_vars_reset_mode must be either 'plotfile' or 'time'");
2356  }
2357  if (compute_mean_vars && mean_vars_reset_mode == "time" &&
2359  amrex::Error("erf.mean_vars_reset_time must be non-negative when "
2360  "erf.mean_vars_reset_mode = 'time'");
2361  }
2362 
2363  pp.queryAdd("hindcast_lateral_forcing", hindcast_lateral_forcing);
2364 
2365  // The hindcast latitude comes with the lateral-forcing data; without it, Coriolis
2366  // takes the variable or constant latitude instead, so say which
2367  if (init_type == InitType::HindCast && use_coriolis && !hindcast_lateral_forcing) {
2368  if (variable_coriolis) {
2369  amrex::Print() << "WARNING: erf.init_type = hindcast without erf.hindcast_lateral_forcing:"
2370  << " Coriolis uses the variable latitude (erf.variable_coriolis)" << std::endl;
2371  } else {
2372  amrex::Print() << "WARNING: erf.init_type = hindcast without erf.hindcast_lateral_forcing:"
2373  << " Coriolis uses the constant erf.latitude"
2374  << (pp.contains("latitude") ? "" : ", which is not set (default 90 degrees)")
2375  << std::endl;
2376  }
2377  }
2378 
2380  pp.queryAdd("hindcast_boundary_data_dir", hindcast_boundary_data_dir);
2381 
2382  if(hindcast_boundary_data_dir.empty()) {
2383  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
2384  }
2385  pp.queryAdd("hindcast_data_interval_in_hrs", hindcast_data_interval_in_hrs);
2387  amrex::Error("ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
2388  "data files is either missing or set to less than zero");
2389  }
2390  pp.queryAdd("hindcast_lateral_sponge_strength", hindcast_lateral_sponge_strength);
2391  pp.queryAdd("hindcast_lateral_sponge_length", hindcast_lateral_sponge_length);
2392 
2393  pp.queryAdd("hindcast_zhi_sponge_length", hindcast_zhi_sponge_length);
2394  pp.queryAdd("hindcast_zhi_sponge_strength", hindcast_zhi_sponge_strength);
2395 
2396  pp.queryAdd("hindcast_zhi_sponge_damping", hindcast_zhi_sponge_damping);
2397 
2399  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
2400  }
2401 
2403  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
2404  }
2405 
2407  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_length' or it is specified to be less than zero");
2408  }
2409 
2411  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
2412  }
2413  }
2414 
2415  pp.queryAdd("hindcast_surface_bcs", hindcast_surface_bcs);
2416  if(hindcast_surface_bcs) {
2417  pp.queryAdd("hindcast_surface_data_dir", hindcast_surface_data_dir);
2418  }
2419 
2420  pp.queryAdd("io_hurricane_eye_tracker", io_hurricane_eye_tracker);
2422  pp.queryAdd("hurricane_eye_latitude", hurricane_eye_latitude);
2423  pp.queryAdd("hurricane_eye_longitude", hurricane_eye_longitude);
2424  if(hurricane_eye_latitude == amrex::Real(-1e10) or hurricane_eye_longitude == amrex::Real(-1e10)) {
2425  amrex::Error("ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
2426  " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
2427  " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
2428  " location of the eye in the initial condition");
2429  }
2430  // With init_type = hindcast the tracker takes latitude and longitude from the
2431  // forecast state, which exists only with lateral forcing
2432  if (init_type == InitType::HindCast && !hindcast_lateral_forcing) {
2433  amrex::Error("ERROR: 'erf.io_hurricane_eye_tracker' with erf.init_type = hindcast needs"
2434  " erf.hindcast_lateral_forcing = true: the tracker reads latitude and longitude"
2435  " from the forecast state, which only lateral forcing provides");
2436  }
2437  }
2438 
2439  pp.queryAdd("is_init_for_ensemble", is_init_for_ensemble);
2440  if(is_init_for_ensemble) {
2441  amrex::ParmParse pp_ens("ensemble");
2442  pp_ens.queryAdd("n_members", n_ensemble);
2443  if(n_ensemble < 2) {
2444  amrex::Abort("You are using an ensemble run. There needs to be at least 2 ensemble members. "
2445  "erf.n_ensemble must be >=2.");
2446  }
2447  pp_ens.queryAdd("coarse_bckgnd_data_file", coarse_bckgnd_data_file);
2448  if (coarse_bckgnd_data_file.empty()) {
2449  amrex::Abort("coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
2450  "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
2451  "which contains the filename in the inputs.");
2452  }
2453  pp_ens.queryAdd("ens_pert_amplitude", ens_pert_amplitude);
2454  if(ens_pert_amplitude <= 0.0) {
2455  amrex::Error("You are using initialization for ensemble simulations using the inputs option "
2456  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
2457  "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
2458  "to be added to the background state and has to be greater than 0.0");
2459  }
2460  pp_ens.queryAdd("ens_pert_correlated_radius", ens_pert_correlated_radius);
2461  if(ens_pert_correlated_radius <= 0.0) {
2462  amrex::Error("You are using initialization with spatially correlated perturbations using the inputs option "
2463  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
2464  "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
2465  "and has to be greater than 0.0");
2466  }
2467  }
2468  }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:72
constexpr amrex::Real R_d
Definition: ERF_Constants.H:49
AdvType
Definition: ERF_IndexDefines.H:329
@ Centered_4th
@ Centered_6th
@ Centered_2nd
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
similarity_funs read_most_similarity_funs(amrex::ParmParse &pp, const std::string &who="Surface layer")
Definition: ERF_MOSTUtils.H:379
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:139
void read_shoc_transport_modes(ShocTransportMode &transport_mode, ShocMomentumTransport &momentum_transport)
Read the native SHOC transport modes from the erf.shoc input namespace.
Definition: ERF_ShocTransportStruct.H:118
int query_one_or_per_level_enum_case_insensitive(const amrex::ParmParse &pp, const char *query_string, T &query_var, const int lev, const int maxlev)
Query a scalar or per-level enum input value using case-insensitive matching.
Definition: ERF_TurbStruct.H:95
AMREX_ASSERT_WITH_MESSAGE(wbar_cutoff_min > wbar_cutoff_max, "ERROR: wbar_cutoff_min < wbar_cutoff_max")
@ fc
Definition: ERF_AdvanceMorrison.cpp:141
@ t
Definition: ERF_WSM6.H:295
void init_params(std::string pp_prefix)
Read advection options from the input parameter database.
Definition: ERF_AdvStruct.H:25
bool have_zero_flux_faces
Whether any zero-flux thin immersed-body faces were specified.
Definition: ERF_AdvStruct.H:424
AdvType dycore_vert_adv_type
Vertical advection scheme for dynamical-core variables.
Definition: ERF_AdvStruct.H:404
AdvType moistscal_vert_adv_type
Vertical advection scheme for moist scalar variables.
Definition: ERF_AdvStruct.H:408
AdvType dryscal_horiz_adv_type
Horizontal advection scheme for dry scalar variables.
Definition: ERF_AdvStruct.H:405
AdvType dycore_horiz_adv_type
Horizontal advection scheme for dynamical-core variables.
Definition: ERF_AdvStruct.H:403
AdvType moistscal_horiz_adv_type
Horizontal advection scheme for moist scalar variables.
Definition: ERF_AdvStruct.H:407
std::string adv_type_convert_int_to_string(AdvType adv_int)
Convert an advection type enum to the corresponding input string.
Definition: ERF_AdvStruct.H:329
AdvType dryscal_vert_adv_type
Vertical advection scheme for dry scalar variables.
Definition: ERF_AdvStruct.H:406
void init_params(amrex::ParmParse &pp)
Definition: ERF_CanopyTurbStruct.H:32
RayleighDampingType rayleigh_damping_type
Selected Rayleigh damping time-integration treatment.
Definition: ERF_DampingStruct.H:116
void init_params(std::string pp_prefix)
Read damping options from the input parameter database.
Definition: ERF_DampingStruct.H:28
void init_params(std::string pp_prefix)
Read diffusion options from the input parameter database.
Definition: ERF_DiffStruct.H:31
void init_params(std::string pp_prefix, bool requires_cover)
Read embedded-boundary options from the input parameter database.
Definition: ERF_EBStruct.H:44
static MoistureComponentIndices from_moisture_model(const MoistureType moisture_type)
Build the complete index map – conserved-state components and qmoist diagnostic slots – for a moistur...
Definition: ERF_DataStruct.H:385
void read(const std::string &prefix)
Definition: ERF_RadStruct.H:89
void init_params(bool two_stream_selected, std::string pp_prefix)
Definition: ERF_RadStruct.H:1064
bool use_coupled_sst
Definition: ERF_DataStruct.H:3489
int sbm_moment_mode
Definition: ERF_DataStruct.H:3435
bool custom_geostrophic_profile
Whether a custom geostrophic wind profile is used.
Definition: ERF_DataStruct.H:3167
int n_ensemble
Number of ensemble members.
Definition: ERF_DataStruct.H:3571
bool implicit_before_substep
Whether implicit diffusion is applied before acoustic substepping.
Definition: ERF_DataStruct.H:3065
std::string hindcast_boundary_data_dir
Directory containing hindcast lateral boundary data.
Definition: ERF_DataStruct.H:3559
amrex::Real if_psi_cap_factor
Cap on psi_m in the immersed momentum wall law as a fraction of ln(z/z0) (1: none).
Definition: ERF_DataStruct.H:3134
amrex::Real ens_pert_correlated_radius
Spatial correlation radius for ensemble perturbations.
Definition: ERF_DataStruct.H:3572
amrex::Real forest_leaf_theta_fixed
Definition: ERF_DataStruct.H:3546
static InitType init_type
Initial-condition source selected for the run.
Definition: ERF_DataStruct.H:2983
bool io_hurricane_eye_tracker
Whether hurricane-eye tracking output is enabled.
Definition: ERF_DataStruct.H:3567
amrex::Real const_massflux_layer_lo
Lower height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:3554
amrex::Real hindcast_zhi_sponge_length
Length of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:3564
TopographicShadingChoice topographicChoice
Definition: ERF_DataStruct.H:3024
amrex::Real gravity
Effective gravitational acceleration.
Definition: ERF_DataStruct.H:3148
bool variable_coriolis
Whether spatially varying Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:3499
amrex::Real poisson_abstol
Absolute tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:3077
amrex::Real if_Cd_momentum
Immersed-forcing drag coefficient for momentum.
Definition: ERF_DataStruct.H:3106
bool nudging_t
Definition: ERF_DataStruct.H:3188
bool forest_biophysics
Definition: ERF_DataStruct.H:3544
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Build constant-latitude Coriolis forcing parameters.
Definition: ERF_DataStruct.H:2908
bool use_pert_pres_gradient
Whether momentum equations use perturbational pressure gradients.
Definition: ERF_DataStruct.H:3092
bool sbm_particle_mixing_terrain_qualification
Definition: ERF_DataStruct.H:3459
bool sbm_test_native_qc_write_fault
Definition: ERF_DataStruct.H:3446
amrex::Vector< int > project_initial_velocity
Per-level flag for projecting the initial velocity.
Definition: ERF_DataStruct.H:3031
int ave_plane
Averaging plane index used by diagnostics.
Definition: ERF_DataStruct.H:3501
bool nudging_q
Definition: ERF_DataStruct.H:3189
int ncorr
Number of projection correction iterations.
Definition: ERF_DataStruct.H:3070
amrex::Real if_small_volfrac
Immersed-forcing solid fraction below which a cell or face counts as fluid; read from eb2....
Definition: ERF_DataStruct.H:3135
static bool buildings_fc_factories
Use native face-centered EB factories for immersed buildings on a static fitted mesh.
Definition: ERF_DataStruct.H:2998
std::string sbm_particle_mixing
Definition: ERF_DataStruct.H:3454
bool use_rotate_surface_flux
Whether MOST surface fluxes are rotated with terrain.
Definition: ERF_DataStruct.H:3196
bool auto_variable_beta_s
Whether erf.use_variable_beta_s may be turned on automatically (it is not set in the inputs).
Definition: ERF_DataStruct.H:3048
bool moisture_tight_coupling
Whether moisture updates use tight coupling.
Definition: ERF_DataStruct.H:3506
bool compute_mean_vars
Definition: ERF_DataStruct.H:3212
amrex::Real test_mapfactor_amp
Amplitude of the spatially varying test map scale factors on level 0 (0: not used).
Definition: ERF_DataStruct.H:3086
amrex::Real beta_s
Time off-centering coefficient for forward weighting.
Definition: ERF_DataStruct.H:3040
amrex::Real pi_drift_factor
Definition: ERF_DataStruct.H:3083
amrex::Vector< amrex::Real > sbm_fixture_initial_state_xhi
Definition: ERF_DataStruct.H:3453
bool interp_atmos_from_coarse
Definition: ERF_DataStruct.H:3538
bool use_wrf_bdy_density
Definition: ERF_DataStruct.H:3519
std::string mean_vars_reset_mode
Definition: ERF_DataStruct.H:3215
amrex::Real num_diff_coeff
Numerical diffusion coefficient after input scaling.
Definition: ERF_DataStruct.H:3430
amrex::Real if_wall_tke_time_factor
1 (the default) pins the wall cell after every stage and in the implicit TKE solve; a larger value re...
Definition: ERF_DataStruct.H:3129
similarity_funs most_sfuns
Definition: ERF_DataStruct.H:3125
amrex::Real bdy_nudge_factor
Boundary sponge nudging factor.
Definition: ERF_DataStruct.H:3516
int sbm_cloud_rain_split
Definition: ERF_DataStruct.H:3436
amrex::Real rdOcp
Ratio of dry-air gas constant to c_p.
Definition: ERF_DataStruct.H:3150
bool hindcast_lateral_forcing
Whether hindcast lateral forcing is enabled.
Definition: ERF_DataStruct.H:3561
bool do_theta_advection
Whether custom vertical subsidence is applied to rho-theta.
Definition: ERF_DataStruct.H:3165
bool sbm_amr_qualification_regrid
Definition: ERF_DataStruct.H:3443
amrex::Real nudging_q_z2
Definition: ERF_DataStruct.H:3185
static bool use_real_bcs
Whether real-data lateral boundary conditions are used.
Definition: ERF_DataStruct.H:3001
bool spatial_moisture_forcing
Whether spatially varying moisture forcing is enabled.
Definition: ERF_DataStruct.H:3170
RRTMGPSolarChoice rrtmgpSolarChoice
Definition: ERF_DataStruct.H:3023
amrex::Real nudging_u_z2
Definition: ERF_DataStruct.H:3181
static SoundingType sounding_type
Interpretation used for input sounding profiles.
Definition: ERF_DataStruct.H:2986
int bdy_moist_nudge_type
Moist-variable nudging strategy in boundary regions.
Definition: ERF_DataStruct.H:3525
amrex::Real poisson_reltol
Relative tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:3078
UrbanType urban_type
Definition: ERF_DataStruct.H:3463
bool time_avg_vel
Whether time-averaged velocity fields are output.
Definition: ERF_DataStruct.H:3209
bool have_geo_wind_profile
Whether a geostrophic wind profile has been configured.
Definition: ERF_DataStruct.H:3497
RadChoice radChoice
Definition: ERF_DataStruct.H:3022
bool four_stream_radiation
Whether the four-stream radiation approximation is enabled.
Definition: ERF_DataStruct.H:3099
amrex::Real if_damp_alpha
Immersed-forcing damping coefficient.
Definition: ERF_DataStruct.H:3132
bool rebalance_wrf_input
Whether to rebalance states from wrfinput and wrfbdy data.
Definition: ERF_DataStruct.H:3145
bool sbm_amr_qualification_expect_zero_flow
Definition: ERF_DataStruct.H:3438
amrex::Real sbm_particle_mixing_kv
Definition: ERF_DataStruct.H:3456
bool wrfinput_zlevels_from_file
Definition: ERF_DataStruct.H:3535
amrex::Vector< amrex::Real > sbm_edges
Definition: ERF_DataStruct.H:3449
amrex::Real hindcast_data_interval_in_hrs
Time interval between hindcast data files [hr].
Definition: ERF_DataStruct.H:3560
amrex::Real const_massflux_layer_hi
Upper height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:3555
bool sbm_amr_qualification_test
Definition: ERF_DataStruct.H:3437
std::string wall_dist_type
Definition: ERF_DataStruct.H:3071
bool avg_grid_faces_to_nodes
Definition: ERF_DataStruct.H:3528
std::string windfarm_spec_table_extra
Additional wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:3508
amrex::Real if_ws_floor
Wind-speed floor [m/s] in the per-step change limit of the building wall-law forcing.
Definition: ERF_DataStruct.H:3131
bool is_init_for_ensemble
Whether initialization is for an ensemble simulation.
Definition: ERF_DataStruct.H:3570
bool uses_shoc_family() const noexcept
Query whether any SHOC-family PBL scheme is active.
Definition: ERF_DataStruct.H:3357
bool sbm_amr_qualification_expect_empty_fine_rank
Definition: ERF_DataStruct.H:3440
bool test_mapfactor
Whether to use test map scale factors.
Definition: ERF_DataStruct.H:3085
amrex::Real nudging_u_z1
Definition: ERF_DataStruct.H:3180
bool if_snap_partial_cells
Definition: ERF_DataStruct.H:3123
amrex::Vector< amrex::Real > sbm_pivots
Definition: ERF_DataStruct.H:3450
std::string coarse_bckgnd_data_file
Coarse background data file used for ensemble initialization.
Definition: ERF_DataStruct.H:3574
amrex::Real sbm_particle_mixing_kh
Definition: ERF_DataStruct.H:3455
bool sbm_amr_qualification_regrid_reject_fault
Definition: ERF_DataStruct.H:3444
amrex::Real dz0
Initial vertical grid spacing for stretched-grid setup.
Definition: ERF_DataStruct.H:3154
bool sbm_amr_qualification_unique_profile
Definition: ERF_DataStruct.H:3441
amrex::Real ens_pert_amplitude
Amplitude of ensemble initialization perturbations.
Definition: ERF_DataStruct.H:3573
std::string windfarm_airfoil_tables
Wind-farm airfoil table paths.
Definition: ERF_DataStruct.H:3509
amrex::Real bdy_rho_nudge_factor
Definition: ERF_DataStruct.H:3522
amrex::Real nudging_q_z1
Definition: ERF_DataStruct.H:3184
bool transport_scalar
Whether the passive scalar component is transported.
Definition: ERF_DataStruct.H:3206
TerrainPoissonSolver terrain_poisson_solver
Projection solver on a terrain-fitted mesh: gmres_fft (default), mlmg or gmres_mlmg.
Definition: ERF_DataStruct.H:3072
bool hindcast_zhi_sponge_damping
Whether upper-boundary hindcast sponge damping is enabled.
Definition: ERF_DataStruct.H:3565
amrex::Real hurricane_eye_longitude
Initial hurricane-eye longitude.
Definition: ERF_DataStruct.H:3568
bool nudging_from_observations
Whether solution fields are nudged toward observations at stations.
Definition: ERF_DataStruct.H:3178
LandSurfaceType lsm_type
Land-surface model.
Definition: ERF_DataStruct.H:3462
bool large_scale_forcing
Definition: ERF_DataStruct.H:3191
bool substepping_diag
Whether to emit extra CFL diagnostics for compressible substepping.
Definition: ERF_DataStruct.H:3036
amrex::Real mean_vars_reset_time
Definition: ERF_DataStruct.H:3216
std::string windfarm_blade_table
Wind-farm blade table path.
Definition: ERF_DataStruct.H:3509
CanopyTurbulence canopyTurb
Definition: ERF_DataStruct.H:3548
amrex::Vector< int > is_land
Per-level land/water selector.
Definition: ERF_DataStruct.H:3033
amrex::Real hindcast_lateral_sponge_strength
Strength of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:3563
bool forest_biophysics_heat
Definition: ERF_DataStruct.H:3545
ShocTransportMode shoc_transport_mode
Definition: ERF_DataStruct.H:3202
amrex::Real hurricane_eye_latitude
Initial hurricane-eye latitude.
Definition: ERF_DataStruct.H:3568
bool sbm_amr_qualification_uniform_ratio
Definition: ERF_DataStruct.H:3445
amrex::Real if_Cd_scalar
Immersed-forcing drag coefficient for scalars.
Definition: ERF_DataStruct.H:3107
bool sbm_amr_qualification_parent_store_fault
Definition: ERF_DataStruct.H:3442
amrex::Real if_cf_mismatch_warning
Spread of the fine solid fractions under a coarse cell along a lateral coarse/fine face at or above w...
Definition: ERF_DataStruct.H:3137
std::string windfarm_loc_table
Wind-farm location table path.
Definition: ERF_DataStruct.H:3508
std::string hindcast_surface_data_dir
Directory containing hindcast surface boundary data.
Definition: ERF_DataStruct.H:3559
bool custom_rhotheta_forcing
Whether custom rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:3162
amrex::Real beta_d
Divergence damping coefficient used in the acoustic substepping.
Definition: ERF_DataStruct.H:3052
bool sbm_test_donor_cfl_fault
Definition: ERF_DataStruct.H:3447
amrex::Real nudging_t_z2
Definition: ERF_DataStruct.H:3183
int face_sync_int
Definition: ERF_DataStruct.H:3041
std::string windfarm_spec_table
Wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:3508
bool sbm_amr_qualification_expect_split
Definition: ERF_DataStruct.H:3439
bool read_int_string(int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
Read one integer value or one value per AMR level.
Definition: ERF_DataStruct.H:2959
bool spatial_rhotheta_forcing
Whether spatially varying rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:3169
amrex::Vector< int > urban_enabled_lev
Definition: ERF_DataStruct.H:3464
bool use_variable_beta_s
Whether beta_s varies on the w-faces with the terrain slope and acoustic Courant number.
Definition: ERF_DataStruct.H:3045
bool custom_w_subsidence
Whether custom vertical subsidence is enabled.
Definition: ERF_DataStruct.H:3164
bool rad_feeds_lsm() const
True when the radiation model's outputs feed the land model (downwelling shortwave,...
Definition: ERF_DataStruct.H:3483
bool custom_moisture_forcing
Whether custom moisture forcing is enabled.
Definition: ERF_DataStruct.H:3163
amrex::Real if_surf_heating_rate
Immersed-forcing surface heating rate [K/hr].
Definition: ERF_DataStruct.H:3116
int sbm_nbins
Definition: ERF_DataStruct.H:3434
amrex::Real grid_stretching_ratio
Vertical grid stretching ratio.
Definition: ERF_DataStruct.H:3153
bool hindcast_surface_bcs
Whether hindcast surface boundary conditions are enabled.
Definition: ERF_DataStruct.H:3562
bool host_owns_vertical_scalar_diffusion() const noexcept
Test whether the host owns scalar diffusion.
Definition: ERF_DataStruct.H:3376
bool if_use_most
Whether immersed-forcing MOST is enabled.
Definition: ERF_DataStruct.H:3122
amrex::Real const_massflux_tau
Relaxation time scale for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:3553
amrex::Real hindcast_lateral_sponge_length
Length of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:3563
bool host_owns_vertical_momentum_diffusion() const noexcept
Test whether the host owns momentum diffusion.
Definition: ERF_DataStruct.H:3366
amrex::Real hindcast_zhi_sponge_strength
Strength of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:3564
int force_stage1_single_substep
Flag forcing a single substep in the first RK stage.
Definition: ERF_DataStruct.H:3026
amrex::Real c_p
Specific heat at constant pressure for dry air [J/(kg-K)].
Definition: ERF_DataStruct.H:3149
bool if_implicit_drag
Definition: ERF_DataStruct.H:3110
bool do_mom_advection
Whether custom vertical subsidence is applied to momentum.
Definition: ERF_DataStruct.H:3166
bool if_stability_correction
Whether the immersed-forcing wall law applies the MOST similarity functions, in the momentum and the ...
Definition: ERF_DataStruct.H:3124
amrex::Real nudging_t_z1
Definition: ERF_DataStruct.H:3182
amrex::Vector< amrex::Real > sbm_fixture_initial_state
Definition: ERF_DataStruct.H:3451
bool custom_forcing_prim_vars
Whether custom forcing operates on primitive variables.
Definition: ERF_DataStruct.H:3168
amrex::Real if_stability_wind_floor
Wind-speed floor [m/s] behind the friction velocity of the wall law's stability estimate (0: none).
Definition: ERF_DataStruct.H:3133
bool use_coupled_currents
Definition: ERF_DataStruct.H:3491
bool nudging_u
Definition: ERF_DataStruct.H:3187
bool nudging_from_input_sounding
Whether solution fields are nudged toward input sounding data.
Definition: ERF_DataStruct.H:3174
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:3429
bool sbm_budget_check
Definition: ERF_DataStruct.H:3448
void init_params(std::string pp_prefix)
Read sponge-layer options from the input parameter database.
Definition: ERF_SpongeStruct.H:28
void read(const std::string &prefix, const RRTMGPSolarChoice &solar)
Definition: ERF_TopographicShading.cpp:40
bool active() const
Definition: ERF_RadStruct.H:123
Here is the call graph for this function:

◆ level_substeps()

bool SolverChoice::level_substeps ( int  lev) const
inlinenoexcept
3243  {
3244  return timestepping_type[lev] == TimesteppingType::RK3_ImplicitSubstep;
3245  }

Referenced by forest_fast(), immersed_forcing_fast(), init_params(), rayleigh_fast_uvT(), rayleigh_fast_w(), rayleigh_implicit_w(), and rayleigh_slow_implicit_w().

Here is the caller graph for this function:

◆ pbl_suppresses_microphysics_condensation()

bool SolverChoice::pbl_suppresses_microphysics_condensation ( ) const
inlinenoexcept

Query whether the active PBL scheme suppresses microphysics condensation.

Returns
True when the active PBL scheme owns condensation handling.
3387  {
3388  return uses_shoc_family();
3389  }
Here is the call graph for this function:

◆ perturbation_pblh_level()

int SolverChoice::perturbation_pblh_level ( int  lev) const
inline
3411  {
3412  for (int source = lev-1; source >= 0; --source) {
3413  if (turbChoice[source].pbl_type != PBLType::None) { return source; }
3414  }
3415  for (int source = lev-1; source >= 0; --source) {
3416  const auto& tc = turbChoice[source];
3417  if (tc.les_type != LESType::None && !tc.smag2d) { return source; }
3418  }
3419  return -1;
3420  }

◆ rad_feeds_lsm()

bool SolverChoice::rad_feeds_lsm ( ) const
inline

True when the radiation model's outputs feed the land model (downwelling shortwave, downwelling longwave, solar zenith angle). RRTMGP writes them for any land model through lsm_output_ptrs; the two-stream model writes the broadband three for Noah-MP only (TwoStreamRadiation::write_land_forcing), since SLM wants the visible / near-infrared direct / diffuse split it does not compute. Both register the outputs in ERF::init_stuff and write them in ERF::advance_radiation; every site that encodes that rule must use this predicate so wiring another model in (e.g. Simple, which already runs through the interface) is one edit.

3483  {
3484  return (rad_type == RadiationType::RRTMGP) ||
3485  (rad_type == RadiationType::TwoStream && lsm_type == LandSurfaceType::NOAHMP);
3486  }

Referenced by NOAHMP::Define(), and init_params().

Here is the caller graph for this function:

◆ rad_uses_interface()

bool SolverChoice::rad_uses_interface ( ) const
inline

True for the models that run through the IRadiation interface (RRTMGP, Simple); the two-stream model has its own class.

3469  {
3470  return (rad_type == RadiationType::RRTMGP) || (rad_type == RadiationType::Simple);
3471  }

◆ rayleigh_fast_uvT()

bool SolverChoice::rayleigh_fast_uvT ( int  lev) const
inlinenoexcept

Referenced by make_mom_sources(), and make_sources().

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

◆ rayleigh_fast_w()

bool SolverChoice::rayleigh_fast_w ( int  lev) const
inlinenoexcept
3257  {
3258  return level_substeps(lev) &&
3260  }

Referenced by make_mom_sources().

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

◆ rayleigh_implicit_w()

bool SolverChoice::rayleigh_implicit_w ( int  lev) const
inlinenoexcept
3278  {
3279  return level_substeps(lev) && dampingChoice.rayleigh_damp_W &&
3281  }
bool rayleigh_damp_W
Whether Rayleigh damping is applied to vertical momentum.
Definition: ERF_DampingStruct.H:101

Referenced by make_mom_sources().

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

◆ rayleigh_slow_implicit_w()

bool SolverChoice::rayleigh_slow_implicit_w ( int  lev) const
inlinenoexcept
3289  {
3290  if (level_substeps(lev) || !dampingChoice.rayleigh_damp_W) { return false; }
3293  compressibility_type[lev] != CompressibilityType::FullyCompressible;
3294  }
bool rayleigh_damping_type_given
Definition: ERF_DampingStruct.H:117

Referenced by make_mom_sources().

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

◆ read_int_string()

bool SolverChoice::read_int_string ( int  max_level,
const char *  string_to_read,
amrex::Vector< int > &  vec_to_fill,
int  default_int 
)
inline

Read one integer value or one value per AMR level.

Parameters
max_levelMaximum AMR level configured for the run.
string_to_readParmParse key to read.
vec_to_fillDestination vector with one entry per level.
default_intDefault value used when the key is absent.
Returns
True if the key was present in the inputs.
2961  {
2962  amrex::ParmParse pp("erf");
2963  int nvals = pp.countval(string_to_read);
2964  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
2965  amrex::Vector<int> temp; temp.resize(nvals);
2966  pp.queryarr(string_to_read,temp);
2967 
2968  if (vec_to_fill.size() < max_level+1) {
2969  vec_to_fill.resize(max_level+1);
2970  }
2971 
2972  if (nvals == 0) {
2973  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
2974  } else if (nvals == 1) {
2975  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
2976  } else {
2977  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
2978  }
2979  return (nvals > 0);
2980  }

Referenced by init_params().

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

◆ set_mesh_type()

static void SolverChoice::set_mesh_type ( MeshType  new_mesh_type)
inlinestatic

Override the globally selected mesh type.

Parameters
new_mesh_typeMesh type to store.
3012  {
3013  mesh_type = new_mesh_type;
3014  }

Referenced by ERF::check_mesh_type(), and ProblemBase::init_custom_terrain().

Here is the caller graph for this function:

◆ use_building_immersed_forcing()

bool SolverChoice::use_building_immersed_forcing ( const amrex::Geometry &  geom) const
inlinenoexcept
3232  {
3233  const auto len = LengthScaleCellSize(geom);
3234  return buildings_type == BuildingsType::ImmersedForcing &&
3235  std::sqrt(len[0] * len[1]) <=
3236  amrex::Real(50.0) * (one + amrex::Real(1.e-6));
3237  }
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > LengthScaleCellSize(const amrex::Geometry &geom)
Definition: ERF_LengthScaleCellSize.H:28

Referenced by ERF::immersed_forcing_active(), make_mom_sources(), and make_sources().

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

◆ use_direct_perturbation()

bool SolverChoice::use_direct_perturbation ( int  lev) const
inline

Query whether direct turbulent perturbations are enabled on a level.

Parameters
levAMR level index.
Returns
True if direct, CPM, or CPM_W perturbations are enabled.
3327  {
3328  return pert_type[lev] == PerturbationType::Direct ||
3329  pert_type[lev] == PerturbationType::CPM ||
3330  pert_type[lev] == PerturbationType::CPM_W;
3331  }

◆ use_perturbation()

bool SolverChoice::use_perturbation ( int  lev) const
inline

Query whether any turbulent perturbation mode is enabled on a level.

Parameters
levAMR level index.
Returns
True if source, direct, CPM, or CPM_W perturbations are enabled.
3314  {
3315  return pert_type[lev] == PerturbationType::Source ||
3316  pert_type[lev] == PerturbationType::Direct ||
3317  pert_type[lev] == PerturbationType::CPM ||
3318  pert_type[lev] == PerturbationType::CPM_W;
3319  }

◆ use_source_perturbation()

bool SolverChoice::use_source_perturbation ( int  lev) const
inline

Query whether source-term turbulent perturbations are enabled on a level.

Parameters
levAMR level index.
Returns
True if source perturbations are enabled.
3339  {
3340  return pert_type[lev] == PerturbationType::Source;
3341  }

Referenced by make_sources().

Here is the caller graph for this function:

◆ use_wvel_perturbation()

bool SolverChoice::use_wvel_perturbation ( int  lev) const
inline

Query whether vertical-velocity CPM perturbations are enabled on a level.

Parameters
levAMR level index.
Returns
True if CPM_W perturbations are enabled.
3349  {
3350  return pert_type[lev] == PerturbationType::CPM_W;
3351  }

◆ uses_shoc_family()

bool SolverChoice::uses_shoc_family ( ) const
inlinenoexcept

Query whether any SHOC-family PBL scheme is active.

Returns
True if native SHOC is active.
3358  {
3359  return use_native_shoc;
3360  }

Referenced by Kessler::Define(), Morrison::Define(), SAM::Define(), SatAdj::Define(), WDM6::Define(), WSM6::Define(), init_params(), and pbl_suppresses_microphysics_condensation().

Here is the caller graph for this function:

◆ zcc_vertical_metric()

bool SolverChoice::zcc_vertical_metric ( int  lev) const
inlinenoexcept
3268  {
3269  if (mesh_type != MeshType::ConstantDz) { return true; }
3270  return lev >= 0 && lev < static_cast<int>(zcc_vertical_metric_lev.size()) &&
3271  zcc_vertical_metric_lev[lev] != 0;
3272  }
amrex::Vector< int > zcc_vertical_metric_lev
Definition: ERF_DataStruct.H:3273

Referenced by compute_gradp(), and make_gradp_pert().

Here is the caller graph for this function:

Member Data Documentation

◆ abl_driver_type

SolverChoice::abl_driver_type

Atmospheric boundary-layer driver type.

Referenced by build_coriolis_forcings_const_lat(), display(), and init_params().

◆ abl_geo_forcing

SolverChoice::abl_geo_forcing

Applied geostrophic-wind forcing vector.

Referenced by build_coriolis_forcings_const_lat(), display(), init_params(), and make_mom_sources().

◆ abl_geo_wind_table

SolverChoice::abl_geo_wind_table

Path to a time-varying geostrophic wind table.

Referenced by build_coriolis_forcings_const_lat(), and init_params().

◆ abl_pressure_grad

SolverChoice::abl_pressure_grad

Applied ABL pressure-gradient forcing vector.

Referenced by display(), erf_slow_rhs_pre(), and init_params().

◆ advChoice

SolverChoice::advChoice

Advection-related options.

Referenced by ERF::ComputeGhostCells(), display(), erf_slow_rhs_post(), erf_slow_rhs_pre(), and init_params().

◆ auto_variable_beta_s

SolverChoice::auto_variable_beta_s = true

Whether erf.use_variable_beta_s may be turned on automatically (it is not set in the inputs).

Referenced by init_params().

◆ ave_plane

SolverChoice::ave_plane {2}

Averaging plane index used by diagnostics.

Referenced by SAM::Define(), WDM6::Define(), WSM6::Define(), init_params(), make_mom_sources(), and make_sources().

◆ avg_grid_faces_to_nodes

bool SolverChoice::avg_grid_faces_to_nodes {false}

Referenced by init_params().

◆ bdy_moist_nudge_type

SolverChoice::bdy_moist_nudge_type = 1

Moist-variable nudging strategy in boundary regions.

Referenced by init_params().

◆ bdy_nudge_factor

SolverChoice::bdy_nudge_factor = amrex::Real(10.0)

Boundary sponge nudging factor.

Referenced by init_params().

◆ bdy_rho_nudge_factor

amrex::Real SolverChoice::bdy_rho_nudge_factor = amrex::Real(-1.0)

Referenced by init_params().

◆ beta_d

SolverChoice::beta_d = amrex::Real(0.1)

Divergence damping coefficient used in the acoustic substepping.

Referenced by init_params().

◆ beta_s

SolverChoice::beta_s = amrex::Real(0.1)

Time off-centering coefficient for forward weighting.

Referenced by init_params().

◆ buildings_fc_factories

SolverChoice::buildings_fc_factories = false
inlinestatic

Use native face-centered EB factories for immersed buildings on a static fitted mesh.

Referenced by init_params(), and ERF::use_native_fc_factories().

◆ buildings_type

SolverChoice::buildings_type = BuildingsType::None
inlinestatic

◆ buoyancy_type

SolverChoice::buoyancy_type

Per-level buoyancy formulation selector.

Referenced by check_params(), display(), init_params(), and make_buoyancy().

◆ c_p

SolverChoice::c_p = Cp_d

Specific heat at constant pressure for dry air [J/(kg-K)].

Referenced by Kessler::Define(), SAM::Define(), SatAdj::Define(), and init_params().

◆ canopyTurb

CanopyTurbulence SolverChoice::canopyTurb

◆ cf_loglaw_fill

SolverChoice::cf_loglaw_fill = false

Share the flux of the first coarse face above a wall among its fine sub-faces at the lateral coarse/fine faces by ln(1 + z/z0) at their heights above the wall, instead of the linear interpolation; the immersed surface or a surface-layer bottom, constant dz.

Referenced by check_params(), and init_params().

◆ cf_loglaw_z0

SolverChoice::cf_loglaw_z0 = amrex::Real(-1.0)

Roughness length [m] of that share; by default erf.if_z0 with immersed forcing, else the inputs' erf.most.z0 or erf.zlo.most.z0 (0.1 m when neither is given).

Referenced by check_params(), and init_params().

◆ coarse_bckgnd_data_file

SolverChoice::coarse_bckgnd_data_file

Coarse background data file used for ensemble initialization.

Referenced by init_params().

◆ compressibility_type

◆ compute_mean_vars

bool SolverChoice::compute_mean_vars = false

Referenced by init_params().

◆ const_massflux_layer_hi

SolverChoice::const_massflux_layer_hi = amrex::Real( bogus_large_value)

Upper height of the constant-mass-flux forcing layer.

Referenced by ERF::ERF_shared(), and init_params().

◆ const_massflux_layer_lo

SolverChoice::const_massflux_layer_lo = amrex::Real(-bogus_large_value)

Lower height of the constant-mass-flux forcing layer.

Referenced by ERF::ERF_shared(), and init_params().

◆ const_massflux_tau

SolverChoice::const_massflux_tau = one

Relaxation time scale for constant-mass-flux forcing.

Referenced by init_params(), and make_mom_sources().

◆ const_massflux_u

SolverChoice::const_massflux_u = zero

Target constant mass flux in the x direction.

Referenced by check_params(), ERF::ERF_shared(), init_params(), and make_mom_sources().

◆ const_massflux_v

SolverChoice::const_massflux_v = zero

Target constant mass flux in the y direction.

Referenced by check_params(), ERF::ERF_shared(), init_params(), and make_mom_sources().

◆ coriolis_3d

SolverChoice::coriolis_3d = true

Whether the three-dimensional Coriolis terms are included.

Referenced by build_coriolis_forcings_const_lat().

◆ coriolis_factor

SolverChoice::coriolis_factor = zero

Twice the planetary rotation rate used for Coriolis forcing.

Referenced by build_coriolis_forcings_const_lat(), init_params(), and make_mom_sources().

◆ cosphi

SolverChoice::cosphi = zero

Cosine of the latitude used for Coriolis forcing.

Referenced by build_coriolis_forcings_const_lat(), and make_mom_sources().

◆ coupling_type

SolverChoice::coupling_type

Multilevel coupling strategy.

Referenced by check_params(), display(), init_params(), and RefluxStageWeight().

◆ custom_forcing_prim_vars

SolverChoice::custom_forcing_prim_vars = false

Whether custom forcing operates on primitive variables.

Referenced by init_params(), and make_sources().

◆ custom_geostrophic_profile

SolverChoice::custom_geostrophic_profile = false

Whether a custom geostrophic wind profile is used.

Referenced by init_params().

◆ custom_moisture_forcing

SolverChoice::custom_moisture_forcing = false

Whether custom moisture forcing is enabled.

Referenced by init_params(), and make_sources().

◆ custom_rhotheta_forcing

SolverChoice::custom_rhotheta_forcing = false

Whether custom rho-theta forcing is enabled.

Referenced by init_params(), and make_sources().

◆ custom_w_subsidence

SolverChoice::custom_w_subsidence = false

Whether custom vertical subsidence is enabled.

Referenced by init_params(), make_mom_sources(), and make_sources().

◆ dampingChoice

◆ diffChoice

◆ do_forest_drag

SolverChoice::do_forest_drag {false}

Whether forest canopy drag is enabled.

Referenced by make_mom_sources().

◆ do_mom_advection

SolverChoice::do_mom_advection = true

Whether custom vertical subsidence is applied to momentum.

Referenced by init_params(), and make_mom_sources().

◆ do_theta_advection

SolverChoice::do_theta_advection = true

Whether custom vertical subsidence is applied to rho-theta.

Referenced by init_params(), and make_sources().

◆ dz0

SolverChoice::dz0 = zero

Initial vertical grid spacing for stretched-grid setup.

Referenced by ERF::ERF_shared(), and init_params().

◆ ebChoice

SolverChoice::ebChoice

◆ ens_pert_amplitude

SolverChoice::ens_pert_amplitude = -1.0

Amplitude of ensemble initialization perturbations.

Referenced by init_params().

◆ ens_pert_correlated_radius

SolverChoice::ens_pert_correlated_radius = -1.0

Spatial correlation radius for ensemble perturbations.

Referenced by init_params().

◆ face_sync_int

int SolverChoice::face_sync_int = 1

Referenced by init_params().

◆ fixed_density

SolverChoice::fixed_density

Per-level flag selecting fixed-density treatment; always 1 at an anelastic level and 0 at a pseudo-incompressible level.

Referenced by display(), erf_slow_rhs_pre(), and init_params().

◆ flat_terrain

SolverChoice::flat_terrain = false
inlinestatic

Permit fixed-index planar averages after validating a flat fitted mesh.

Referenced by display(), init_params(), and make_mom_sources().

◆ force_stage1_single_substep

SolverChoice::force_stage1_single_substep = 1

Flag forcing a single substep in the first RK stage.

Referenced by init_params().

◆ forest_biophysics

bool SolverChoice::forest_biophysics {false}

Referenced by init_params().

◆ forest_biophysics_heat

bool SolverChoice::forest_biophysics_heat {false}

◆ forest_leaf_theta_fixed

amrex::Real SolverChoice::forest_leaf_theta_fixed {-one}

◆ forest_substep

SolverChoice::forest_substep = false

Whether canopy source terms are applied only during substeps.

Referenced by forest_fast(), and init_params().

◆ four_stream_radiation

SolverChoice::four_stream_radiation = false

Whether the four-stream radiation approximation is enabled.

Referenced by init_params(), and make_sources().

◆ gradp_2nd_order_bndry

SolverChoice::gradp_2nd_order_bndry = false

Whether ChainRule takes dp/dz at the bottom and top from a second-order one-sided difference.

Referenced by compute_gradp_xy(), display(), and init_params().

◆ gradp_type

SolverChoice::gradp_type = GradpType::ChainRule

Terrain-fitted horizontal pressure-gradient formulation.

Referenced by display(), init_params(), and make_gradp_pert().

◆ gravity

SolverChoice::gravity

Effective gravitational acceleration.

Referenced by compute_gradp_hse(), ComputeTurbulentViscosity(), erf_slow_rhs_post(), init_params(), and make_buoyancy().

◆ grid_stretching_ratio

SolverChoice::grid_stretching_ratio = 0

Vertical grid stretching ratio.

Referenced by ERF::ERF_shared(), and init_params().

◆ have_geo_wind_profile

SolverChoice::have_geo_wind_profile {false}

Whether a geostrophic wind profile has been configured.

Referenced by init_params(), and make_mom_sources().

◆ hindcast_boundary_data_dir

SolverChoice::hindcast_boundary_data_dir

Directory containing hindcast lateral boundary data.

Referenced by init_params().

◆ hindcast_data_interval_in_hrs

SolverChoice::hindcast_data_interval_in_hrs = -one

Time interval between hindcast data files [hr].

Referenced by init_params().

◆ hindcast_lateral_forcing

SolverChoice::hindcast_lateral_forcing = false

Whether hindcast lateral forcing is enabled.

Referenced by init_params(), and make_mom_sources().

◆ hindcast_lateral_sponge_length

SolverChoice::hindcast_lateral_sponge_length = -one

Length of the hindcast lateral sponge layer.

Referenced by ApplyBndryForcing_Forecast(), and init_params().

◆ hindcast_lateral_sponge_strength

SolverChoice::hindcast_lateral_sponge_strength = -one

Strength of the hindcast lateral sponge layer.

Referenced by ApplyBndryForcing_Forecast(), and init_params().

◆ hindcast_surface_bcs

SolverChoice::hindcast_surface_bcs = false

Whether hindcast surface boundary conditions are enabled.

Referenced by init_params().

◆ hindcast_surface_data_dir

SolverChoice::hindcast_surface_data_dir

Directory containing hindcast surface boundary data.

Referenced by init_params().

◆ hindcast_zhi_sponge_damping

SolverChoice::hindcast_zhi_sponge_damping = false

Whether upper-boundary hindcast sponge damping is enabled.

Referenced by ApplyBndryForcing_Forecast(), and init_params().

◆ hindcast_zhi_sponge_length

SolverChoice::hindcast_zhi_sponge_length = -one

Length of the upper hindcast sponge layer.

Referenced by ApplyBndryForcing_Forecast(), and init_params().

◆ hindcast_zhi_sponge_strength

SolverChoice::hindcast_zhi_sponge_strength = -one

Strength of the upper hindcast sponge layer.

Referenced by ApplyBndryForcing_Forecast(), and init_params().

◆ hurricane_eye_latitude

SolverChoice::hurricane_eye_latitude = -1e10

Initial hurricane-eye latitude.

Referenced by ERF::HurricaneEyeTracker(), and init_params().

◆ hurricane_eye_longitude

SolverChoice::hurricane_eye_longitude = -1e10

Initial hurricane-eye longitude.

Referenced by ERF::HurricaneEyeTracker(), and init_params().

◆ if_average_down

SolverChoice::if_average_down = "plain"

Cell average down over immersed-forcing levels: "plain" (the default, the plain cell average) or "fluid_mass" (the fine cells weighted by their fluid mass, coarse cells solid on their own level kept; see if_average_down in ERF_Utils.H).

Referenced by check_params(), and init_params().

◆ if_Cd_momentum

◆ if_Cd_scalar

SolverChoice::if_Cd_scalar = amrex::Real(10.0)

◆ if_cf_mismatch_warning

SolverChoice::if_cf_mismatch_warning = amrex::Real(0.75)

Spread of the fine solid fractions under a coarse cell along a lateral coarse/fine face at or above which the start-up warning counts the cell (the levels describe the surface differently there); 0 turns the check off.

Referenced by init_params().

◆ if_damp_alpha

SolverChoice::if_damp_alpha = 0.5

◆ if_flat_wall_dissipation

SolverChoice::if_flat_wall_dissipation = false

Partial fraction-stress wall cells dissipate TKE with the length scale of flat ground's first cell; on by default with the fraction-stress law.

Referenced by check_params(), ComputeTurbulentViscosity(), and init_params().

◆ if_fraction_stress

SolverChoice::if_fraction_stress = false

erf.if_wall_form = fraction_stress: the wall stress of ERF_ImmersedWallCell.H in the wall cell of each column, with the wall face closed to diffusion; false is the legacy MOST relaxation at fixed 0.5/1.5 dz (the default, unchanged).

Referenced by check_params(), ComputeTurbulentViscosity(), erf_slow_rhs_post(), init_params(), make_mom_sources(), and make_sources().

◆ if_implicit_drag

◆ if_implicit_projection

bool SolverChoice::if_implicit_projection = false

◆ if_init_surf_temp

SolverChoice::if_init_surf_temp = zero

Initial immersed-forcing surface temperature [K].

Referenced by check_params(), ImmersedForcingBuildings_Scalar(), ImmersedForcingTerrain_Scalar(), init_params(), and make_wall_cond().

◆ if_Olen_in

◆ if_psi_cap_factor

SolverChoice::if_psi_cap_factor = amrex::Real(1.0)

Cap on psi_m in the immersed momentum wall law as a fraction of ln(z/z0) (1: none).

Referenced by ImmersedForcingBuildings_Xmom(), ImmersedForcingBuildings_Ymom(), ImmersedForcingBuildings_Zmom(), ImmersedForcingTerrain_Xmom(), ImmersedForcingTerrain_Ymom(), and init_params().

◆ if_small_volfrac

SolverChoice::if_small_volfrac = amrex::Real(0.005)

◆ if_snap_partial_cells

SolverChoice::if_snap_partial_cells = false

When true, the immersed forcing reads the blanking snapped to solid (1) or fluid (0) at half, so a building from a height map becomes the same staircase of whole cells an exact box is: the wall law (and the thermal conditions) sit on the boundary solid cells, roofs included, the drag on the interior cells, and nothing on the sliver cells of the reader's one-cell ramp (1-20 percent solid at the corners), on which the raw fractions make the wall law and the drag disagree and grow a vertical checkerboard over hours. The staircase puts full-strength forcing on every wall face, so the switch also selects the point-implicit drag form (if_implicit_drag), without which the explicit rate at rims and corners drives the density negative within seconds. The momentum kernels take the blanking of a face from the two cells it joins (solid if either is), so the staircase is the same with and without the face-centered blanking of the build; a face between a solid and a fluid cell is wall-normal and gets the interior drag toward zero (no penetration) whichever row it lies in, and a face between two solid cells the roof or wall law of its row (with the full log-law target; the partial-cell weight of the target is not applied) or the interior drag. Buildings only (erf.buildings_type = ImmersedForcing): the terrain kernels keep the raw fractions, whose wall law is weighted by the fluid fraction of the face. Default false, the raw fractions, for backward compatibility (on an exact box a boundary cell then carries the wall law and the interior drag together, and the roof only the drag); set it for height-map buildings.

Referenced by ImmersedForcingBuildings_Scalar(), ImmersedForcingBuildings_Xmom(), ImmersedForcingBuildings_Ymom(), ImmersedForcingBuildings_Zmom(), and init_params().

◆ if_stability_correction

SolverChoice::if_stability_correction = false

Whether the immersed-forcing wall law applies the MOST similarity functions, in the momentum and the temperature kernels alike (off: the log law; a prescribed flux or Obukhov length still sets theta*).

Referenced by ImmersedForcingBuildings_Scalar(), ImmersedForcingBuildings_Xmom(), ImmersedForcingBuildings_Ymom(), ImmersedForcingBuildings_Zmom(), ImmersedForcingTerrain_Scalar(), ImmersedForcingTerrain_Xmom(), ImmersedForcingTerrain_Ymom(), and init_params().

◆ if_stability_wind_floor

SolverChoice::if_stability_wind_floor = amrex::Real(0.0)

◆ if_surf_heating_rate

SolverChoice::if_surf_heating_rate = zero

Immersed-forcing surface heating rate [K/hr].

Referenced by ImmersedForcingBuildings_Scalar(), ImmersedForcingTerrain_Scalar(), init_params(), and make_wall_cond().

◆ if_surf_moist

amrex::Real SolverChoice::if_surf_moist = amrex::Real(-1.0)

◆ if_surf_moist_flux

amrex::Real SolverChoice::if_surf_moist_flux = zero

◆ if_surf_temp_flux

◆ if_use_most

◆ if_wall_face_spacing

SolverChoice::if_wall_face_spacing = 2

Spacing the face above the fraction-stress wall cell differences over: 0 the cell height, 1 the centroid spacing, 2 (default) the log spacing (ib_wall::face_above_factor).

Referenced by check_params(), and init_params().

◆ if_wall_tke

SolverChoice::if_wall_tke = false

Hold the k-eqn TKE of the fraction-stress wall cell at its flat-ground wall value (ib_wall::wall_tke), as erf.dirichlet_k does over flat ground.

Referenced by check_params(), init_params(), and make_sources().

◆ if_wall_tke_time_factor

SolverChoice::if_wall_tke_time_factor = amrex::Real(1.0)

1 (the default) pins the wall cell after every stage and in the implicit TKE solve; a larger value relaxes toward the wall value as a source over that many steps.

Referenced by erf_slow_rhs_post(), ImmersedForcingTerrain_Scalar_FractionStress(), and init_params().

◆ if_ws_floor

SolverChoice::if_ws_floor = 0.001

Wind-speed floor [m/s] in the per-step change limit of the building wall-law forcing.

Referenced by ImmersedForcingBuildings_Xmom(), ImmersedForcingBuildings_Ymom(), ImmersedForcingBuildings_Zmom(), and init_params().

◆ if_z0

◆ immersed_forcing_substep

SolverChoice::immersed_forcing_substep = false

Whether immersed-forcing source terms are applied only during substeps.

Referenced by immersed_forcing_fast(), and init_params().

◆ implicit_before_substep

SolverChoice::implicit_before_substep = true

Whether implicit diffusion is applied before acoustic substepping.

Referenced by init_params().

◆ implicit_ke_diffusion

SolverChoice::implicit_ke_diffusion = true

Whether implicit vertical TKE diffusion is included.

Referenced by display(), erf_slow_rhs_post(), and init_params().

◆ implicit_moisture_diffusion

SolverChoice::implicit_moisture_diffusion = true

Whether implicit vertical moisture diffusion is included.

Referenced by check_params(), display(), erf_slow_rhs_post(), and init_params().

◆ implicit_momentum_diffusion

SolverChoice::implicit_momentum_diffusion = true

Whether implicit vertical momentum diffusion is included.

Referenced by check_params(), display(), erf_make_tau_terms(), and init_params().

◆ implicit_terrain_metric

SolverChoice::implicit_terrain_metric = false

Whether the compact terrain-metric part of the vertical diffusion is solved implicitly.

Referenced by check_params(), DiffusionSrcForState_T(), display(), erf_make_tau_terms(), and init_params().

◆ implicit_thermal_diffusion

SolverChoice::implicit_thermal_diffusion = true

Whether implicit vertical thermal diffusion is included.

Referenced by check_params(), display(), erf_slow_rhs_pre(), and init_params().

◆ init_type

SolverChoice::init_type = InitType::None
inlinestatic

◆ interp_atmos_from_coarse

bool SolverChoice::interp_atmos_from_coarse {false}

Referenced by init_params().

◆ io_hurricane_eye_tracker

SolverChoice::io_hurricane_eye_tracker = false

Whether hurricane-eye tracking output is enabled.

Referenced by init_params().

◆ is_init_for_ensemble

SolverChoice::is_init_for_ensemble = false

Whether initialization is for an ensemble simulation.

Referenced by init_params().

◆ is_land

SolverChoice::is_land

Per-level land/water selector.

Referenced by init_params().

◆ large_scale_forcing

bool SolverChoice::large_scale_forcing = false

Referenced by init_params(), and make_mom_sources().

◆ lsf_file

std::string SolverChoice::lsf_file = ""

◆ lsf_timescale

amrex::Real SolverChoice::lsf_timescale = zero

◆ lsm_type

SolverChoice::lsm_type

Land-surface model.

Referenced by init_params(), rad_feeds_lsm(), and Radiation::Radiation().

◆ massflux_khi

SolverChoice::massflux_khi {0}

Upper vertical index for constant-mass-flux forcing.

Referenced by ERF::ERF_shared(), and make_mom_sources().

◆ massflux_klo

SolverChoice::massflux_klo {0}

Lower vertical index for constant-mass-flux forcing.

Referenced by ERF::ERF_shared(), and make_mom_sources().

◆ mean_vars_reset_mode

std::string SolverChoice::mean_vars_reset_mode = "plotfile"

Referenced by init_params().

◆ mean_vars_reset_time

amrex::Real SolverChoice::mean_vars_reset_time = -one

Referenced by init_params().

◆ mesh_type

SolverChoice::mesh_type = MeshType::ConstantDz
inlinestatic

◆ moisture_indices

◆ moisture_tight_coupling

SolverChoice::moisture_tight_coupling {false}

Whether moisture updates use tight coupling.

Referenced by init_params().

◆ moisture_type

◆ most_sfuns

◆ n_ensemble

SolverChoice::n_ensemble = -1

Number of ensemble members.

Referenced by init_params().

◆ ncorr

SolverChoice::ncorr = 1

Number of projection correction iterations.

Referenced by init_params().

◆ nudging_from_input_sounding

SolverChoice::nudging_from_input_sounding = false

Whether solution fields are nudged toward input sounding data.

Referenced by init_params(), and make_mom_sources().

◆ nudging_from_observations

SolverChoice::nudging_from_observations = false

Whether solution fields are nudged toward observations at stations.

Referenced by init_params().

◆ nudging_q

bool SolverChoice::nudging_q = true

Referenced by init_params().

◆ nudging_q_z1

amrex::Real SolverChoice::nudging_q_z1 = zero

Referenced by init_params().

◆ nudging_q_z2

amrex::Real SolverChoice::nudging_q_z2 = amrex::Real(10000.0)

Referenced by init_params().

◆ nudging_t

bool SolverChoice::nudging_t = true

Referenced by init_params().

◆ nudging_t_z1

amrex::Real SolverChoice::nudging_t_z1 = zero

Referenced by init_params().

◆ nudging_t_z2

amrex::Real SolverChoice::nudging_t_z2 = amrex::Real(10000.0)

Referenced by init_params().

◆ nudging_u

bool SolverChoice::nudging_u = true

Referenced by init_params(), and make_mom_sources().

◆ nudging_u_z1

amrex::Real SolverChoice::nudging_u_z1 = amrex::Real(-1.0e36)

Referenced by init_params(), and make_mom_sources().

◆ nudging_u_z2

amrex::Real SolverChoice::nudging_u_z2 = amrex::Real(1.0e36)

Referenced by init_params(), and make_mom_sources().

◆ num_diff_coeff

SolverChoice::num_diff_coeff {zero}

Numerical diffusion coefficient after input scaling.

Referenced by init_params(), make_mom_sources(), and make_sources().

◆ pert_type

SolverChoice::pert_type

◆ perturbation_auto

SolverChoice::perturbation_auto {false}

Select LES nests, using parent winds and a PBL ancestor's height, or the nearest LES ancestor's diagnostic when no PBL scheme is present. Defaults to true for WRFInput and Metgrid initialization, false otherwise.

Referenced by check_params(), display(), and init_params().

◆ perturbation_auto_pbl_fraction

SolverChoice::perturbation_auto_pbl_fraction {amrex::Real(0.9)}

Fraction of the selected ancestor's PBL height occupied by perturbations.

Referenced by display(), and init_params().

◆ perturbation_auto_period

SolverChoice::perturbation_auto_period {amrex::Real(600.0)}

Seconds between automatic parent-wind and PBL-height updates.

Referenced by display(), and init_params().

◆ pi_drift_factor

amrex::Real SolverChoice::pi_drift_factor = myhalf

Referenced by init_params().

◆ poisson_abstol

SolverChoice::poisson_abstol = amrex::Real(1e-8)

Absolute tolerance for the Poisson solve.

Referenced by init_params().

◆ poisson_reltol

SolverChoice::poisson_reltol = amrex::Real(1e-8)

Relative tolerance for the Poisson solve.

Referenced by init_params().

◆ project_initial_velocity

SolverChoice::project_initial_velocity

Per-level flag for projecting the initial velocity.

Referenced by init_params().

◆ rad_type

◆ radChoice

RadChoice SolverChoice::radChoice

Referenced by init_params().

◆ rdOcp

◆ rebalance_wrf_input

SolverChoice::rebalance_wrf_input = true

Whether to rebalance states from wrfinput and wrfbdy data.

Referenced by init_params().

◆ rrtmgpSolarChoice

RRTMGPSolarChoice SolverChoice::rrtmgpSolarChoice

◆ sampling_distance_by_D

SolverChoice::sampling_distance_by_D = -one

Turbine inflow sampling distance normalized by rotor diameter.

Referenced by check_params(), and init_params().

◆ sbm_amr_qualification_expect_empty_fine_rank

bool SolverChoice::sbm_amr_qualification_expect_empty_fine_rank {false}

◆ sbm_amr_qualification_expect_split

bool SolverChoice::sbm_amr_qualification_expect_split {false}

◆ sbm_amr_qualification_expect_zero_flow

bool SolverChoice::sbm_amr_qualification_expect_zero_flow {false}

◆ sbm_amr_qualification_parent_store_fault

bool SolverChoice::sbm_amr_qualification_parent_store_fault {false}

◆ sbm_amr_qualification_regrid

bool SolverChoice::sbm_amr_qualification_regrid {false}

◆ sbm_amr_qualification_regrid_reject_fault

bool SolverChoice::sbm_amr_qualification_regrid_reject_fault {false}

◆ sbm_amr_qualification_test

bool SolverChoice::sbm_amr_qualification_test {false}

◆ sbm_amr_qualification_uniform_ratio

bool SolverChoice::sbm_amr_qualification_uniform_ratio {false}

◆ sbm_amr_qualification_unique_profile

bool SolverChoice::sbm_amr_qualification_unique_profile {false}

◆ sbm_budget_check

bool SolverChoice::sbm_budget_check {false}

Referenced by init_params().

◆ sbm_cloud_rain_split

int SolverChoice::sbm_cloud_rain_split {-1}

Referenced by init_params().

◆ sbm_edges

amrex::Vector<amrex::Real> SolverChoice::sbm_edges

Referenced by init_params().

◆ sbm_fixture_initial_state

amrex::Vector<amrex::Real> SolverChoice::sbm_fixture_initial_state

Referenced by ERF::ERF_shared(), and init_params().

◆ sbm_fixture_initial_state_xhi

amrex::Vector<amrex::Real> SolverChoice::sbm_fixture_initial_state_xhi

Referenced by ERF::ERF_shared(), and init_params().

◆ sbm_moment_mode

int SolverChoice::sbm_moment_mode {1}

◆ sbm_nbins

int SolverChoice::sbm_nbins {4}

Referenced by init_params().

◆ sbm_particle_mixing

std::string SolverChoice::sbm_particle_mixing {"None"}

Referenced by init_params().

◆ sbm_particle_mixing_kh

amrex::Real SolverChoice::sbm_particle_mixing_kh {0}

Referenced by init_params().

◆ sbm_particle_mixing_kv

amrex::Real SolverChoice::sbm_particle_mixing_kv {0}

Referenced by init_params().

◆ sbm_particle_mixing_terrain_qualification

bool SolverChoice::sbm_particle_mixing_terrain_qualification {false}

Referenced by ERF::ERF_shared(), and init_params().

◆ sbm_pivots

amrex::Vector<amrex::Real> SolverChoice::sbm_pivots

Referenced by init_params().

◆ sbm_test_donor_cfl_fault

bool SolverChoice::sbm_test_donor_cfl_fault {false}

Referenced by erf_slow_rhs_post(), and init_params().

◆ sbm_test_native_qc_write_fault

bool SolverChoice::sbm_test_native_qc_write_fault {false}

Referenced by erf_slow_rhs_post(), and init_params().

◆ shoc_momentum_transport

◆ shoc_transport_mode

ShocTransportMode SolverChoice::shoc_transport_mode = ShocTransportMode::StateUpdate

◆ sinphi

SolverChoice::sinphi = zero

Sine of the latitude used for Coriolis forcing.

Referenced by build_coriolis_forcings_const_lat(), init_params(), and make_mom_sources().

◆ sounding_type

SolverChoice::sounding_type = SoundingType::Ideal
inlinestatic

Interpretation used for input sounding profiles.

Referenced by init_params().

◆ spatial_moisture_forcing

SolverChoice::spatial_moisture_forcing = false

Whether spatially varying moisture forcing is enabled.

Referenced by init_params(), and make_sources().

◆ spatial_rhotheta_forcing

SolverChoice::spatial_rhotheta_forcing = false

Whether spatially varying rho-theta forcing is enabled.

Referenced by init_params(), and make_sources().

◆ spongeChoice

SolverChoice::spongeChoice

Sponge-layer options.

Referenced by display(), init_params(), make_mom_sources(), and make_sources().

◆ substepping_diag

SolverChoice::substepping_diag = false

Whether to emit extra CFL diagnostics for compressible substepping.

Referenced by init_params().

◆ terrain_poisson_solver

SolverChoice::terrain_poisson_solver = TerrainPoissonSolver::gmres_fft

Projection solver on a terrain-fitted mesh: gmres_fft (default), mlmg or gmres_mlmg.

Referenced by init_params().

◆ terrain_type

◆ test_mapfactor

SolverChoice::test_mapfactor = false

Whether to use test map scale factors.

Referenced by init_params().

◆ test_mapfactor_amp

SolverChoice::test_mapfactor_amp = amrex::Real(0)

Amplitude of the spatially varying test map scale factors on level 0 (0: not used).

Referenced by init_params().

◆ time_avg_vel

SolverChoice::time_avg_vel = false

Whether time-averaged velocity fields are output.

Referenced by init_params().

◆ timestepping_type

SolverChoice::timestepping_type

Per-level time integrator (RK3_ImplicitSubstep, RK3_NoSubstepping, RK2 or MidPoint).

Referenced by display(), erf_slow_rhs_post(), erf_slow_rhs_pre(), init_params(), level_substeps(), StageFluxWeight(), and erf_sbm::qualification::validate_configuration().

◆ topographicChoice

TopographicShadingChoice SolverChoice::topographicChoice

◆ transport_scalar

SolverChoice::transport_scalar = true

Whether the passive scalar component is transported.

Referenced by erf_slow_rhs_post(), and init_params().

◆ turb_disk_angle

SolverChoice::turb_disk_angle = -one

Turbine disk angle from the x axis [deg].

Referenced by check_params(), and init_params().

◆ turbChoice

◆ urban_enabled_lev

amrex::Vector<int> SolverChoice::urban_enabled_lev

Referenced by init_params().

◆ urban_type

UrbanType SolverChoice::urban_type

Referenced by init_params().

◆ use_coriolis

SolverChoice::use_coriolis = false

Whether Coriolis forcing is enabled.

Referenced by display(), init_params(), and make_mom_sources().

◆ use_coupled_currents

bool SolverChoice::use_coupled_currents = false

Referenced by init_params().

◆ use_coupled_sst

bool SolverChoice::use_coupled_sst = false

Referenced by init_params().

◆ use_gravity

SolverChoice::use_gravity = false

Whether gravitational forcing is enabled.

Referenced by display(), and init_params().

◆ use_lagged_delta_rt

SolverChoice::use_lagged_delta_rt = true

Whether to use lagged delta terms for moving terrain.

Referenced by check_params(), and init_params().

◆ use_native_shoc

SolverChoice::use_native_shoc = false

Whether any level uses the native SHOC PBL scheme.

Referenced by host_owns_vertical_momentum_diffusion(), host_owns_vertical_scalar_diffusion(), init_params(), and uses_shoc_family().

◆ use_num_diff

SolverChoice::use_num_diff {false}

Whether sixth-order numerical diffusion is enabled.

Referenced by ERF::ComputeGhostCells(), init_params(), and make_sources().

◆ use_pert_pres_gradient

SolverChoice::use_pert_pres_gradient = true

Whether momentum equations use perturbational pressure gradients.

Referenced by init_params(), and make_gradp_pert().

◆ use_real_bcs

SolverChoice::use_real_bcs = false
inlinestatic

Whether real-data lateral boundary conditions are used.

Referenced by init_params().

◆ use_rotate_surface_flux

SolverChoice::use_rotate_surface_flux = false

Whether MOST surface fluxes are rotated with terrain.

Referenced by erf_slow_rhs_post(), erf_slow_rhs_pre(), and init_params().

◆ use_variable_beta_s

SolverChoice::use_variable_beta_s = false

Whether beta_s varies on the w-faces with the terrain slope and acoustic Courant number.

Referenced by init_params().

◆ use_wrf_bdy_density

bool SolverChoice::use_wrf_bdy_density = true

Referenced by init_params().

◆ variable_coriolis

SolverChoice::variable_coriolis {false}

Whether spatially varying Coriolis forcing is enabled.

Referenced by init_params(), and make_mom_sources().

◆ vert_implicit_fac

SolverChoice::vert_implicit_fac

Per-level, per-stage implicit vertical diffusion factors.

Referenced by check_params(), display(), erf_make_tau_terms(), erf_slow_rhs_post(), erf_slow_rhs_pre(), and init_params().

◆ wall_dist_type

std::string SolverChoice::wall_dist_type = "poisson"

Referenced by init_params().

◆ windfarm_airfoil_tables

SolverChoice::windfarm_airfoil_tables

Wind-farm airfoil table paths.

Referenced by init_params().

◆ windfarm_blade_table

SolverChoice::windfarm_blade_table

Wind-farm blade table path.

Referenced by init_params().

◆ windfarm_loc_table

SolverChoice::windfarm_loc_table

Wind-farm location table path.

Referenced by init_params().

◆ windfarm_loc_type

SolverChoice::windfarm_loc_type

Coordinate system for wind-farm turbine locations.

Referenced by check_params(), and init_params().

◆ windfarm_spec_table

SolverChoice::windfarm_spec_table

Wind-farm turbine specification table path.

Referenced by init_params().

◆ windfarm_spec_table_extra

SolverChoice::windfarm_spec_table_extra

Additional wind-farm turbine specification table path.

Referenced by init_params().

◆ windfarm_type

SolverChoice::windfarm_type

Wind-farm model.

Referenced by check_params(), ERF::ERF_shared(), and init_params().

◆ windfarm_x_shift

SolverChoice::windfarm_x_shift = -one

Wind-farm x-coordinate shift.

Referenced by check_params(), and init_params().

◆ windfarm_y_shift

SolverChoice::windfarm_y_shift = -one

Wind-farm y-coordinate shift.

Referenced by check_params(), and init_params().

◆ wrfinput_zlevels_from_file

bool SolverChoice::wrfinput_zlevels_from_file {true}

Referenced by init_params().

◆ zcc_vertical_metric_lev

amrex::Vector<int> SolverChoice::zcc_vertical_metric_lev

Referenced by zcc_vertical_metric().


The documentation for this struct was generated from the following file: