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...
 
void 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 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...
 

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< TurbChoiceturbChoice
 Turbulence options for each AMR level. More...
 
EBChoice ebChoice
 Embedded-boundary options. More...
 
int force_stage1_single_substep = 1
 Flag forcing a single substep in the first RK stage. More...
 
amrex::Vector< SubsteppingType > substepping_type
 Acoustic substepping type for each AMR level. More...
 
amrex::Vector< int > anelastic
 Per-level flag selecting anelastic dynamics. More...
 
amrex::Vector< int > fixed_density
 Per-level flag selecting fixed-density treatment. 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...
 
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...
 
int ncorr = 1
 Number of projection correction iterations. 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...
 
bool test_mapfactor = false
 Whether to use test map scale factors. More...
 
int gradp_type = 0
 Terrain-fitted horizontal pressure-gradient formulation. 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
 
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...
 
bool if_use_most = false
 Whether immersed-forcing MOST is enabled. More...
 
bool if_stability_correction = false
 Whether immersed-forcing stability corrections are enabled. More...
 
amrex::Real if_ws_floor = 0.001
 Wind-speed floor for immersed-forcing MOST [m/s]. More...
 
amrex::Real if_damp_alpha = 0.5
 Immersed-forcing damping coefficient. 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 zsurf = zero
 Nominal surface height for stretched-grid setup. More...
 
amrex::Real dz0
 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...
 
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_eamxx_shoc = false
 Whether any level uses the EAMxx SHOC PBL scheme. 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::HostDiffusion
 
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< PerturbationType > pert_type
 Turbulent perturbation type for each AMR level. 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...
 
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...
 
RadiationType rad_type
 Radiation model. More...
 
bool use_coupled_sst = 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
 
bool use_wrf_bdy_qc_qi = false
 Whether WRF cloud water and active cloud ice are ingested at real boundaries. More...
 
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 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}
 
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 BuildingsType buildings_type = BuildingsType::None
 Building representation. 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, or CPM perturbations.
2105  {
2106  for (const auto& type : pert_type) {
2107  if (type == PerturbationType::Source ||
2108  type == PerturbationType::Direct ||
2109  type == PerturbationType::CPM) {
2110  return true;
2111  }
2112  }
2113  return false;
2114  }
amrex::Vector< PerturbationType > pert_type
Turbulent perturbation type for each AMR level.
Definition: ERF_DataStruct.H:2117

◆ 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.
1761  {
1762  amrex::ParmParse pp(pp_prefix);
1763 
1764  // Read the rotational time period (in seconds)
1765  double rot_time_period = 86400.0;
1766  pp.queryAdd("rotational_time_period", rot_time_period);
1767 
1768  coriolis_factor = static_cast<amrex::Real>(4.0 * PI / rot_time_period);
1769 
1770  pp.queryAdd("coriolis_3d", coriolis_3d);
1771 
1772  // Convert to radians
1773  amrex::Real latitude_for_coriolis = amrex::Real(90.0);
1774  pp.queryAdd("latitude", latitude_for_coriolis);
1775  latitude_for_coriolis *= (PI/amrex::Real(180.));
1776  sinphi = std::sin(latitude_for_coriolis);
1777 
1778  // Note: cosphi defaults to 0
1779  if (coriolis_3d) {
1780  cosphi = std::cos(latitude_for_coriolis);
1781  }
1782 
1783  amrex::Print() << "Coriolis frequency, f = " << coriolis_factor * sinphi << " 1/s" << std::endl;
1784 
1785  if (abl_driver_type == ABLDriverType::GeostrophicWind) {
1786  // Read in the geostrophic wind -- we only use this to construct
1787  // the forcing term so no need to keep it
1788  amrex::Vector<amrex::Real> abl_geo_wind(3);
1789  pp.queryarr("abl_geo_wind",abl_geo_wind);
1790 
1791  if(!pp.queryAdd("abl_geo_wind_table",abl_geo_wind_table)) {
1792  abl_geo_forcing = {
1793  -coriolis_factor * (abl_geo_wind[1]*sinphi - abl_geo_wind[2]*cosphi),
1794  coriolis_factor * abl_geo_wind[0]*sinphi,
1795  -coriolis_factor * abl_geo_wind[0]*cosphi
1796  };
1797  } else {
1798  amrex::Print() << "NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
1799  }
1800  }
1801  }
constexpr amrex::Real PI
Definition: ERF_Constants.H:42
ParmParse pp("prob")
amrex::Real Real
Definition: ERF_ShocInterface.H:19
amrex::Real coriolis_factor
Twice the planetary rotation rate used for Coriolis forcing.
Definition: ERF_DataStruct.H:1956
std::string abl_geo_wind_table
Path to a time-varying geostrophic wind table.
Definition: ERF_DataStruct.H:2136
amrex::Real cosphi
Cosine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:1957
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Applied geostrophic-wind forcing vector.
Definition: ERF_DataStruct.H:2135
ABLDriverType abl_driver_type
Atmospheric boundary-layer driver type.
Definition: ERF_DataStruct.H:2133
amrex::Real sinphi
Sine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:1958
bool coriolis_3d
Whether the three-dimensional Coriolis terms are included.
Definition: ERF_DataStruct.H:1914

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.
1497  {
1498 #if 0
1499  // Warn for PBL models and moisture - these may not yet be compatible
1500  for (int lev = 0; lev <= max_level; lev++) {
1501  if ((moisture_type != MoistureType::None) && (turbChoice[lev].pbl_type != PBLType::None)) {
1502  amrex::Warning("\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
1503  }
1504  }
1505 #endif
1506  //
1507  // Buoyancy type check
1508  //
1509  for (int lev = 0; lev <= max_level; lev++) {
1510  if (buoyancy_type[lev] != 1 && buoyancy_type[lev] != 2 && buoyancy_type[lev] != 3 && buoyancy_type[lev] != 4) {
1511  amrex::Error("buoyancy_type must be 1, 2, 3 or 4");
1512  }
1513  }
1514 
1515  if (!use_lagged_delta_rt && !(terrain_type == TerrainType::MovingFittedMesh)) {
1516  amrex::Error("Can't turn off lagged_delta_rt when terrain not moving");
1517  }
1518 
1519  //
1520  // Wind farm checks
1521  //
1522  if (windfarm_type==WindFarmType::SimpleAD and sampling_distance_by_D < zero) {
1523  amrex::Error("To use simplified actuator disks, you need to provide a variable"
1524  " erf.sampling_distance_by_D in the inputs which specifies the upstream"
1525  " distance as a factor of the turbine diameter at which the incoming free stream"
1526  " velocity will be computed at.");
1527  }
1528  if ( (windfarm_type==WindFarmType::SimpleAD ||
1529  windfarm_type==WindFarmType::GeneralAD ) && turb_disk_angle < zero) {
1530  amrex::Error("To use simplified actuator disks, you need to provide a variable"
1531  " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
1532  " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
1533  " will have turb_disk_angle value of 90 deg.");
1534  }
1535  if (windfarm_loc_type == WindFarmLocType::lat_lon and (windfarm_x_shift < zero or windfarm_y_shift < zero)) {
1536  amrex::Error("You are using windfarms with latitude-logitude option to position the turbines."
1537  " For this you should provide the inputs erf.windfarm_x_shift and"
1538  " erf.windfarm_y_shift which are the values by which the bounding box of the"
1539  " windfarm is shifted from the x and the y axes.");
1540  }
1541 
1542 
1543  if ( (const_massflux_u != 0) && !(geom_vect[0].isPeriodic(0)) ) {
1544  amrex::Error("Constant mass flux (in x) should be used with periodic boundaries");
1545  }
1546 
1547  if ( (const_massflux_v != 0) && !(geom_vect[0].isPeriodic(1)) ) {
1548  amrex::Error("Constant mass flux (in y) should be used with periodic boundaries");
1549  }
1550 
1551  // Mesoscale diffusion -- test if LES appropriate with this dx,dy
1552  for (int lev = 0; lev <= max_level; lev++) {
1553  if ((geom_vect[lev].CellSize(0) > amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) > amrex::Real(2000.)))
1554  {
1555  if ( (turbChoice[lev].les_type == LESType::Smagorinsky) && !turbChoice[lev].smag2d ) {
1556  amrex::Warning("Should use 2-D Smagorinsky for mesoscale resolution");
1557  } else if (turbChoice[lev].les_type == LESType::Deardorff) {
1558  amrex::Warning("Should not use Deardorff LES for mesoscale resolution");
1559  }
1560  }
1561  }
1562 
1563  // Turn off implicit solve if we have no diffusion
1564  bool l_use_kturb = turbChoice[0].use_kturb;
1565  for (int lev = 1; lev <= max_level; lev++) {
1566  l_use_kturb = (l_use_kturb || turbChoice[lev].use_kturb);
1567  }
1568  bool l_use_diff = ( (diffChoice.molec_diff_type != MolecDiffType::None) || l_use_kturb );
1569 
1570  for (int lev = 0; lev <= max_level; lev++) {
1571  bool l_implicit_diff = (vert_implicit_fac[lev][0] > zero ||
1572  vert_implicit_fac[lev][1] > zero ||
1573  vert_implicit_fac[lev][2] > zero);
1574  if (l_implicit_diff && !l_use_diff) {
1575  amrex:: Print() << "No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
1576  vert_implicit_fac[lev][0] = zero;
1577  vert_implicit_fac[lev][1] = zero;
1578  vert_implicit_fac[lev][2] = zero;
1579  }
1580  }
1581 
1582  // Countergradient validation: ensure required implicit diffusion is enabled
1583  for (int lev = 0; lev <= max_level; lev++) {
1584  if (turbChoice[lev].enable_mrf_countergradient) {
1586  vert_implicit_fac[lev][0] > zero ||
1587  vert_implicit_fac[lev][1] > zero ||
1588  vert_implicit_fac[lev][2] > zero,
1589  "enable_mrf_countergradient requires vert_implicit_fac > 0");
1592  "enable_mrf_countergradient requires implicit_thermal_diffusion = true");
1593  if (moisture_type != MoistureType::None) {
1596  "enable_mrf_countergradient with moisture requires implicit_moisture_diffusion = true");
1597  }
1598  }
1599  }
1600 
1601  for (int lev = 0; lev <= max_level; lev++) {
1602  turbChoice[lev].check_params(phys_bc_type);
1603  }
1604  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
MolecDiffType molec_diff_type
Selected molecular transport model.
Definition: ERF_DiffStruct.H:94
WindFarmLocType windfarm_loc_type
Coordinate system for wind-farm turbine locations.
Definition: ERF_DataStruct.H:2126
amrex::Real const_massflux_v
Target constant mass flux in the y direction.
Definition: ERF_DataStruct.H:2183
amrex::Vector< TurbChoice > turbChoice
Turbulence options for each AMR level.
Definition: ERF_DataStruct.H:1864
bool implicit_moisture_diffusion
Whether implicit vertical moisture diffusion is included.
Definition: ERF_DataStruct.H:1891
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:2124
amrex::Vector< int > buoyancy_type
Per-level buoyancy formulation selector.
Definition: ERF_DataStruct.H:1873
amrex::Real const_massflux_u
Target constant mass flux in the x direction.
Definition: ERF_DataStruct.H:2182
amrex::Real sampling_distance_by_D
Turbine inflow sampling distance normalized by rotor diameter.
Definition: ERF_DataStruct.H:2150
amrex::Real windfarm_y_shift
Wind-farm y-coordinate shift.
Definition: ERF_DataStruct.H:2153
bool implicit_thermal_diffusion
Whether implicit vertical thermal diffusion is included.
Definition: ERF_DataStruct.H:1890
amrex::Real turb_disk_angle
Turbine disk angle from the x axis [deg].
Definition: ERF_DataStruct.H:2151
amrex::Real windfarm_x_shift
Wind-farm x-coordinate shift.
Definition: ERF_DataStruct.H:2152
bool use_lagged_delta_rt
Whether to use lagged delta terms for moving terrain.
Definition: ERF_DataStruct.H:1940
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Per-level, per-stage implicit vertical diffusion factors.
Definition: ERF_DataStruct.H:1887
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:1839
DiffChoice diffChoice
Diffusion-related options.
Definition: ERF_DataStruct.H:1861
WindFarmType windfarm_type
Wind-farm model.
Definition: ERF_DataStruct.H:2125
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.
1612  {
1613  amrex::Print() << "SOLVER CHOICE: " << std::endl;
1614  for (int lev = 0; lev <= max_level; lev++) {
1615  amrex::Print() << "At level " << lev << " : " << std::endl;
1616  if (anelastic[lev]) {
1617  amrex::Print() << " anelastic with no substepping" << std::endl;
1618  } else {
1619  if (substepping_type[lev] == SubsteppingType::None) {
1620  amrex::Print() << " compressible with no substepping" << std::endl;
1621  } else if (substepping_type[lev] == SubsteppingType::Implicit) {
1622  amrex::Print() << " compressible with implicit substepping" << std::endl;
1623  }
1624  }
1625  if (fixed_density[lev]) {
1626  amrex::Print() << " and fixed density" << std::endl;
1627  }
1628  }
1629 
1630  for (int lev = 0; lev <= max_level; lev++) {
1631  amrex::Print() << "vert_implicit_fac at level " << lev << " : "
1632  << vert_implicit_fac[lev][0] << " "
1633  << vert_implicit_fac[lev][1] << " "
1634  << vert_implicit_fac[lev][2];
1635  if (vert_implicit_fac[lev][0] > zero ||
1636  vert_implicit_fac[lev][1] > zero ||
1637  vert_implicit_fac[lev][2] > zero)
1638  {
1639  amrex::Print() << " (theta = " << implicit_thermal_diffusion
1640  << ", moisture = " << implicit_moisture_diffusion
1641  << ", tke = " << implicit_ke_diffusion
1642  << ", momenta = " << implicit_momentum_diffusion;
1643 #ifdef ERF_IMPLICIT_W
1644  amrex::Print() << ", including w";
1645 #endif
1646  amrex::Print() << ")";
1647  }
1648  }
1649  amrex::Print() << std::endl;
1650  amrex::Print() << "use_coriolis : " << use_coriolis << std::endl;
1651  amrex::Print() << "use_gravity : " << use_gravity << std::endl;
1652 
1653  if (moisture_type == MoistureType::SAM) {
1654  amrex::Print() << "Moisture Model: SAM" << std::endl;
1655  } else if (moisture_type == MoistureType::SAM_NoIce) {
1656  amrex::Print() << "Moisture Model: SAM No Ice" << std::endl;
1657  } else if (moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
1658  amrex::Print() << "Moisture Model: SAM No Precip No Ice" << std::endl;
1659  } else if (moisture_type == MoistureType::Morrison) {
1660  amrex::Print() << "Moisture Model: Morrison" << std::endl;
1661  } else if (moisture_type == MoistureType::Morrison_NoIce) {
1662  amrex::Print() << "Moisture Model: Morrison_NoIce" << std::endl;
1663  } else if (moisture_type == MoistureType::WSM6) {
1664  amrex::Print() << "Moisture Model: WSM6" << std::endl;
1665  } else if (moisture_type == MoistureType::WDM6) {
1666  amrex::Print() << "Moisture Model: WDM6" << std::endl;
1667  } else if (moisture_type == MoistureType::Kessler) {
1668  amrex::Print() << "Moisture Model: Kessler" << std::endl;
1669  } else if (moisture_type == MoistureType::Kessler_NoRain) {
1670  amrex::Print() << "Moisture Model: Kessler No Rain" << std::endl;
1671  } else if (moisture_type == MoistureType::SatAdj) {
1672  amrex::Print() << "Moisture Model: Saturation Adjustment" << std::endl;
1673  } else if (moisture_type == MoistureType::SuperDroplets) {
1674  amrex::Print() << "Moisture Model: SuperDroplets" << std::endl;
1675  } else if (moisture_type == MoistureType::MoistNoCondensation) {
1676  amrex::Print() << "Moisture Model: MoistNoCondensation" << std::endl;
1677  } else {
1678  amrex::Print() << "Moisture Model: None" << std::endl;
1679  }
1680 
1681  if (terrain_type == TerrainType::StaticFittedMesh) {
1682  amrex::Print() << "Terrain Type: StaticFittedMesh" << std::endl;
1683  } else if (terrain_type == TerrainType::MovingFittedMesh) {
1684  amrex::Print() << "Terrain Type: MovingFittedMesh" << std::endl;
1685  } else if (terrain_type == TerrainType::EB) {
1686  amrex::Print() << "Terrain Type: EB" << std::endl;
1687  ebChoice.display();
1688  } else if (terrain_type == TerrainType::ImmersedForcing) {
1689  amrex::Print() << "Terrain Type: ImmersedForcing" << std::endl;
1690  } else {
1691  amrex::Print() << "Terrain Type: None" << std::endl;
1692  }
1693 
1694  if (buildings_type == BuildingsType::ImmersedForcing) {
1695  amrex::Print() << "Buildings Type: ImmersedForcing" << std::endl;
1696  } else {
1697  amrex::Print() << "Buildings Type: None" << std::endl;
1698  }
1699 
1700  if (mesh_type == MeshType::ConstantDz) {
1701  amrex::Print() << " Mesh Type: ConstantDz" << std::endl;
1702  } else if (mesh_type == MeshType::StretchedDz) {
1703  amrex::Print() << " Mesh Type: StretchedDz" << std::endl;
1704  } else if (mesh_type == MeshType::VariableDz) {
1705  amrex::Print() << " Mesh Type: VariableDz" << std::endl;
1706  } else {
1707  amrex::Error("No mesh_type set!");
1708  }
1709 
1710  amrex::Print() << "ABL Driver Type: " << std::endl;
1711  if (abl_driver_type == ABLDriverType::None) {
1712  amrex::Print() << " None" << std::endl;
1713  } else if (abl_driver_type == ABLDriverType::PressureGradient) {
1714  amrex::Print() << " Pressure Gradient "
1715  << amrex::RealVect(abl_pressure_grad[0],abl_pressure_grad[1],abl_pressure_grad[2])
1716  << std::endl;
1717  } else if (abl_driver_type == ABLDriverType::GeostrophicWind) {
1718  amrex::Print() << " Geostrophic Wind "
1719  << amrex::RealVect(abl_geo_forcing[0],abl_geo_forcing[1],abl_geo_forcing[2])
1720  << std::endl;
1721  }
1722 
1723  if (max_level > 0) {
1724  amrex::Print() << "Coupling Type: " << std::endl;
1725  if (coupling_type == CouplingType::TwoWay) {
1726  amrex::Print() << " Two-way" << std::endl;
1727  } else if (coupling_type == CouplingType::OneWay) {
1728  amrex::Print() << " One-way" << std::endl;
1729  }
1730  }
1731 
1732  if (rad_type == RadiationType::RRTMGP) {
1733  amrex::Print() << "Radiation Model: RRTMGP" << std::endl;
1734  } else if (rad_type == RadiationType::Simple) {
1735  amrex::Print() << "Radiation Model: Simple" << std::endl;
1736  } else {
1737  amrex::Print() << "Radiation Model: None" << std::endl;
1738  }
1739 
1740  amrex::Print() << "Gradp_type : " << gradp_type << std::endl;
1741 
1742  for (int lev = 0; lev <= max_level; lev++) {
1743  amrex::Print() << "Buoyancy_type at level " << lev << " : " << buoyancy_type[lev] << std::endl;
1744  }
1745 
1746  advChoice.display(pp_prefix);
1747  diffChoice.display();
1750 
1751  for (int lev = 0; lev <= max_level; lev++) {
1752  turbChoice[lev].display(lev);
1753  }
1754  }
void display(std::string &pp_prefix)
Print the configured advection choices.
Definition: ERF_AdvStruct.H:243
void display()
Print the configured damping options.
Definition: ERF_DampingStruct.H:71
void display()
Print the configured diffusion options.
Definition: ERF_DiffStruct.H:77
void display()
Print the configured embedded-boundary options.
Definition: ERF_EBStruct.H:63
amrex::Vector< int > fixed_density
Per-level flag selecting fixed-density treatment.
Definition: ERF_DataStruct.H:1871
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:2123
EBChoice ebChoice
Embedded-boundary options.
Definition: ERF_DataStruct.H:1865
bool implicit_ke_diffusion
Whether implicit vertical TKE diffusion is included.
Definition: ERF_DataStruct.H:1892
bool use_gravity
Whether gravitational forcing is enabled.
Definition: ERF_DataStruct.H:1912
amrex::Vector< SubsteppingType > substepping_type
Acoustic substepping type for each AMR level.
Definition: ERF_DataStruct.H:1869
bool use_coriolis
Whether Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:1913
static MeshType mesh_type
Vertical mesh representation.
Definition: ERF_DataStruct.H:1848
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:1860
SpongeChoice spongeChoice
Sponge-layer options.
Definition: ERF_DataStruct.H:1863
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Applied ABL pressure-gradient forcing vector.
Definition: ERF_DataStruct.H:2134
amrex::Vector< int > anelastic
Per-level flag selecting anelastic dynamics.
Definition: ERF_DataStruct.H:1870
int gradp_type
Terrain-fitted horizontal pressure-gradient formulation.
Definition: ERF_DataStruct.H:1907
DampingChoice dampingChoice
Damping-related options.
Definition: ERF_DataStruct.H:1862
static BuildingsType buildings_type
Building representation.
Definition: ERF_DataStruct.H:1842
RadiationType rad_type
Radiation model.
Definition: ERF_DataStruct.H:2128
bool implicit_momentum_diffusion
Whether implicit vertical momentum diffusion is included.
Definition: ERF_DataStruct.H:1893
void display()
Print the configured sponge-layer options.
Definition: ERF_SpongeStruct.H:85
Here is the call 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.
2073  {
2074  if (use_eamxx_shoc) { return false; }
2075  if (!use_native_shoc) { return true; }
2078  }
bool shoc_disables_momentum_transport(ShocMomentumTransport mode)
Definition: ERF_ShocTransportStruct.H:69
bool shoc_uses_momentum_host_diffusion(ShocMomentumTransport mode)
Definition: ERF_ShocTransportStruct.H:63
bool use_native_shoc
Whether any level uses the native SHOC PBL scheme.
Definition: ERF_DataStruct.H:1995
ShocMomentumTransport shoc_momentum_transport
Definition: ERF_DataStruct.H:1999
bool use_eamxx_shoc
Whether any level uses the EAMxx SHOC PBL scheme.
Definition: ERF_DataStruct.H:1994

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.
2085  {
2086  if (use_eamxx_shoc) { return false; }
2087  if (!use_native_shoc) { return true; }
2089  }
bool shoc_uses_host_diffusion(ShocTransportMode mode)
Definition: ERF_ShocTransportStruct.H:51
ShocTransportMode shoc_transport_mode
Definition: ERF_DataStruct.H:1998

Referenced by init_params().

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.
642  {
643  amrex::ParmParse pp(pp_prefix);
644 
645  bool bogus_bool;
646  if (pp.query("use_terrain",bogus_bool) > 0) {
647  amrex::Error("The input use_terrain is deprecated. Set terrain_type instead.");
648  }
649 
650  if (pp.query("use_moist_background",bogus_bool) > 0) {
651  amrex::Error("The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
652  }
653 
654  // Do we set map scale factors to myhalf instead of 1 for testing?
655  pp.queryAdd("test_mapfactor", test_mapfactor);
656 
657  // Which horizontal pressure gradient formulation to use with terrain fitted coords?
658  // 0: dp/dx with dp/dz correction (default)
659  // 1: gradient of vertically interpolated p, see Klemp 2011
660  pp.queryAdd("gradp_type", gradp_type);
662 
663  // For the lateral pressure gradient to be used in the momentum equation, should we
664  // take the x- and y-derivatives of the perturbational pressure or the full pressure?
665  pp.queryAdd("use_pert_pres_gradient", use_pert_pres_gradient);
666 
667  // What type of moisture model to use?
668  moisture_type = MoistureType::None; // Default
669  if (pp.query("moisture_type",moisture_type) > 0) {
670  amrex::Error("The input moisture_type is deprecated. Set moisture_model instead.");
671  }
672 
673  pp.query_enum_case_insensitive("moisture_model",moisture_type);
674 
675  // Register the moisture data this scheme carries: conserved-state
676  // components and qmoist diagnostic slots alike. MoistureComponentIndices
677  // is the one place that mapping lives, and every consumer -- source terms,
678  // turbulence closures, and the plotfile/subvolume writers -- queries it
679  // instead of testing moisture_type.
681 
682  // Set a default for both dry and moist
683  buoyancy_type.resize(max_level+1);
684  for (int i = 0; i <= max_level; ++i) {
685  buoyancy_type[i] = 1; // uses Rhoprime
686  }
687 
688  if (moisture_type != MoistureType::None) {
689  pp.queryAdd("moisture_tight_coupling",moisture_tight_coupling);
690  }
691 
692  // Which expression (1,2/3 or 4) to use for buoyancy
693  int default_buoyancy_type = buoyancy_type[0];
694  read_int_string(max_level, "buoyancy_type", buoyancy_type, default_buoyancy_type);
695 
696  // What type of land surface model to use
697  lsm_type = LandSurfaceType::None; // Default
698  pp.query_enum_case_insensitive("land_surface_model",lsm_type);
699 
700  // Will an external ocean coupler supply SST for part or all of the water
701  // cells this run? The surface layer needs to know this it in time to select
702  // ThetaCalcType::SURFACE_TEMPERATURE, which is long before the first
703  // ApplyOceanSurfaceState call.
704  pp.queryAdd("use_coupled_sst", use_coupled_sst);
705 
706  read_int_string(max_level, "is_land", is_land, 1);
707  for (int lev = 0; lev <= max_level; ++lev) {
708  if (is_land[lev] == 1) {
709  amrex::Print() << "Level " << lev << " is land" << std::endl;
710  } else if (is_land[lev] == 0) {
711  amrex::Print() << "Level " << lev << " is water" << std::endl;
712  } else {
713  amrex::Error("is_land should be 0 or 1");
714  }
715  }
716 
717  // What type of radiation model to use
718  rad_type = RadiationType::None; // Default
719  pp.query_enum_case_insensitive("radiation_model", rad_type);
720 
721  // Verify that radiation model cannot be RRTMGP if ERF was not compiled with RRTMGP
722 #ifndef ERF_USE_RRTMGP
723  if (rad_type == RadiationType::RRTMGP)
724  {
725  amrex::Error("ERF was not compiled with RRTMGP enabled!");
726  }
727 #endif
728 
729  // Is the terrain none, static or moving?
730  std::string terrain_type_temp = "";
731  pp.queryAdd("terrain_type", terrain_type_temp);
732  if (terrain_type_temp == "Moving") {
733  amrex::Warning("erf.terrain_type = Moving is deprecated; please replace Moving by MovingFittedMesh");
734  terrain_type = TerrainType::MovingFittedMesh;
735  } else if (terrain_type_temp == "Static") {
736  amrex::Warning("erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
737  terrain_type = TerrainType::StaticFittedMesh;
738  } else {
739  pp.query_enum_case_insensitive("terrain_type",terrain_type);
740  }
741 
742  // Get buildings type
743  std::string buildings_type_temp = "";
744  pp.queryAdd("buildings_type", buildings_type_temp);
745  if (buildings_type_temp == "ImmersedForcing") {
746  buildings_type = BuildingsType::ImmersedForcing;
747  }
748 
749  //
750  // Read the init_type here to make sure we correctly set the mesh and terrain types
751  //
752  std::string init_type_temp_string;
753 
754  int found = pp.queryAdd("init_type",init_type_temp_string);
755 
756  if ( (init_type_temp_string == "Real") || (init_type_temp_string == "real") ) {
757  amrex::Error("erf.init_type = Real is deprecated; please replace Real by WRFInput");
758  } else if ( (init_type_temp_string == "Ideal") || (init_type_temp_string == "ideal") ) {
759  amrex::Error("erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
760  } else {
761  pp.query_enum_case_insensitive("init_type",init_type);
762  use_real_bcs = ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) );
763  }
764 
765  if ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) {
766  if (terrain_type != TerrainType::StaticFittedMesh) {
767  amrex::Error("Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
768  }
769  }
770 
771  if (init_type == InitType::MoistBaseState) {
772  if (moisture_type == MoistureType::None) {
773  amrex::Error("Makes no sense to have moist base state with no moisture model");
774  }
775  }
776 
777  if (init_type == InitType::WRFInput) {
778  if (moisture_type == MoistureType::None) {
779  amrex::Error("Can't have moisture_type = None with init_type = WRFInput");
780  }
781 
782  // NetCDF wrfbdy lateral boundary file
783  std::string nc_bdy_file_temp_string;
784  bool has_bdy = pp.queryAdd("nc_bdy_file", nc_bdy_file_temp_string);
785  if (!has_bdy) use_real_bcs = false;
786 
787  bool use_real_bcs_temp = use_real_bcs;
788  pp.queryAdd("use_real_bcs", use_real_bcs_temp);
789  if (use_real_bcs && !use_real_bcs_temp) {
790  use_real_bcs = false;
791  }
792  }
793 
794  if (found == 0 || init_type == InitType::None) {
795  amrex::Print() << "init_type must now be set. The options are " << std::endl;
796  amrex::Print() << " Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
797  amrex::Print() << " ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
798  amrex::Error("Please add a string for init_type to your inputs file or command line");
799  }
800 
801  // How to interpret input_sounding
802  if (init_type == InitType::Input_Sounding) {
803  pp.query_enum_case_insensitive("sounding_type",sounding_type);
804  }
805 
806  if (terrain_type == TerrainType::StaticFittedMesh ||
807  terrain_type == TerrainType::MovingFittedMesh) {
808  mesh_type = MeshType::VariableDz;
809  }
810 
811  if ( (moisture_type == MoistureType::SAM ||
812  moisture_type == MoistureType::SAM_NoIce ||
813  moisture_type == MoistureType::SAM_NoPrecip_NoIce ) &&
814  (mesh_type == MeshType::VariableDz) )
815  {
816  amrex::Abort("SAM is not correct with variable dz -- choose another moisture model");
817  }
818 
819  pp.queryAdd("grid_stretching_ratio", grid_stretching_ratio);
820  if (grid_stretching_ratio != 0) {
822  "The grid stretching ratio must be greater than 1");
823  }
824  if (grid_stretching_ratio >= 1) {
825  if (terrain_type == TerrainType::None) {
826  terrain_type = TerrainType::StaticFittedMesh;
827  }
828  if (mesh_type == MeshType::ConstantDz) {
829  mesh_type = MeshType::StretchedDz;
830  }
831  pp.queryAdd("zsurface", zsurf);
832  if (zsurf != zero) {
833  amrex::Print() << "Nominal zsurface height != 0, may result in unexpected behavior"
834  << std::endl;
835  }
836  pp.get("initial_dz", dz0);
837  }
838 
839  int n_zlevels = pp.countval("terrain_z_levels");
840  if (n_zlevels > 0)
841  {
842  if (terrain_type == TerrainType::None) {
843  terrain_type = TerrainType::StaticFittedMesh;
844  }
845  if (mesh_type == MeshType::ConstantDz) {
846  mesh_type = MeshType::StretchedDz;
847  }
848  }
849 
850  // Use lagged_delta_rt in the fast integrator?
851  pp.queryAdd("use_lagged_delta_rt", use_lagged_delta_rt);
852 
853  // Average the input z-face heights onto the nodes, or reconstruct our own
854  pp.queryAdd("avg_grid_faces_to_nodes",avg_grid_faces_to_nodes);
855 
856  // Catch the old name for the flag above so the error says what to do
857  // rather than silently ignoring the setting.
858  if (pp.contains("use_wrf_height_grid")) {
859  amrex::Abort("erf.use_wrf_height_grid has been renamed. "
860  "Set erf.avg_grid_faces_to_nodes instead; it carries "
861  "the same meaning (average the input z-face heights "
862  "onto the nodes rather than reconstructing them).");
863  }
864 
865  // Rebalance wrf state?
866  pp.queryAdd("rebalance_wrf_input", rebalance_wrf_input);
867 
868  // Must rebalance if the nodal heights were reconstructed rather than averaged
870  amrex::Print() << "Must rebalance when not averaging the input height grid. Setting rebalance_wrf_input to true \n";
871  rebalance_wrf_input = true;
872  }
873 
874  // These default to true but are used for unit testing
875  pp.queryAdd("use_gravity", use_gravity);
876 
877  // Initializing from Metgrid or WRFInput without gravity makes no sense
878  if ( !use_gravity && ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) ) {
879  amrex::Print() << "Setting use_gravity to true due to init_type = WRFInput / Metgrid " << std::endl;
880  use_gravity = true;
881  }
882 
884 
885  pp.queryAdd("c_p", c_p);
886  rdOcp = R_d / c_p;
887 
888  // *******************************************************************************
889  // Read anelastic etc and over-ride if necessary
890  // *******************************************************************************
891 
892  read_int_string(max_level, "anelastic", anelastic, 0);
893  read_int_string(max_level, "fixed_density", fixed_density, 0);
894  read_int_string(max_level, "project_initial_velocity", project_initial_velocity, 0);
895 
896  bool any_anelastic = false;
897  bool any_compress = false;
898  for (int i = 0; i <= max_level; ++i) {
899  if (anelastic[i] == 1) {
901  fixed_density[i] = 1; // We default to true but are allowed to override below
902  buoyancy_type[i] = 3; // (This isn't actually used when anelastic is set)
903  any_anelastic = true;
904  } else {
905  any_compress = true;
906  }
907  }
908 
909  // Want to have different immersed forcing defaults depending on anelastic or fully compressible.
910  // We should have different starting values because the stability of the method is dependent on dt.
911  // dt is coarser for anelastic --> need to loosen stiffness of immersed forcing.
912  if (any_anelastic) {
913  immersed_forcing_substep = false;
914  if_Cd_momentum = amrex::Real(50.0);
915  if_Cd_scalar = amrex::Real(5.0);
916  } else {
918  if_Cd_momentum = amrex::Real(500.0);
919  if_Cd_scalar = amrex::Real(50.0);
920  }
921 
922  // *******************************************************************************
923  // Read substepping_type and allow for different values at each level
924  // *******************************************************************************
925  substepping_type.resize(max_level+1);
926 
927  for (int i = 0; i <= max_level; i++) {
928  substepping_type[i] = SubsteppingType::Implicit;
929  }
930 
931  for (int i = 0; i <= max_level; i++) {
933  pp, "substepping_type", substepping_type[i], i, max_level);
934  }
935 
936  pp.queryAdd("substepping_diag", substepping_diag);
937 
938  pp.queryAdd("beta_s", beta_s);
939 
940 
941 
942  // *******************************************************************************
943  // Error check on deprecated input
944  // *******************************************************************************
945  int nvals_old = pp.countval("no_substepping");
946  if (nvals_old > 0) {
947  amrex::Error("The no_substepping flag is deprecated -- set substepping_type instead");
948  }
949 
950  // *******************************************************************************
951 
952  pp.queryAdd("ncorr", ncorr);
953  pp.queryAdd("poisson_abstol", poisson_abstol);
954  pp.queryAdd("poisson_reltol", poisson_reltol);
955 #ifdef AMREX_USE_FLOAT
956  poisson_abstol = amrex::max(poisson_abstol,amrex::Real(1e-6));
957  poisson_reltol = amrex::max(poisson_reltol,amrex::Real(1e-6));
958 #endif
959  for (int lev = 0; lev <= max_level; lev++) {
960  if (anelastic[lev] != 0)
961  {
962  substepping_type[lev] = SubsteppingType::None;
963  }
964  }
965 
966  pp.queryAdd("force_stage1_single_substep", force_stage1_single_substep);
967 
968  // Include Coriolis forcing?
969  pp.queryAdd("use_coriolis", use_coriolis);
970  pp.queryAdd("variable_coriolis", variable_coriolis);
971 
972  // Include four stream radiation approximation
973  pp.queryAdd("four_stream_radiation", four_stream_radiation);
974 
975  // flags for whether to apply other source terms in substep only
976  pp.queryAdd("immersed_forcing_substep", immersed_forcing_substep); // apply immersed forcing source terms in substep only
977  pp.queryAdd("forest_substep", forest_substep); // apply canopy-related source terms in substep only
978 
979  // Fixed-leaf-temperature canopy heat exchange
980  pp.query("forest_biophysics", forest_biophysics);
981  pp.query("forest_biophysics_heat", forest_biophysics_heat);
982  pp.query("forest_leaf_theta_fixed", forest_leaf_theta_fixed);
983 
986  "forest_biophysics_heat requires forest_biophysics = true");
990  "forest_biophysics_heat requires a positive forest_leaf_theta_fixed");
993  "forest_leaf_theta_fixed requires forest_biophysics_heat = true");
994 
995  // immersed forcing parameters
996  pp.queryAdd("if_Cd_momentum", if_Cd_momentum);
997  pp.queryAdd("if_Cd_scalar", if_Cd_scalar);
998  pp.queryAdd("if_implicit_drag", if_implicit_drag); // flag for implicit vs. explicit drag formulation
999  pp.queryAdd("if_z0", if_z0);
1000  pp.queryAdd("if_surf_temp_flux", if_surf_temp_flux);
1001  pp.queryAdd("if_init_surf_temp", if_init_surf_temp);
1002 
1003  pp.queryAdd("if_surf_heating_rate", if_surf_heating_rate);
1004 
1005  // Modify rate to be in units of K / s rather than K / hr
1006  if_surf_heating_rate /= amrex::Real(3600.0); // [K/s]
1007 
1008  pp.queryAdd("if_Olen", if_Olen_in);
1009  pp.queryAdd("if_use_most",if_use_most);
1010  pp.queryAdd("if_stability_correction",if_stability_correction);
1011  pp.queryAdd("if_ws_floor",if_ws_floor);
1012  pp.queryAdd("if_damp_alpha",if_damp_alpha);
1013 
1014  if ((if_init_surf_temp > zero && if_surf_temp_flux != amrex::Real(1e-8)) ||
1015  (if_init_surf_temp > zero && if_Olen_in != amrex::Real(1e-8)) ||
1016  (if_Olen_in != amrex::Real(1e-8) && if_surf_temp_flux != amrex::Real(1e-8)))
1017  {
1018  amrex::Error("Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
1019  }
1020 
1021  // Flag to do MOST rotations with terrain
1022  pp.queryAdd("use_rotate_surface_flux",use_rotate_surface_flux);
1024  AMREX_ASSERT_WITH_MESSAGE(terrain_type != TerrainType::None,"MOST stress rotations are only valid with terrain!");
1025  }
1026 
1027  // Which external forcings?
1028  abl_driver_type = ABLDriverType::None; // Default: no ABL driver for simulating classical fluid dynamics problems
1029  pp.query_enum_case_insensitive("abl_driver_type",abl_driver_type);
1030  pp.queryAdd("const_massflux_u", const_massflux_u);
1031  pp.queryAdd("const_massflux_v", const_massflux_v);
1032  pp.queryAdd("const_massflux_tau", const_massflux_tau);
1033  pp.queryAdd("const_massflux_layer_lo", const_massflux_layer_lo);
1034  pp.queryAdd("const_massflux_layer_hi", const_massflux_layer_hi);
1035 
1036  // Which type of inflow turbulent generation
1037  pert_type.resize(max_level+1);
1038  for (int lev = 0; lev <= max_level; ++lev) {
1039  pert_type[lev] = PerturbationType::None; // Default
1041  pp, "perturbation_type", pert_type[lev], lev, max_level);
1042  }
1043 
1044  amrex::Vector<amrex::Real> abl_pressure_grad_in = {zero, zero, zero};
1045  pp.queryarr("abl_pressure_grad",abl_pressure_grad_in);
1046  for(int i = 0; i < AMREX_SPACEDIM; ++i) abl_pressure_grad[i] = abl_pressure_grad_in[i];
1047 
1048  amrex::Vector<amrex::Real> abl_geo_forcing_in = {zero, zero, zero};
1049  if(pp.queryarr("abl_geo_forcing",abl_geo_forcing_in)) {
1050  amrex::Print() << "Specified abl_geo_forcing: (";
1051  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
1052  abl_geo_forcing[i] = abl_geo_forcing_in[i];
1053  amrex::Print() << abl_geo_forcing[i] << " ";
1054  }
1055  amrex::Print() << ")" << std::endl;
1056  }
1057 
1058  if (use_coriolis)
1059  {
1061  }
1062 
1063  pp.queryAdd("add_custom_rhotheta_forcing", custom_rhotheta_forcing);
1064  pp.queryAdd("add_custom_moisture_forcing", custom_moisture_forcing);
1065  pp.queryAdd("add_custom_w_subsidence", custom_w_subsidence);
1066  pp.queryAdd("add_do_theta_advection", do_theta_advection); // If true, apply custom subsidence to (rho*theta) when add_custom_w_subsidence is used
1067  pp.queryAdd("add_do_mom_advection", do_mom_advection); // If true, apply custom subsidence to momentum when add_custom_w_subsidence is used
1068  pp.queryAdd("add_custom_geostrophic_profile", custom_geostrophic_profile);
1069  pp.queryAdd("custom_forcing_uses_primitive_vars", custom_forcing_prim_vars);
1070  pp.queryAdd("spatial_rhotheta_forcing", spatial_rhotheta_forcing);
1071  pp.queryAdd("spatial_moisture_forcing", spatial_moisture_forcing);
1072 
1073  pp.queryAdd("nudging_from_input_sounding", nudging_from_input_sounding);
1074 
1075  int nudging_u_z1_set = pp.queryAdd("nudging_u_z1", nudging_u_z1);
1076  int nudging_u_z2_set = pp.queryAdd("nudging_u_z2", nudging_u_z2);
1077  pp.queryAdd("nudging_t_z1", nudging_t_z1);
1078  pp.queryAdd("nudging_t_z2", nudging_t_z2);
1079  pp.queryAdd("nudging_q_z1", nudging_q_z1);
1080  pp.queryAdd("nudging_q_z2", nudging_q_z2);
1081 
1083  "nudging_u_z1 must be less than or equal to nudging_u_z2");
1085  "nudging_t_z1 must be less than or equal to nudging_t_z2");
1087  "nudging_q_z1 must be less than or equal to nudging_q_z2");
1088 
1089  pp.queryAdd("nudging_u", nudging_u);
1090  pp.queryAdd("nudging_t", nudging_t);
1091  pp.queryAdd("nudging_q", nudging_q);
1092 
1093  pp.queryAdd("large_scale_forcing", large_scale_forcing);
1094 
1096  if (!nudging_u) {
1097  amrex::Print() << "WARNING: erf.nudging_u = false has no effect when erf.large_scale_forcing "
1098  "= true; momentum nudging is then controlled solely by large_scale_forcing.\n";
1099  }
1100  if (nudging_u_z1_set || nudging_u_z2_set) {
1101  amrex::Print() << "WARNING: erf.nudging_u_z1/erf.nudging_u_z2 are ignored when "
1102  "erf.large_scale_forcing = true; momentum nudging is then applied "
1103  "at all heights.\n";
1104  }
1105  }
1106 
1109  "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
1110 
1111  pp.queryAdd("Ave_Plane", ave_plane);
1112 
1113  // Use numerical diffusion?
1114  pp.queryAdd("num_diff_coeff",num_diff_coeff);
1116  "Numerical diffusion coefficient must be between 0 & one");
1117  use_num_diff = (num_diff_coeff > 0);
1118  if (use_num_diff) {
1119  amrex::Print() << "6th-order numerical diffusion turned on with coefficient = "
1120  << num_diff_coeff << std::endl;
1121  num_diff_coeff *= amrex::Math::powi<-6>(two);
1122  }
1123 
1124  advChoice.init_params(pp_prefix);
1125  diffChoice.init_params(pp_prefix);
1126  dampingChoice.init_params(pp_prefix);
1127  spongeChoice.init_params(pp_prefix);
1128  ebChoice.init_params(pp_prefix);
1129 
1130  turbChoice.resize(max_level+1);
1131  for (int lev = 0; lev <= max_level; lev++) {
1132  turbChoice[lev].init_params(lev,max_level,pp_prefix);
1133  }
1134 
1135  vert_implicit_fac.resize(max_level+1);
1136  for (int lev = 0; lev <= max_level; lev++) {
1137  vert_implicit_fac[lev].resize(3);
1138  vert_implicit_fac[lev][0] = one;
1139  vert_implicit_fac[lev][1] = one;
1140  vert_implicit_fac[lev][2] = zero;
1141  }
1142 
1143  // YSU PBL: use consistent coriolis frequency
1144  for (int lev = 0; lev <= max_level; lev++) {
1145  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1146  if (use_coriolis) {
1147  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
1148  if (lev == 0) {
1149  amrex::Print() << "YSU PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1150  }
1151  } else {
1152  amrex::Error("YSU cannot use ERF coriolis frequency if not using coriolis");
1153  }
1154  }
1155  }
1156  // MRF
1157  for (int lev = 0; lev <= max_level; lev++) {
1158  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1159  if (use_coriolis) {
1160  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
1161  if (lev == 0) {
1162  amrex::Print() << "MRF PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1163  }
1164  } else {
1165  amrex::Error("MRF cannot use ERF coriolis frequency if not using coriolis");
1166  }
1167  }
1168  }
1169 
1170  // What's the strength of the bdy nudging?
1171  pp.queryAdd("bdy_nudge_factor",bdy_nudge_factor);
1172 
1173  // Optionally use the dry-air density reconstructed from wrfbdy.
1174  pp.queryAdd("use_wrf_bdy_density", use_wrf_bdy_density);
1175 
1176  // Optionally ingest cloud water and cloud ice from wrfinput/wrfbdy.
1177  pp.queryAdd("use_wrf_bdy_qc_qi", use_wrf_bdy_qc_qi);
1178 
1179  if (!use_real_bcs || init_type != InitType::WRFInput) {
1180  use_wrf_bdy_density = false;
1181  }
1182 
1183  pp.queryAdd("bdy_rho_nudge_factor", bdy_rho_nudge_factor);
1184 
1185  // Which approach to nudging the moist variables in the boundary region?
1186  pp.queryAdd("bdy_moist_nudge_type",bdy_moist_nudge_type);
1187  if (bdy_moist_nudge_type < 0 || bdy_moist_nudge_type > 3) {
1188  amrex::Error("erf.bdy_moist_nudge_type must be one of 0, 1, 2, or 3");
1189  }
1190  if (bdy_moist_nudge_type == 3 && !use_wrf_bdy_qc_qi) {
1191  amrex::Error("erf.bdy_moist_nudge_type = 3 requires erf.use_wrf_bdy_qc_qi = true");
1192  }
1193  if (use_wrf_bdy_qc_qi) {
1194  if (moisture_type == MoistureType::None) {
1195  amrex::Error("erf.use_wrf_bdy_qc_qi requires an active moisture model");
1196  }
1197  if (!use_real_bcs || init_type != InitType::WRFInput) {
1198  amrex::Error("erf.use_wrf_bdy_qc_qi requires WRFInput real boundary conditions");
1199  }
1202  amrex::Error("erf.use_wrf_bdy_qc_qi requires active qv and qc component indices");
1203  }
1204  const int optional_moisture_comps[] = {moisture_indices.qi,
1208  for (const int comp : optional_moisture_comps) {
1209  if (comp != -1 && (comp < RhoQ1_comp || comp > RhoQ11_comp)) {
1210  amrex::Error("erf.use_wrf_bdy_qc_qi found an invalid active moisture component index");
1211  }
1212  }
1213  }
1214 
1215  // Are me transporting the scalar component?
1216  pp.queryAdd("transport_scalar",transport_scalar);
1217 
1218  for (int lev = 0; lev <= max_level; ++lev) {
1219  if (turbChoice[lev].uses_eamxx_shoc()) {
1220  use_eamxx_shoc = true;
1221  }
1222  if (turbChoice[lev].uses_native_shoc()) {
1223  use_native_shoc = true;
1225  }
1226  }
1227 
1228  // Set up the vertical implicit diffusion solve
1229  int n_impfac = pp.countval("vert_implicit_fac");
1230  AMREX_ALWAYS_ASSERT(n_impfac == 0 || n_impfac == 1 || n_impfac==3);
1231  if (n_impfac == 1) {
1232  amrex::Real fac_in;
1233  pp.get("vert_implicit_fac", fac_in);
1234  for (int lev = 0; lev <= max_level; lev++) {
1235  for (int i=0; i<3; ++i) {
1236  vert_implicit_fac[lev][i] = fac_in;
1237  }
1238  }
1239  } else if (n_impfac == 3) {
1240  for (int lev = 0; lev <= max_level; lev++) {
1241  pp.getarr("vert_implicit_fac", vert_implicit_fac[lev]);
1242  }
1243  }
1244 
1245  // Record whether the user explicitly requested these
1246  const bool user_set_imp_thermal = pp.contains("implicit_thermal_diffusion");
1247  const bool user_set_imp_moisture = pp.contains("implicit_moisture_diffusion");
1248  const bool user_set_imp_ke = pp.contains("implicit_ke_diffusion");
1249  const bool user_set_imp_momentum = pp.contains("implicit_momentum_diffusion");
1250 
1251  // If true (default), include implicit contributions to vertical thermal diffusion
1252  pp.queryAdd("implicit_thermal_diffusion", implicit_thermal_diffusion);
1253 
1254  // If true (default), include implicit contributions to vertical moisture diffusion
1255  pp.queryAdd("implicit_moisture_diffusion", implicit_moisture_diffusion);
1256 
1257  // If true (default), include implicit contributions to vertical KE diffusion
1258  pp.queryAdd("implicit_ke_diffusion", implicit_ke_diffusion);
1259 
1260  // If true (default), include implicit contributions in tau13, tau23,
1261  pp.queryAdd("implicit_momentum_diffusion", implicit_momentum_diffusion);
1262 
1263  // The default is true (i.e. that it happens before the acoustic substepping).
1264  pp.queryAdd("implicit_before_substep", implicit_before_substep);
1265  for (int lev = 0; lev <= max_level; lev++) {
1266  if ( (substepping_type[lev] == SubsteppingType::None) && !implicit_before_substep) {
1267  amrex::Print() << "implicit_before_substep cannot be false without substepping; setting to true." << "\n";
1268  implicit_before_substep = true;
1269  }
1270  }
1271 
1272  // Handle shoc case -- SHOC owns whatever vertical diffusion the host does not
1273  if (uses_shoc_family()) {
1274  const bool host_owns_scalars = host_owns_vertical_scalar_diffusion();
1275  const bool host_owns_momentum = host_owns_vertical_momentum_diffusion();
1276  if (!host_owns_scalars &&
1277  ( (user_set_imp_thermal && implicit_thermal_diffusion ) ||
1278  (user_set_imp_moisture && implicit_moisture_diffusion) ||
1279  (user_set_imp_ke && implicit_ke_diffusion ) ) ) {
1280  amrex::Print() << "Ignoring erf.implicit_{thermal,moisture,ke}_diffusion = true; "
1281  << "SHOC owns vertical scalar diffusion." << "\n";
1282  }
1283  if (!host_owns_momentum && user_set_imp_momentum && implicit_momentum_diffusion) {
1284  amrex::Print() << "Ignoring erf.implicit_momentum_diffusion = true; "
1285  << "SHOC owns vertical momentum diffusion." << "\n";
1286  }
1287 
1288  implicit_thermal_diffusion = (implicit_thermal_diffusion && host_owns_scalars);
1290  implicit_ke_diffusion = (implicit_ke_diffusion && host_owns_scalars);
1291  implicit_momentum_diffusion = (implicit_momentum_diffusion && host_owns_momentum);
1292 
1293  // Make the resulting configuration visible in the run log
1294  if (!host_owns_scalars && !host_owns_momentum) {
1295  amrex::Print() << "Turning off vertical implicit solve for all components since SHOC owns diffusion." << "\n";
1296  } else {
1297  amrex::Print() << "SHOC hands vertical diffusion of"
1298  << (host_owns_scalars ? " scalars" : "")
1299  << (host_owns_momentum ? " momentum" : "")
1300  << " to the host; keeping the vertical implicit solve on (theta = "
1302  << ", moisture = " << implicit_moisture_diffusion
1303  << ", tke = " << implicit_ke_diffusion
1304  << ", momenta = " << implicit_momentum_diffusion << ")." << "\n";
1305  }
1306  } // uses_shoc_family
1307 
1308  // Do not allow implicit vertical diff if user turns it off
1309  bool do_vert_implicit = true;
1310  pp.queryAdd("vert_implicit", do_vert_implicit);
1311  if (!do_vert_implicit) {
1312  for (int lev = 0; lev <= max_level; lev++) {
1313  amrex::Print() << "Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
1314  vert_implicit_fac[lev][0] = zero;
1315  vert_implicit_fac[lev][1] = zero;
1316  vert_implicit_fac[lev][2] = zero;
1317  }
1318  }
1319 
1320  // Do not allow implicit vertical diff with anelastic
1321  for (int lev = 0; lev <= max_level; lev++) {
1322  if (anelastic[lev]) {
1323  amrex::Print() << "Turning off native vertical implicit solve flag because anelastic at level " << lev << std::endl;
1324  vert_implicit_fac[lev][0] = zero;
1325  vert_implicit_fac[lev][1] = zero;
1326  vert_implicit_fac[lev][2] = zero;
1327  }
1328  }
1329 
1330  // Do not allow implicit vertical diff with EB
1331  if (terrain_type == TerrainType::EB) {
1332  for (int lev = 0; lev <= max_level; lev++) {
1333  if (do_vert_implicit) {
1334  amrex::Print() << "Implicit diffusion is not supported with EB; turning off at level " << lev << "\n";
1335  vert_implicit_fac[lev][0] = zero;
1336  vert_implicit_fac[lev][1] = zero;
1337  vert_implicit_fac[lev][2] = zero;
1338  }
1339  }
1340  }
1341 
1342  // Do not allow implicit vertical diff when all the components are false
1347  amrex::Print() << "Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
1348  for (int lev = 0; lev <= max_level; lev++) {
1349  vert_implicit_fac[lev][0] = zero;
1350  vert_implicit_fac[lev][1] = zero;
1351  vert_implicit_fac[lev][2] = zero;
1352  }
1353  }
1354 
1355  // Which type of multilevel coupling
1356  coupling_type = CouplingType::TwoWay; // Default
1357  pp.query_enum_case_insensitive("coupling_type",coupling_type);
1358 
1359  // Test for hybrid (compressible + anelastic) -- in this case we must use one-way coupling
1360  if (any_anelastic && any_compress) {
1361  coupling_type = CouplingType::OneWay;
1362  }
1363 
1364  // Which type of windfarm model
1365  windfarm_type = WindFarmType::None; // Default
1366  pp.query_enum_case_insensitive("windfarm_type",windfarm_type);
1367 
1368  windfarm_loc_type = WindFarmLocType::None;
1369  pp.query_enum_case_insensitive("windfarm_loc_type",windfarm_loc_type);
1370 
1371  pp.queryAdd("windfarm_loc_table", windfarm_loc_table);
1372  pp.queryAdd("windfarm_spec_table", windfarm_spec_table);
1373  pp.queryAdd("windfarm_blade_table", windfarm_blade_table);
1374  pp.queryAdd("windfarm_airfoil_tables", windfarm_airfoil_tables);
1375  pp.queryAdd("windfarm_spec_table_extra", windfarm_spec_table_extra);
1376 
1377  // Sampling distance upstream of the turbine to find the
1378  // incoming free stream velocity as a factor of the diameter of the
1379  // turbine. ie. the sampling distance will be this number multiplied
1380  // by the diameter of the turbine
1381  pp.queryAdd("sampling_distance_by_D", sampling_distance_by_D);
1382  pp.queryAdd("turb_disk_angle_from_x", turb_disk_angle);
1383 
1384  pp.queryAdd("windfarm_x_shift",windfarm_x_shift);
1385  pp.queryAdd("windfarm_y_shift",windfarm_y_shift);
1386  // Test if time averaged data is to be output
1387  pp.queryAdd("time_avg_vel",time_avg_vel);
1388 
1389  // Interval means and resolved turbulent moments for plotfile output
1390  pp.queryAdd("compute_mean_vars", compute_mean_vars);
1391  pp.queryAdd("mean_vars_reset_mode", mean_vars_reset_mode);
1392  pp.queryAdd("mean_vars_reset_time", mean_vars_reset_time);
1393 
1394  if (compute_mean_vars &&
1395  mean_vars_reset_mode != "plotfile" && mean_vars_reset_mode != "time") {
1396  amrex::Error("erf.mean_vars_reset_mode must be either 'plotfile' or 'time'");
1397  }
1398  if (compute_mean_vars && mean_vars_reset_mode == "time" &&
1400  amrex::Error("erf.mean_vars_reset_time must be non-negative when "
1401  "erf.mean_vars_reset_mode = 'time'");
1402  }
1403 
1404  pp.queryAdd("hindcast_lateral_forcing", hindcast_lateral_forcing);
1405 
1407  pp.queryAdd("hindcast_boundary_data_dir", hindcast_boundary_data_dir);
1408 
1409  if(hindcast_boundary_data_dir.empty()) {
1410  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
1411  }
1412  pp.queryAdd("hindcast_data_interval_in_hrs", hindcast_data_interval_in_hrs);
1414  amrex::Error("ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
1415  "data files is either missing or set to less than zero");
1416  }
1417  pp.queryAdd("hindcast_lateral_sponge_strength", hindcast_lateral_sponge_strength);
1418  pp.queryAdd("hindcast_lateral_sponge_length", hindcast_lateral_sponge_length);
1419 
1420  pp.queryAdd("hindcast_zhi_sponge_length", hindcast_zhi_sponge_length);
1421  pp.queryAdd("hindcast_zhi_sponge_strength", hindcast_zhi_sponge_strength);
1422 
1423  pp.queryAdd("hindcast_zhi_sponge_damping", hindcast_zhi_sponge_damping);
1424 
1426  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
1427  }
1428 
1430  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
1431  }
1432 
1434  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_length' or it is specified to be less than zero");
1435  }
1436 
1438  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
1439  }
1440  }
1441 
1442  pp.queryAdd("hindcast_surface_bcs", hindcast_surface_bcs);
1443  if(hindcast_surface_bcs) {
1444  pp.queryAdd("hindcast_surface_data_dir", hindcast_surface_data_dir);
1445  }
1446 
1447  pp.queryAdd("io_hurricane_eye_tracker", io_hurricane_eye_tracker);
1449  pp.queryAdd("hurricane_eye_latitude", hurricane_eye_latitude);
1450  pp.queryAdd("hurricane_eye_longitude", hurricane_eye_longitude);
1452  amrex::Error("ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
1453  " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
1454  " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
1455  " location of the eye in the initial condition");
1456  }
1457  }
1458 
1459  pp.queryAdd("is_init_for_ensemble", is_init_for_ensemble);
1460  if(is_init_for_ensemble) {
1461  amrex::ParmParse pp_ens("ensemble");
1462  pp_ens.queryAdd("n_members", n_ensemble);
1463  if(n_ensemble < 2) {
1464  amrex::Abort("You are using an ensemble run. There needs to be at least 2 ensemble members. "
1465  "erf.n_ensemble must be >=2.");
1466  }
1467  pp_ens.queryAdd("coarse_bckgnd_data_file", coarse_bckgnd_data_file);
1468  if (coarse_bckgnd_data_file.empty()) {
1469  amrex::Abort("coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
1470  "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
1471  "which contains the filename in the inputs.");
1472  }
1473  pp_ens.queryAdd("ens_pert_amplitude", ens_pert_amplitude);
1474  if(ens_pert_amplitude <= 0.0) {
1475  amrex::Error("You are using initialization for ensemble simulations using the inputs option "
1476  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1477  "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
1478  "to be added to the background state and has to be greater than 0.0");
1479  }
1480  pp_ens.queryAdd("ens_pert_correlated_radius", ens_pert_correlated_radius);
1481  if(ens_pert_correlated_radius <= 0.0) {
1482  amrex::Error("You are using initialization with spatially correlated perturbations using the inputs option "
1483  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1484  "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
1485  "and has to be greater than 0.0");
1486  }
1487  }
1488  }
constexpr amrex::Real two
Definition: ERF_Constants.H:10
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:64
constexpr amrex::Real R_d
Definition: ERF_Constants.H:47
#define RhoQ11_comp
Definition: ERF_IndexDefines.H:55
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
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:138
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:80
AMREX_ASSERT_WITH_MESSAGE(wbar_cutoff_min > wbar_cutoff_max, "ERROR: wbar_cutoff_min < wbar_cutoff_max")
void init_params(std::string pp_prefix)
Read advection options from the input parameter database.
Definition: ERF_AdvStruct.H:25
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:28
void init_params(std::string pp_prefix)
Read embedded-boundary options from the input parameter database.
Definition: ERF_EBStruct.H:42
int qs
snow
Definition: ERF_DataStruct.H:210
int qr
rain
Definition: ERF_DataStruct.H:209
int qi
cloud ice
Definition: ERF_DataStruct.H:208
int qv
water vapor
Definition: ERF_DataStruct.H:206
int qc
cloud liquid water
Definition: ERF_DataStruct.H:207
int qg
graupel
Definition: ERF_DataStruct.H:211
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:295
bool use_coupled_sst
Definition: ERF_DataStruct.H:2131
bool custom_geostrophic_profile
Whether a custom geostrophic wind profile is used.
Definition: ERF_DataStruct.H:1966
int n_ensemble
Number of ensemble members.
Definition: ERF_DataStruct.H:2202
bool implicit_before_substep
Whether implicit diffusion is applied before acoustic substepping.
Definition: ERF_DataStruct.H:1894
std::string hindcast_boundary_data_dir
Directory containing hindcast lateral boundary data.
Definition: ERF_DataStruct.H:2190
amrex::Real ens_pert_correlated_radius
Spatial correlation radius for ensemble perturbations.
Definition: ERF_DataStruct.H:2203
amrex::Real forest_leaf_theta_fixed
Definition: ERF_DataStruct.H:2179
static InitType init_type
Initial-condition source selected for the run.
Definition: ERF_DataStruct.H:1833
bool io_hurricane_eye_tracker
Whether hurricane-eye tracking output is enabled.
Definition: ERF_DataStruct.H:2198
amrex::Real const_massflux_layer_lo
Lower height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2185
amrex::Real hindcast_zhi_sponge_length
Length of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2195
amrex::Real gravity
Effective gravitational acceleration.
Definition: ERF_DataStruct.H:1946
bool variable_coriolis
Whether spatially varying Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2139
amrex::Real poisson_abstol
Absolute tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:1901
amrex::Real if_Cd_momentum
Immersed-forcing drag coefficient for momentum.
Definition: ERF_DataStruct.H:1923
bool nudging_t
Definition: ERF_DataStruct.H:1983
amrex::Real if_Olen_in
Input Obukhov length for immersed-forcing MOST [m].
Definition: ERF_DataStruct.H:1933
bool forest_biophysics
Definition: ERF_DataStruct.H:2177
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Build constant-latitude Coriolis forcing parameters.
Definition: ERF_DataStruct.H:1760
bool use_pert_pres_gradient
Whether momentum equations use perturbational pressure gradients.
Definition: ERF_DataStruct.H:1909
amrex::Vector< int > project_initial_velocity
Per-level flag for projecting the initial velocity.
Definition: ERF_DataStruct.H:1872
int ave_plane
Averaging plane index used by diagnostics.
Definition: ERF_DataStruct.H:2141
void 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:1810
bool nudging_q
Definition: ERF_DataStruct.H:1984
int ncorr
Number of projection correction iterations.
Definition: ERF_DataStruct.H:1896
bool use_rotate_surface_flux
Whether MOST surface fluxes are rotated with terrain.
Definition: ERF_DataStruct.H:1991
bool moisture_tight_coupling
Whether moisture updates use tight coupling.
Definition: ERF_DataStruct.H:2146
bool compute_mean_vars
Definition: ERF_DataStruct.H:2008
amrex::Real beta_s
Time off-centering coefficient for forward weighting.
Definition: ERF_DataStruct.H:1881
amrex::Real if_z0
Immersed-forcing roughness length [m].
Definition: ERF_DataStruct.H:1929
bool forest_substep
Whether canopy source terms are applied only during substeps.
Definition: ERF_DataStruct.H:1920
bool use_wrf_bdy_density
Definition: ERF_DataStruct.H:2159
std::string mean_vars_reset_mode
Definition: ERF_DataStruct.H:2011
amrex::Real num_diff_coeff
Numerical diffusion coefficient after input scaling.
Definition: ERF_DataStruct.H:2121
amrex::Real bdy_nudge_factor
Boundary sponge nudging factor.
Definition: ERF_DataStruct.H:2156
amrex::Real rdOcp
Ratio of dry-air gas constant to c_p.
Definition: ERF_DataStruct.H:1948
bool hindcast_lateral_forcing
Whether hindcast lateral forcing is enabled.
Definition: ERF_DataStruct.H:2192
bool do_theta_advection
Whether custom vertical subsidence is applied to rho-theta.
Definition: ERF_DataStruct.H:1964
amrex::Real nudging_q_z2
Definition: ERF_DataStruct.H:1980
static bool use_real_bcs
Whether real-data lateral boundary conditions are used.
Definition: ERF_DataStruct.H:1845
bool spatial_moisture_forcing
Whether spatially varying moisture forcing is enabled.
Definition: ERF_DataStruct.H:1969
amrex::Real nudging_u_z2
Definition: ERF_DataStruct.H:1976
static SoundingType sounding_type
Interpretation used for input sounding profiles.
Definition: ERF_DataStruct.H:1836
int bdy_moist_nudge_type
Moist-variable nudging strategy in boundary regions.
Definition: ERF_DataStruct.H:2168
amrex::Real poisson_reltol
Relative tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:1902
bool time_avg_vel
Whether time-averaged velocity fields are output.
Definition: ERF_DataStruct.H:2005
bool have_geo_wind_profile
Whether a geostrophic wind profile has been configured.
Definition: ERF_DataStruct.H:2137
bool four_stream_radiation
Whether the four-stream radiation approximation is enabled.
Definition: ERF_DataStruct.H:1916
amrex::Real if_damp_alpha
Immersed-forcing damping coefficient.
Definition: ERF_DataStruct.H:1937
bool rebalance_wrf_input
Whether to rebalance states from wrfinput and wrfbdy data.
Definition: ERF_DataStruct.H:1943
amrex::Real hindcast_data_interval_in_hrs
Time interval between hindcast data files [hr].
Definition: ERF_DataStruct.H:2191
amrex::Real const_massflux_layer_hi
Upper height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2186
bool avg_grid_faces_to_nodes
Definition: ERF_DataStruct.H:2171
std::string windfarm_spec_table_extra
Additional wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2148
amrex::Real if_ws_floor
Wind-speed floor for immersed-forcing MOST [m/s].
Definition: ERF_DataStruct.H:1936
bool is_init_for_ensemble
Whether initialization is for an ensemble simulation.
Definition: ERF_DataStruct.H:2201
bool uses_shoc_family() const noexcept
Query whether any SHOC-family PBL scheme is active.
Definition: ERF_DataStruct.H:2063
bool test_mapfactor
Whether to use test map scale factors.
Definition: ERF_DataStruct.H:1905
amrex::Real nudging_u_z1
Definition: ERF_DataStruct.H:1975
std::string coarse_bckgnd_data_file
Coarse background data file used for ensemble initialization.
Definition: ERF_DataStruct.H:2205
amrex::Real dz0
Initial vertical grid spacing for stretched-grid setup.
Definition: ERF_DataStruct.H:1953
amrex::Real ens_pert_amplitude
Amplitude of ensemble initialization perturbations.
Definition: ERF_DataStruct.H:2204
std::string windfarm_airfoil_tables
Wind-farm airfoil table paths.
Definition: ERF_DataStruct.H:2149
amrex::Real bdy_rho_nudge_factor
Definition: ERF_DataStruct.H:2165
amrex::Real nudging_q_z1
Definition: ERF_DataStruct.H:1979
bool transport_scalar
Whether the passive scalar component is transported.
Definition: ERF_DataStruct.H:2002
bool hindcast_zhi_sponge_damping
Whether upper-boundary hindcast sponge damping is enabled.
Definition: ERF_DataStruct.H:2196
amrex::Real hurricane_eye_longitude
Initial hurricane-eye longitude.
Definition: ERF_DataStruct.H:2199
LandSurfaceType lsm_type
Land-surface model.
Definition: ERF_DataStruct.H:2127
bool large_scale_forcing
Definition: ERF_DataStruct.H:1986
bool substepping_diag
Whether to emit extra CFL diagnostics for compressible substepping.
Definition: ERF_DataStruct.H:1877
amrex::Real mean_vars_reset_time
Definition: ERF_DataStruct.H:2012
std::string windfarm_blade_table
Wind-farm blade table path.
Definition: ERF_DataStruct.H:2149
amrex::Vector< int > is_land
Per-level land/water selector.
Definition: ERF_DataStruct.H:1874
amrex::Real hindcast_lateral_sponge_strength
Strength of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2194
bool forest_biophysics_heat
Definition: ERF_DataStruct.H:2178
amrex::Real hurricane_eye_latitude
Initial hurricane-eye latitude.
Definition: ERF_DataStruct.H:2199
amrex::Real if_Cd_scalar
Immersed-forcing drag coefficient for scalars.
Definition: ERF_DataStruct.H:1924
std::string windfarm_loc_table
Wind-farm location table path.
Definition: ERF_DataStruct.H:2148
std::string hindcast_surface_data_dir
Directory containing hindcast surface boundary data.
Definition: ERF_DataStruct.H:2190
bool custom_rhotheta_forcing
Whether custom rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:1961
amrex::Real zsurf
Nominal surface height for stretched-grid setup.
Definition: ERF_DataStruct.H:1952
amrex::Real if_init_surf_temp
Initial immersed-forcing surface temperature [K].
Definition: ERF_DataStruct.H:1931
amrex::Real nudging_t_z2
Definition: ERF_DataStruct.H:1978
std::string windfarm_spec_table
Wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2148
amrex::Real if_surf_temp_flux
Immersed-forcing surface temperature flux [K m/s].
Definition: ERF_DataStruct.H:1930
bool spatial_rhotheta_forcing
Whether spatially varying rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:1968
bool custom_w_subsidence
Whether custom vertical subsidence is enabled.
Definition: ERF_DataStruct.H:1963
bool custom_moisture_forcing
Whether custom moisture forcing is enabled.
Definition: ERF_DataStruct.H:1962
amrex::Real if_surf_heating_rate
Immersed-forcing surface heating rate [K/hr].
Definition: ERF_DataStruct.H:1932
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:2144
amrex::Real grid_stretching_ratio
Vertical grid stretching ratio.
Definition: ERF_DataStruct.H:1951
bool hindcast_surface_bcs
Whether hindcast surface boundary conditions are enabled.
Definition: ERF_DataStruct.H:2193
bool host_owns_vertical_scalar_diffusion() const noexcept
Test whether the host owns scalar diffusion.
Definition: ERF_DataStruct.H:2084
bool immersed_forcing_substep
Whether immersed-forcing source terms are applied only during substeps.
Definition: ERF_DataStruct.H:1919
bool if_use_most
Whether immersed-forcing MOST is enabled.
Definition: ERF_DataStruct.H:1934
amrex::Real const_massflux_tau
Relaxation time scale for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2184
amrex::Real hindcast_lateral_sponge_length
Length of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2194
bool host_owns_vertical_momentum_diffusion() const noexcept
Test whether the host owns momentum diffusion.
Definition: ERF_DataStruct.H:2072
amrex::Real hindcast_zhi_sponge_strength
Strength of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2195
int force_stage1_single_substep
Flag forcing a single substep in the first RK stage.
Definition: ERF_DataStruct.H:1867
amrex::Real c_p
Specific heat at constant pressure for dry air [J/(kg-K)].
Definition: ERF_DataStruct.H:1947
bool if_implicit_drag
Definition: ERF_DataStruct.H:1927
bool do_mom_advection
Whether custom vertical subsidence is applied to momentum.
Definition: ERF_DataStruct.H:1965
bool if_stability_correction
Whether immersed-forcing stability corrections are enabled.
Definition: ERF_DataStruct.H:1935
amrex::Real nudging_t_z1
Definition: ERF_DataStruct.H:1977
bool custom_forcing_prim_vars
Whether custom forcing operates on primitive variables.
Definition: ERF_DataStruct.H:1967
bool nudging_u
Definition: ERF_DataStruct.H:1982
bool nudging_from_input_sounding
Whether solution fields are nudged toward input sounding data.
Definition: ERF_DataStruct.H:1973
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:2120
bool use_wrf_bdy_qc_qi
Whether WRF cloud water and active cloud ice are ingested at real boundaries.
Definition: ERF_DataStruct.H:2162
void init_params(std::string pp_prefix)
Read sponge-layer options from the input parameter database.
Definition: ERF_SpongeStruct.H:28
Here is the call 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.
2096  {
2097  return uses_shoc_family();
2098  }
Here is the call graph for this function:

◆ read_int_string()

void 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.
1812  {
1813  amrex::ParmParse pp("erf");
1814  int nvals = pp.countval(string_to_read);
1815  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
1816  amrex::Vector<int> temp; temp.resize(nvals);
1817  pp.queryarr(string_to_read,temp);
1818 
1819  if (vec_to_fill.size() < max_level+1) {
1820  vec_to_fill.resize(max_level+1);
1821  }
1822 
1823  if (nvals == 0) {
1824  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
1825  } else if (nvals == 1) {
1826  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
1827  } else {
1828  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
1829  }
1830  }

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.
1856  {
1857  mesh_type = new_mesh_type;
1858  }

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

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.
2033  {
2034  return pert_type[lev] == PerturbationType::Direct ||
2035  pert_type[lev] == PerturbationType::CPM ||
2036  pert_type[lev] == PerturbationType::CPM_W;
2037  }

◆ 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.
2020  {
2021  return pert_type[lev] == PerturbationType::Source ||
2022  pert_type[lev] == PerturbationType::Direct ||
2023  pert_type[lev] == PerturbationType::CPM ||
2024  pert_type[lev] == PerturbationType::CPM_W;
2025  }

◆ 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.
2045  {
2046  return pert_type[lev] == PerturbationType::Source;
2047  }

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.
2055  {
2056  return pert_type[lev] == PerturbationType::CPM_W;
2057  }

◆ uses_shoc_family()

bool SolverChoice::uses_shoc_family ( ) const
inlinenoexcept

Query whether any SHOC-family PBL scheme is active.

Returns
True if native or EAMxx SHOC is active.
2064  {
2065  return (use_eamxx_shoc || use_native_shoc);
2066  }

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:

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().

◆ anelastic

SolverChoice::anelastic

Per-level flag selecting anelastic dynamics.

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

◆ 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_s

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

Time off-centering coefficient for forward weighting.

Referenced by init_params().

◆ buildings_type

SolverChoice::buildings_type = BuildingsType::None
inlinestatic

Building representation.

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

◆ 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().

◆ coarse_bckgnd_data_file

SolverChoice::coarse_bckgnd_data_file

Coarse background data file used for ensemble initialization.

Referenced by init_params().

◆ 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 display(), erf_slow_rhs_post(), erf_slow_rhs_pre(), and init_params().

◆ custom_forcing_prim_vars

SolverChoice::custom_forcing_prim_vars = false

Whether custom forcing operates on primitive variables.

Referenced by init_params(), make_mom_sources(), 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

SolverChoice::dampingChoice

Damping-related options.

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

◆ 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

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().

◆ fixed_density

SolverChoice::fixed_density

Per-level flag selecting fixed-density treatment.

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

◆ 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 init_params(), and make_mom_sources().

◆ four_stream_radiation

SolverChoice::four_stream_radiation = false

Whether the four-stream radiation approximation is enabled.

Referenced by init_params(), and make_sources().

◆ gradp_type

SolverChoice::gradp_type = 0

Terrain-fitted horizontal pressure-gradient formulation.

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

◆ gravity

SolverChoice::gravity

Effective gravitational acceleration.

Referenced by ComputeTurbulentViscosity(), erf_slow_rhs_post(), erf_slow_rhs_pre(), 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_Cd_momentum

◆ if_Cd_scalar

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

Immersed-forcing drag coefficient for scalars.

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

◆ if_damp_alpha

SolverChoice::if_damp_alpha = 0.5

◆ if_implicit_drag

◆ if_init_surf_temp

SolverChoice::if_init_surf_temp = zero

Initial immersed-forcing surface temperature [K].

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

◆ if_Olen_in

◆ if_stability_correction

SolverChoice::if_stability_correction = false

Whether immersed-forcing stability corrections are enabled.

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

◆ if_surf_heating_rate

SolverChoice::if_surf_heating_rate = zero

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

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

◆ if_surf_temp_flux

◆ if_use_most

◆ if_ws_floor

SolverChoice::if_ws_floor = 0.001

Wind-speed floor for immersed-forcing MOST [m/s].

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 ImmersedForcingBuildings_Xmom(), ImmersedForcingBuildings_Ymom(), ImmersedForcingBuildings_Zmom(), init_params(), make_mom_sources(), and make_sources().

◆ 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 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

Initial-condition source selected for the run.

Referenced by ERF::ComputeGlobalMinLocation(), ERF::HurricaneEyeTrackerInitial(), init_params(), and make_mom_sources().

◆ 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(), 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

◆ moisture_indices

SolverChoice::moisture_indices

◆ moisture_tight_coupling

SolverChoice::moisture_tight_coupling {false}

Whether moisture updates use tight coupling.

Referenced by init_params().

◆ moisture_type

◆ 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_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

◆ 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 ERF::ERF_shared(), and init_params().

◆ rad_type

SolverChoice::rad_type

◆ rdOcp

SolverChoice::rdOcp

◆ rebalance_wrf_input

SolverChoice::rebalance_wrf_input = true

Whether to rebalance states from wrfinput and wrfbdy data.

Referenced by init_params().

◆ 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().

◆ shoc_momentum_transport

◆ shoc_transport_mode

◆ 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().

◆ substepping_type

SolverChoice::substepping_type

Acoustic substepping type for each AMR level.

Referenced by display(), and init_params().

◆ terrain_type

◆ test_mapfactor

SolverChoice::test_mapfactor = false

Whether to use test map scale factors.

Referenced by init_params().

◆ time_avg_vel

SolverChoice::time_avg_vel = false

Whether time-averaged velocity fields are output.

Referenced by init_params().

◆ 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

◆ use_coriolis

SolverChoice::use_coriolis = false

Whether Coriolis forcing is enabled.

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

◆ use_coupled_sst

bool SolverChoice::use_coupled_sst = false

◆ use_eamxx_shoc

SolverChoice::use_eamxx_shoc = false

Whether any level uses the EAMxx SHOC PBL scheme.

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

◆ 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_wrf_bdy_density

bool SolverChoice::use_wrf_bdy_density = true

Referenced by init_params().

◆ use_wrf_bdy_qc_qi

SolverChoice::use_wrf_bdy_qc_qi = false

Whether WRF cloud water and active cloud ice are ingested at real boundaries.

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().

◆ 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(), 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().

◆ zsurf

SolverChoice::zsurf = zero

Nominal surface height for stretched-grid setup.

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


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