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...
 
bool rad_uses_interface () const
 True for the models that run through the IRadiation interface (RRTMGP, Simple); the two-stream model has its own class. More...
 

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...
 
RadChoice radChoice
 
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< AnelasticType > anelastic_type
 Per-level two-stage scheme used by the anelastic integrator. 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...
 
std::string wall_dist_type = "poisson"
 
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_snap_partial_cells = false
 
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::StateUpdate
 
bool transport_scalar = true
 Whether the passive scalar component is transported. More...
 
bool time_avg_vel = false
 Whether time-averaged velocity fields are output. More...
 
bool compute_mean_vars = false
 
std::string mean_vars_reset_mode = "plotfile"
 
amrex::Real mean_vars_reset_time = -one
 
amrex::Vector< 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 interp_atmos_from_coarse {false}
 
bool do_forest_drag {false}
 Whether forest canopy drag is enabled. More...
 
bool forest_biophysics {false}
 
bool forest_biophysics_heat {false}
 
amrex::Real forest_leaf_theta_fixed {-one}
 
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.
2218  {
2219  for (const auto& type : pert_type) {
2220  if (type == PerturbationType::Source ||
2221  type == PerturbationType::Direct ||
2222  type == PerturbationType::CPM) {
2223  return true;
2224  }
2225  }
2226  return false;
2227  }
amrex::Vector< PerturbationType > pert_type
Turbulent perturbation type for each AMR level.
Definition: ERF_DataStruct.H:2230

◆ 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.
1871  {
1872  amrex::ParmParse pp(pp_prefix);
1873 
1874  // Read the rotational time period (in seconds)
1875  double rot_time_period = 86400.0;
1876  pp.queryAdd("rotational_time_period", rot_time_period);
1877 
1878  coriolis_factor = static_cast<amrex::Real>(4.0 * PI / rot_time_period);
1879 
1880  pp.queryAdd("coriolis_3d", coriolis_3d);
1881 
1882  // Convert to radians
1883  amrex::Real latitude_for_coriolis = amrex::Real(90.0);
1884  pp.queryAdd("latitude", latitude_for_coriolis);
1885  latitude_for_coriolis *= (PI/amrex::Real(180.));
1886  sinphi = std::sin(latitude_for_coriolis);
1887 
1888  // Note: cosphi defaults to 0
1889  if (coriolis_3d) {
1890  cosphi = std::cos(latitude_for_coriolis);
1891  }
1892 
1893  amrex::Print() << "Coriolis frequency, f = " << coriolis_factor * sinphi << " 1/s" << std::endl;
1894 
1895  if (abl_driver_type == ABLDriverType::GeostrophicWind) {
1896  // Read in the geostrophic wind -- we only use this to construct
1897  // the forcing term so no need to keep it
1898  amrex::Vector<amrex::Real> abl_geo_wind(3);
1899  pp.queryarr("abl_geo_wind",abl_geo_wind);
1900 
1901  if(!pp.queryAdd("abl_geo_wind_table",abl_geo_wind_table)) {
1902  abl_geo_forcing = {
1903  -coriolis_factor * (abl_geo_wind[1]*sinphi - abl_geo_wind[2]*cosphi),
1904  coriolis_factor * abl_geo_wind[0]*sinphi,
1905  -coriolis_factor * abl_geo_wind[0]*cosphi
1906  };
1907  } else {
1908  amrex::Print() << "NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
1909  }
1910  }
1911  }
ParmParse pp("prob")
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:39
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:2070
std::string abl_geo_wind_table
Path to a time-varying geostrophic wind table.
Definition: ERF_DataStruct.H:2255
amrex::Real cosphi
Cosine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2071
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Applied geostrophic-wind forcing vector.
Definition: ERF_DataStruct.H:2254
ABLDriverType abl_driver_type
Atmospheric boundary-layer driver type.
Definition: ERF_DataStruct.H:2252
amrex::Real sinphi
Sine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2072
bool coriolis_3d
Whether the three-dimensional Coriolis terms are included.
Definition: ERF_DataStruct.H:2027

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.
1603  {
1604 #if 0
1605  // Warn for PBL models and moisture - these may not yet be compatible
1606  for (int lev = 0; lev <= max_level; lev++) {
1607  if ((moisture_type != MoistureType::None) && (turbChoice[lev].pbl_type != PBLType::None)) {
1608  amrex::Warning("\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
1609  }
1610  }
1611 #endif
1612  //
1613  // Buoyancy type check
1614  //
1615  for (int lev = 0; lev <= max_level; lev++) {
1616  if (buoyancy_type[lev] != 1 && buoyancy_type[lev] != 2 && buoyancy_type[lev] != 3 && buoyancy_type[lev] != 4) {
1617  amrex::Error("buoyancy_type must be 1, 2, 3 or 4");
1618  }
1619  }
1620 
1621  if (!use_lagged_delta_rt && !(terrain_type == TerrainType::MovingFittedMesh)) {
1622  amrex::Error("Can't turn off lagged_delta_rt when terrain not moving");
1623  }
1624 
1625  //
1626  // Wind farm checks
1627  //
1628  if (windfarm_type==WindFarmType::SimpleAD and sampling_distance_by_D < zero) {
1629  amrex::Error("To use simplified actuator disks, you need to provide a variable"
1630  " erf.sampling_distance_by_D in the inputs which specifies the upstream"
1631  " distance as a factor of the turbine diameter at which the incoming free stream"
1632  " velocity will be computed at.");
1633  }
1634  if ( (windfarm_type==WindFarmType::SimpleAD ||
1635  windfarm_type==WindFarmType::GeneralAD ) && turb_disk_angle < zero) {
1636  amrex::Error("To use simplified actuator disks, you need to provide a variable"
1637  " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
1638  " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
1639  " will have turb_disk_angle value of 90 deg.");
1640  }
1641  if (windfarm_loc_type == WindFarmLocType::lat_lon and (windfarm_x_shift < zero or windfarm_y_shift < zero)) {
1642  amrex::Error("You are using windfarms with latitude-logitude option to position the turbines."
1643  " For this you should provide the inputs erf.windfarm_x_shift and"
1644  " erf.windfarm_y_shift which are the values by which the bounding box of the"
1645  " windfarm is shifted from the x and the y axes.");
1646  }
1647 
1648 
1649  if ( (const_massflux_u != 0) && !(geom_vect[0].isPeriodic(0)) ) {
1650  amrex::Error("Constant mass flux (in x) should be used with periodic boundaries");
1651  }
1652 
1653  if ( (const_massflux_v != 0) && !(geom_vect[0].isPeriodic(1)) ) {
1654  amrex::Error("Constant mass flux (in y) should be used with periodic boundaries");
1655  }
1656 
1657  // Mesoscale diffusion -- test if LES appropriate with this dx,dy
1658  for (int lev = 0; lev <= max_level; lev++) {
1659  if ((geom_vect[lev].CellSize(0) > amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) > amrex::Real(2000.)))
1660  {
1661  if ( (turbChoice[lev].les_type == LESType::Smagorinsky) && !turbChoice[lev].smag2d ) {
1662  amrex::Warning("Should use 2-D Smagorinsky for mesoscale resolution");
1663  } else if (turbChoice[lev].les_type == LESType::Deardorff) {
1664  amrex::Warning("Should not use Deardorff LES for mesoscale resolution");
1665  }
1666  }
1667  }
1668 
1669  // Turn off implicit solve if we have no diffusion
1670  bool l_use_kturb = turbChoice[0].use_kturb;
1671  for (int lev = 1; lev <= max_level; lev++) {
1672  l_use_kturb = (l_use_kturb || turbChoice[lev].use_kturb);
1673  }
1674  bool l_use_diff = ( (diffChoice.molec_diff_type != MolecDiffType::None) || l_use_kturb );
1675 
1676  for (int lev = 0; lev <= max_level; lev++) {
1677  bool l_implicit_diff = (vert_implicit_fac[lev][0] > zero ||
1678  vert_implicit_fac[lev][1] > zero ||
1679  vert_implicit_fac[lev][2] > zero);
1680  if (l_implicit_diff && !l_use_diff) {
1681  amrex:: Print() << "No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
1682  vert_implicit_fac[lev][0] = zero;
1683  vert_implicit_fac[lev][1] = zero;
1684  vert_implicit_fac[lev][2] = zero;
1685  }
1686  }
1687 
1688  // Countergradient validation: ensure required implicit diffusion is enabled
1689  for (int lev = 0; lev <= max_level; lev++) {
1690  if (turbChoice[lev].enable_mrf_countergradient) {
1692  vert_implicit_fac[lev][0] > zero ||
1693  vert_implicit_fac[lev][1] > zero ||
1694  vert_implicit_fac[lev][2] > zero,
1695  "enable_mrf_countergradient requires vert_implicit_fac > 0");
1698  "enable_mrf_countergradient requires implicit_thermal_diffusion = true");
1699  if (moisture_type != MoistureType::None) {
1702  "enable_mrf_countergradient with moisture requires implicit_moisture_diffusion = true");
1703  }
1704  }
1705  }
1706 
1707  for (int lev = 0; lev <= max_level; lev++) {
1708  turbChoice[lev].check_params(phys_bc_type);
1709  }
1710  }
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:29
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:2239
amrex::Real const_massflux_v
Target constant mass flux in the y direction.
Definition: ERF_DataStruct.H:2305
amrex::Vector< TurbChoice > turbChoice
Turbulence options for each AMR level.
Definition: ERF_DataStruct.H:1974
bool implicit_moisture_diffusion
Whether implicit vertical moisture diffusion is included.
Definition: ERF_DataStruct.H:2003
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:2237
amrex::Vector< int > buoyancy_type
Per-level buoyancy formulation selector.
Definition: ERF_DataStruct.H:1985
amrex::Real const_massflux_u
Target constant mass flux in the x direction.
Definition: ERF_DataStruct.H:2304
amrex::Real sampling_distance_by_D
Turbine inflow sampling distance normalized by rotor diameter.
Definition: ERF_DataStruct.H:2269
amrex::Real windfarm_y_shift
Wind-farm y-coordinate shift.
Definition: ERF_DataStruct.H:2272
bool implicit_thermal_diffusion
Whether implicit vertical thermal diffusion is included.
Definition: ERF_DataStruct.H:2002
amrex::Real turb_disk_angle
Turbine disk angle from the x axis [deg].
Definition: ERF_DataStruct.H:2270
amrex::Real windfarm_x_shift
Wind-farm x-coordinate shift.
Definition: ERF_DataStruct.H:2271
bool use_lagged_delta_rt
Whether to use lagged delta terms for moving terrain.
Definition: ERF_DataStruct.H:2054
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Per-level, per-stage implicit vertical diffusion factors.
Definition: ERF_DataStruct.H:1999
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:1949
DiffChoice diffChoice
Diffusion-related options.
Definition: ERF_DataStruct.H:1971
WindFarmType windfarm_type
Wind-farm model.
Definition: ERF_DataStruct.H:2238
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.
1718  {
1719  amrex::Print() << "SOLVER CHOICE: " << std::endl;
1720  for (int lev = 0; lev <= max_level; lev++) {
1721  amrex::Print() << "At level " << lev << " : " << std::endl;
1722  if (anelastic[lev]) {
1723  amrex::Print() << " anelastic with no substepping, using the "
1724  << ((anelastic_type[lev] == AnelasticType::MidPoint) ? "MidPoint" : "RK2")
1725  << " integrator" << std::endl;
1726  } else {
1727  if (substepping_type[lev] == SubsteppingType::None) {
1728  amrex::Print() << " compressible with no substepping" << std::endl;
1729  } else if (substepping_type[lev] == SubsteppingType::Implicit) {
1730  amrex::Print() << " compressible with implicit substepping" << std::endl;
1731  }
1732  }
1733  if (fixed_density[lev]) {
1734  amrex::Print() << " and fixed density" << std::endl;
1735  }
1736  }
1737 
1738  for (int lev = 0; lev <= max_level; lev++) {
1739  amrex::Print() << "vert_implicit_fac at level " << lev << " : "
1740  << vert_implicit_fac[lev][0] << " "
1741  << vert_implicit_fac[lev][1] << " "
1742  << vert_implicit_fac[lev][2];
1743  if (vert_implicit_fac[lev][0] > zero ||
1744  vert_implicit_fac[lev][1] > zero ||
1745  vert_implicit_fac[lev][2] > zero)
1746  {
1747  amrex::Print() << " (theta = " << implicit_thermal_diffusion
1748  << ", moisture = " << implicit_moisture_diffusion
1749  << ", tke = " << implicit_ke_diffusion
1750  << ", momenta = " << implicit_momentum_diffusion;
1751 #ifdef ERF_IMPLICIT_W
1752  amrex::Print() << ", including w";
1753 #endif
1754  amrex::Print() << ")";
1755  }
1756  }
1757  amrex::Print() << std::endl;
1758  amrex::Print() << "use_coriolis : " << use_coriolis << std::endl;
1759  amrex::Print() << "use_gravity : " << use_gravity << std::endl;
1760 
1761  if (moisture_type == MoistureType::SAM) {
1762  amrex::Print() << "Moisture Model: SAM" << std::endl;
1763  } else if (moisture_type == MoistureType::SAM_NoIce) {
1764  amrex::Print() << "Moisture Model: SAM No Ice" << std::endl;
1765  } else if (moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
1766  amrex::Print() << "Moisture Model: SAM No Precip No Ice" << std::endl;
1767  } else if (moisture_type == MoistureType::Morrison) {
1768  amrex::Print() << "Moisture Model: Morrison" << std::endl;
1769  } else if (moisture_type == MoistureType::Morrison_NoIce) {
1770  amrex::Print() << "Moisture Model: Morrison_NoIce" << std::endl;
1771  } else if (moisture_type == MoistureType::WSM6) {
1772  amrex::Print() << "Moisture Model: WSM6" << std::endl;
1773  } else if (moisture_type == MoistureType::WDM6) {
1774  amrex::Print() << "Moisture Model: WDM6" << std::endl;
1775  } else if (moisture_type == MoistureType::Kessler) {
1776  amrex::Print() << "Moisture Model: Kessler" << std::endl;
1777  } else if (moisture_type == MoistureType::Kessler_NoRain) {
1778  amrex::Print() << "Moisture Model: Kessler No Rain" << std::endl;
1779  } else if (moisture_type == MoistureType::SatAdj) {
1780  amrex::Print() << "Moisture Model: Saturation Adjustment" << std::endl;
1781  } else if (moisture_type == MoistureType::SuperDroplets) {
1782  amrex::Print() << "Moisture Model: SuperDroplets" << std::endl;
1783  } else if (moisture_type == MoistureType::MoistNoCondensation) {
1784  amrex::Print() << "Moisture Model: MoistNoCondensation" << std::endl;
1785  } else {
1786  amrex::Print() << "Moisture Model: None" << std::endl;
1787  }
1788 
1789  if (terrain_type == TerrainType::StaticFittedMesh) {
1790  amrex::Print() << "Terrain Type: StaticFittedMesh" << std::endl;
1791  } else if (terrain_type == TerrainType::MovingFittedMesh) {
1792  amrex::Print() << "Terrain Type: MovingFittedMesh" << std::endl;
1793  } else if (terrain_type == TerrainType::EB) {
1794  amrex::Print() << "Terrain Type: EB" << std::endl;
1795  ebChoice.display();
1796  } else if (terrain_type == TerrainType::ImmersedForcing) {
1797  amrex::Print() << "Terrain Type: ImmersedForcing" << std::endl;
1798  } else {
1799  amrex::Print() << "Terrain Type: None" << std::endl;
1800  }
1801 
1802  if (buildings_type == BuildingsType::ImmersedForcing) {
1803  amrex::Print() << "Buildings Type: ImmersedForcing" << std::endl;
1804  } else {
1805  amrex::Print() << "Buildings Type: None" << std::endl;
1806  }
1807 
1808  if (mesh_type == MeshType::ConstantDz) {
1809  amrex::Print() << " Mesh Type: ConstantDz" << std::endl;
1810  } else if (mesh_type == MeshType::StretchedDz) {
1811  amrex::Print() << " Mesh Type: StretchedDz" << std::endl;
1812  } else if (mesh_type == MeshType::VariableDz) {
1813  amrex::Print() << " Mesh Type: VariableDz" << std::endl;
1814  } else {
1815  amrex::Error("No mesh_type set!");
1816  }
1817 
1818  amrex::Print() << "ABL Driver Type: " << std::endl;
1819  if (abl_driver_type == ABLDriverType::None) {
1820  amrex::Print() << " None" << std::endl;
1821  } else if (abl_driver_type == ABLDriverType::PressureGradient) {
1822  amrex::Print() << " Pressure Gradient "
1823  << amrex::RealVect(abl_pressure_grad[0],abl_pressure_grad[1],abl_pressure_grad[2])
1824  << std::endl;
1825  } else if (abl_driver_type == ABLDriverType::GeostrophicWind) {
1826  amrex::Print() << " Geostrophic Wind "
1827  << amrex::RealVect(abl_geo_forcing[0],abl_geo_forcing[1],abl_geo_forcing[2])
1828  << std::endl;
1829  }
1830 
1831  if (max_level > 0) {
1832  amrex::Print() << "Coupling Type: " << std::endl;
1833  if (coupling_type == CouplingType::TwoWay) {
1834  amrex::Print() << " Two-way" << std::endl;
1835  } else if (coupling_type == CouplingType::OneWay) {
1836  amrex::Print() << " One-way" << std::endl;
1837  }
1838  }
1839 
1840  if (rad_type == RadiationType::RRTMGP) {
1841  amrex::Print() << "Radiation Model: RRTMGP" << std::endl;
1842  } else if (rad_type == RadiationType::Simple) {
1843  amrex::Print() << "Radiation Model: Simple" << std::endl;
1844  } else if (rad_type == RadiationType::TwoStream) {
1845  amrex::Print() << "Radiation Model: TwoStream" << std::endl;
1846  } else {
1847  amrex::Print() << "Radiation Model: None" << std::endl;
1848  }
1849 
1850  amrex::Print() << "Gradp_type : " << gradp_type << std::endl;
1851 
1852  for (int lev = 0; lev <= max_level; lev++) {
1853  amrex::Print() << "Buoyancy_type at level " << lev << " : " << buoyancy_type[lev] << std::endl;
1854  }
1855 
1856  advChoice.display(pp_prefix);
1857  diffChoice.display();
1860 
1861  for (int lev = 0; lev <= max_level; lev++) {
1862  turbChoice[lev].display(lev);
1863  }
1864  }
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:1983
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:2236
EBChoice ebChoice
Embedded-boundary options.
Definition: ERF_DataStruct.H:1975
bool implicit_ke_diffusion
Whether implicit vertical TKE diffusion is included.
Definition: ERF_DataStruct.H:2004
bool use_gravity
Whether gravitational forcing is enabled.
Definition: ERF_DataStruct.H:2025
amrex::Vector< SubsteppingType > substepping_type
Acoustic substepping type for each AMR level.
Definition: ERF_DataStruct.H:1980
bool use_coriolis
Whether Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2026
static MeshType mesh_type
Vertical mesh representation.
Definition: ERF_DataStruct.H:1958
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:1970
SpongeChoice spongeChoice
Sponge-layer options.
Definition: ERF_DataStruct.H:1973
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Applied ABL pressure-gradient forcing vector.
Definition: ERF_DataStruct.H:2253
amrex::Vector< int > anelastic
Per-level flag selecting anelastic dynamics.
Definition: ERF_DataStruct.H:1981
int gradp_type
Terrain-fitted horizontal pressure-gradient formulation.
Definition: ERF_DataStruct.H:2020
DampingChoice dampingChoice
Damping-related options.
Definition: ERF_DataStruct.H:1972
amrex::Vector< AnelasticType > anelastic_type
Per-level two-stage scheme used by the anelastic integrator.
Definition: ERF_DataStruct.H:1982
static BuildingsType buildings_type
Building representation.
Definition: ERF_DataStruct.H:1952
RadiationType rad_type
Radiation model.
Definition: ERF_DataStruct.H:2241
bool implicit_momentum_diffusion
Whether implicit vertical momentum diffusion is included.
Definition: ERF_DataStruct.H:2005
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.
2187  {
2188  if (use_eamxx_shoc) { return false; }
2189  if (!use_native_shoc) { return true; }
2191  }
bool shoc_disables_momentum_transport(ShocMomentumTransport mode)
Definition: ERF_ShocTransportStruct.H:47
bool use_native_shoc
Whether any level uses the native SHOC PBL scheme.
Definition: ERF_DataStruct.H:2109
ShocMomentumTransport shoc_momentum_transport
Definition: ERF_DataStruct.H:2113
bool use_eamxx_shoc
Whether any level uses the EAMxx SHOC PBL scheme.
Definition: ERF_DataStruct.H:2108

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.
2198  {
2199  if (use_eamxx_shoc) { return false; }
2200  if (!use_native_shoc) { return true; }
2201  return false;
2202  }

Referenced by init_params().

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.
670  {
671  amrex::ParmParse pp(pp_prefix);
672 
673  bool bogus_bool;
674  if (pp.query("use_terrain",bogus_bool) > 0) {
675  amrex::Error("The input use_terrain is deprecated. Set terrain_type instead.");
676  }
677 
678  if (pp.query("use_moist_background",bogus_bool) > 0) {
679  amrex::Error("The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
680  }
681 
682  // Do we set map scale factors to myhalf instead of 1 for testing?
683  pp.queryAdd("test_mapfactor", test_mapfactor);
684 
685  // Which horizontal pressure gradient formulation to use with terrain fitted coords?
686  // 0: dp/dx with dp/dz correction (default)
687  // 1: gradient of vertically interpolated p, see Klemp 2011
688  pp.queryAdd("gradp_type", gradp_type);
690 
691  // For the lateral pressure gradient to be used in the momentum equation, should we
692  // take the x- and y-derivatives of the perturbational pressure or the full pressure?
693  pp.queryAdd("use_pert_pres_gradient", use_pert_pres_gradient);
694 
695  // What type of moisture model to use?
696  moisture_type = MoistureType::None; // Default
697  if (pp.query("moisture_type",moisture_type) > 0) {
698  amrex::Error("The input moisture_type is deprecated. Set moisture_model instead.");
699  }
700 
701  pp.query_enum_case_insensitive("moisture_model",moisture_type);
702 
703  // Register the moisture data this scheme carries: conserved-state
704  // components and qmoist diagnostic slots alike. MoistureComponentIndices
705  // is the one place that mapping lives, and every consumer -- source terms,
706  // turbulence closures, and the plotfile/subvolume writers -- queries it
707  // instead of testing moisture_type.
709 
710  // Set a default for both dry and moist
711  buoyancy_type.resize(max_level+1);
712  for (int i = 0; i <= max_level; ++i) {
713  buoyancy_type[i] = 1; // uses Rhoprime
714  }
715 
716  if (moisture_type != MoistureType::None) {
717  pp.queryAdd("moisture_tight_coupling",moisture_tight_coupling);
718  }
719 
720  // Which expression (1,2/3 or 4) to use for buoyancy
721  int default_buoyancy_type = buoyancy_type[0];
722  read_int_string(max_level, "buoyancy_type", buoyancy_type, default_buoyancy_type);
723 
724  // What type of land surface model to use
725  lsm_type = LandSurfaceType::None; // Default
726  pp.query_enum_case_insensitive("land_surface_model",lsm_type);
727 
728  // Will an external ocean coupler supply SST for part or all of the water
729  // cells this run? The surface layer needs to know this it in time to select
730  // ThetaCalcType::SURFACE_TEMPERATURE, which is long before the first
731  // ApplyOceanSurfaceState call.
732  pp.queryAdd("use_coupled_sst", use_coupled_sst);
733 
734  read_int_string(max_level, "is_land", is_land, 1);
735  for (int lev = 0; lev <= max_level; ++lev) {
736  if (is_land[lev] == 1) {
737  amrex::Print() << "Level " << lev << " is land" << std::endl;
738  } else if (is_land[lev] == 0) {
739  amrex::Print() << "Level " << lev << " is water" << std::endl;
740  } else {
741  amrex::Error("is_land should be 0 or 1");
742  }
743  }
744 
745  // What type of radiation model to use
746  rad_type = RadiationType::None; // Default
747  pp.query_enum_case_insensitive("radiation_model", rad_type);
748 
749  // Verify that radiation model cannot be RRTMGP if ERF was not compiled with RRTMGP
750 #ifndef ERF_USE_RRTMGP
751  if (rad_type == RadiationType::RRTMGP)
752  {
753  amrex::Error("ERF was not compiled with RRTMGP enabled!");
754  }
755 #endif
756 
757  // Is the terrain none, static or moving?
758  std::string terrain_type_temp = "";
759  pp.queryAdd("terrain_type", terrain_type_temp);
760  if (terrain_type_temp == "Moving") {
761  amrex::Warning("erf.terrain_type = Moving is deprecated; please replace Moving by MovingFittedMesh");
762  terrain_type = TerrainType::MovingFittedMesh;
763  } else if (terrain_type_temp == "Static") {
764  amrex::Warning("erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
765  terrain_type = TerrainType::StaticFittedMesh;
766  } else {
767  pp.query_enum_case_insensitive("terrain_type",terrain_type);
768  }
769 
770  // Get buildings type
771  std::string buildings_type_temp = "";
772  pp.queryAdd("buildings_type", buildings_type_temp);
773  if (buildings_type_temp == "ImmersedForcing") {
774  buildings_type = BuildingsType::ImmersedForcing;
775  }
776 
777  //
778  // Read the init_type here to make sure we correctly set the mesh and terrain types
779  //
780  std::string init_type_temp_string;
781 
782  int found = pp.queryAdd("init_type",init_type_temp_string);
783 
784  if ( (init_type_temp_string == "Real") || (init_type_temp_string == "real") ) {
785  amrex::Error("erf.init_type = Real is deprecated; please replace Real by WRFInput");
786  } else if ( (init_type_temp_string == "Ideal") || (init_type_temp_string == "ideal") ) {
787  amrex::Error("erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
788  } else {
789  pp.query_enum_case_insensitive("init_type",init_type);
790  use_real_bcs = ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) );
791  }
792 
793  if ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) {
794  if (terrain_type != TerrainType::StaticFittedMesh) {
795  amrex::Error("Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
796  }
797  }
798 
799  if (init_type == InitType::MoistBaseState) {
800  if (moisture_type == MoistureType::None) {
801  amrex::Error("Makes no sense to have moist base state with no moisture model");
802  }
803  }
804 
805  if (init_type == InitType::WRFInput) {
806  if (moisture_type == MoistureType::None) {
807  amrex::Error("Can't have moisture_type = None with init_type = WRFInput");
808  }
809 
810  // NetCDF wrfbdy lateral boundary file
811  std::string nc_bdy_file_temp_string;
812  bool has_bdy = pp.queryAdd("nc_bdy_file", nc_bdy_file_temp_string);
813  if (!has_bdy) use_real_bcs = false;
814 
815  bool use_real_bcs_temp = use_real_bcs;
816  pp.queryAdd("use_real_bcs", use_real_bcs_temp);
817  if (use_real_bcs && !use_real_bcs_temp) {
818  use_real_bcs = false;
819  }
820  }
821 
822  if (found == 0 || init_type == InitType::None) {
823  amrex::Print() << "init_type must now be set. The options are " << std::endl;
824  amrex::Print() << " Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
825  amrex::Print() << " ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
826  amrex::Error("Please add a string for init_type to your inputs file or command line");
827  }
828 
829  // How to interpret input_sounding
830  if (init_type == InitType::Input_Sounding) {
831  pp.query_enum_case_insensitive("sounding_type",sounding_type);
832  }
833 
834  if (terrain_type == TerrainType::StaticFittedMesh ||
835  terrain_type == TerrainType::MovingFittedMesh) {
836  mesh_type = MeshType::VariableDz;
837  }
838 
839  if ( (moisture_type == MoistureType::SAM ||
840  moisture_type == MoistureType::SAM_NoIce ||
841  moisture_type == MoistureType::SAM_NoPrecip_NoIce ) &&
842  (mesh_type == MeshType::VariableDz) )
843  {
844  amrex::Abort("SAM is not correct with variable dz -- choose another moisture model");
845  }
846 
847  pp.queryAdd("grid_stretching_ratio", grid_stretching_ratio);
848  if (grid_stretching_ratio != 0) {
850  "The grid stretching ratio must be greater than 1");
851  }
852  if (grid_stretching_ratio >= 1) {
853  if (terrain_type == TerrainType::None) {
854  terrain_type = TerrainType::StaticFittedMesh;
855  }
856  if (mesh_type == MeshType::ConstantDz) {
857  mesh_type = MeshType::StretchedDz;
858  }
859  pp.queryAdd("zsurface", zsurf);
860  if (zsurf != zero) {
861  amrex::Print() << "Nominal zsurface height != 0, may result in unexpected behavior"
862  << std::endl;
863  }
864  pp.get("initial_dz", dz0);
865  }
866 
867  int n_zlevels = pp.countval("terrain_z_levels");
868  if (n_zlevels > 0)
869  {
870  if (terrain_type == TerrainType::None) {
871  terrain_type = TerrainType::StaticFittedMesh;
872  }
873  if (mesh_type == MeshType::ConstantDz) {
874  mesh_type = MeshType::StretchedDz;
875  }
876  }
877 
878  // Use lagged_delta_rt in the fast integrator?
879  pp.queryAdd("use_lagged_delta_rt", use_lagged_delta_rt);
880 
881  // Average the input z-face heights onto the nodes, or reconstruct our own
882  pp.queryAdd("avg_grid_faces_to_nodes",avg_grid_faces_to_nodes);
883 
884  // Catch the old name for the flag above so the error says what to do
885  // rather than silently ignoring the setting.
886  if (pp.contains("use_wrf_height_grid")) {
887  amrex::Abort("erf.use_wrf_height_grid has been renamed. "
888  "Set erf.avg_grid_faces_to_nodes instead; it carries "
889  "the same meaning (average the input z-face heights "
890  "onto the nodes rather than reconstructing them).");
891  }
892 
893  // Interpolate atmospheric state from coarse level instead of reading from wrfinput
894  // when creating a finer level from coarse at a later time?
895  pp.queryAdd("interp_atmos_from_coarse", interp_atmos_from_coarse);
896 
897  // Rebalance wrf state?
898  pp.queryAdd("rebalance_wrf_input", rebalance_wrf_input);
899 
900  // Must rebalance if the nodal heights were reconstructed rather than averaged
902  amrex::Print() << "Must rebalance when not averaging the input height grid. Setting rebalance_wrf_input to true \n";
903  rebalance_wrf_input = true;
904  }
905 
906  // These default to true but are used for unit testing
907  pp.queryAdd("use_gravity", use_gravity);
908 
909  // Initializing from Metgrid or WRFInput without gravity makes no sense
910  if ( !use_gravity && ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) ) {
911  amrex::Print() << "Setting use_gravity to true due to init_type = WRFInput / Metgrid " << std::endl;
912  use_gravity = true;
913  }
914 
916 
917  pp.queryAdd("c_p", c_p);
918  rdOcp = R_d / c_p;
919 
920  // *******************************************************************************
921  // Read anelastic etc and over-ride if necessary
922  // *******************************************************************************
923 
924  read_int_string(max_level, "anelastic", anelastic, 0);
925  read_int_string(max_level, "fixed_density", fixed_density, 0);
926  read_int_string(max_level, "project_initial_velocity", project_initial_velocity, 0);
927 
928  bool any_anelastic = false;
929  bool any_compress = false;
930  for (int i = 0; i <= max_level; ++i) {
931  if (anelastic[i] == 1) {
933  fixed_density[i] = 1; // We default to true but are allowed to override below
934  buoyancy_type[i] = 3; // (This isn't actually used when anelastic is set)
935  any_anelastic = true;
936  } else {
937  any_compress = true;
938  }
939  }
940 
942  amrex::Error("erf.moisture_model = SuperDroplets is not supported with "
943  "erf.anelastic = 1: the Super-Droplet path currently uses "
944  "the compressible equation of state. Use compressible "
945  "dynamics or a supported Eulerian moisture model.");
946  }
947 
948  // Want to have different immersed forcing defaults depending on anelastic or fully compressible.
949  // We should have different starting values because the stability of the method is dependent on dt.
950  // dt is coarser for anelastic --> need to loosen stiffness of immersed forcing.
951  if (any_anelastic) {
952  immersed_forcing_substep = false;
953  if_Cd_momentum = amrex::Real(50.0);
954  if_Cd_scalar = amrex::Real(5.0);
955  } else {
957  if_Cd_momentum = amrex::Real(500.0);
958  if_Cd_scalar = amrex::Real(50.0);
959  }
960 
961  // *******************************************************************************
962  // Read anelastic_type and allow for different values at each level
963  // *******************************************************************************
964  anelastic_type.resize(max_level+1);
965 
966  for (int i = 0; i <= max_level; i++) {
967  anelastic_type[i] = AnelasticType::RK2;
968  }
969 
970  for (int i = 0; i <= max_level; i++) {
972  pp, "anelastic_type", anelastic_type[i], i, max_level);
973  }
974 
975  if (pp.contains("anelastic_type") && !any_anelastic) {
976  amrex::Print() << "Ignoring erf.anelastic_type because no level is anelastic" << std::endl;
977  for (int i = 0; i <= max_level; i++) { anelastic_type[i] = AnelasticType::RK2; }
978  }
979 
980  // *******************************************************************************
981  // Read substepping_type and allow for different values at each level
982  // *******************************************************************************
983  substepping_type.resize(max_level+1);
984 
985  for (int i = 0; i <= max_level; i++) {
986  substepping_type[i] = SubsteppingType::Implicit;
987  }
988 
989  for (int i = 0; i <= max_level; i++) {
991  pp, "substepping_type", substepping_type[i], i, max_level);
992  }
993 
994  pp.queryAdd("substepping_diag", substepping_diag);
995 
996  pp.queryAdd("beta_s", beta_s);
997 
998  // *******************************************************************************
999  // Error check on deprecated input
1000  // *******************************************************************************
1001  int nvals_old = pp.countval("no_substepping");
1002  if (nvals_old > 0) {
1003  amrex::Error("The no_substepping flag is deprecated -- set substepping_type instead");
1004  }
1005 
1006  pp.queryAdd("ncorr", ncorr);
1007  // Wall distance on a terrain-fitted mesh (RANS): "poisson" (Tucker 2003
1008  // differential-equation distance) or "terrain_height" (height above the
1009  // local surface projected on its normal, no linear solve)
1010  pp.queryAdd("wall_dist_type", wall_dist_type);
1011  if (wall_dist_type != "poisson" && wall_dist_type != "terrain_height") {
1012  amrex::Error("erf.wall_dist_type must be poisson or terrain_height");
1013  }
1014  pp.queryAdd("poisson_abstol", poisson_abstol);
1015  pp.queryAdd("poisson_reltol", poisson_reltol);
1016 #ifdef AMREX_USE_FLOAT
1017  poisson_abstol = amrex::max(poisson_abstol,amrex::Real(1e-6));
1018  poisson_reltol = amrex::max(poisson_reltol,amrex::Real(1e-6));
1019 #endif
1020  for (int lev = 0; lev <= max_level; lev++) {
1021  if (anelastic[lev] != 0)
1022  {
1023  substepping_type[lev] = SubsteppingType::None;
1024  }
1025  }
1026 
1027  pp.queryAdd("force_stage1_single_substep", force_stage1_single_substep);
1028 
1029  // Include Coriolis forcing?
1030  pp.queryAdd("use_coriolis", use_coriolis);
1031  pp.queryAdd("variable_coriolis", variable_coriolis);
1032 
1033  // Include four stream radiation approximation
1034  pp.queryAdd("four_stream_radiation", four_stream_radiation);
1035 
1036  // flags for whether to apply other source terms in substep only
1037  pp.queryAdd("immersed_forcing_substep", immersed_forcing_substep); // apply immersed forcing source terms in substep only
1038  pp.queryAdd("forest_substep", forest_substep); // apply canopy-related source terms in substep only
1039 
1040  // Fixed-leaf-temperature canopy heat exchange
1041  pp.query("forest_biophysics", forest_biophysics);
1042  pp.query("forest_biophysics_heat", forest_biophysics_heat);
1043  pp.query("forest_leaf_theta_fixed", forest_leaf_theta_fixed);
1044 
1047  "forest_biophysics_heat requires forest_biophysics = true");
1051  "forest_biophysics_heat requires a positive forest_leaf_theta_fixed");
1054  "forest_leaf_theta_fixed requires forest_biophysics_heat = true");
1055 
1056  // immersed forcing parameters
1057  pp.queryAdd("if_Cd_momentum", if_Cd_momentum);
1058  pp.queryAdd("if_Cd_scalar", if_Cd_scalar);
1059  pp.queryAdd("if_implicit_drag", if_implicit_drag); // flag for implicit vs. explicit drag formulation
1060  pp.queryAdd("if_z0", if_z0);
1061  pp.queryAdd("if_surf_temp_flux", if_surf_temp_flux);
1062  pp.queryAdd("if_init_surf_temp", if_init_surf_temp);
1063 
1064  pp.queryAdd("if_surf_heating_rate", if_surf_heating_rate);
1065 
1066  // Modify rate to be in units of K / s rather than K / hr
1067  if_surf_heating_rate /= amrex::Real(3600.0); // [K/s]
1068 
1069  pp.queryAdd("if_Olen", if_Olen_in);
1070  pp.queryAdd("if_use_most",if_use_most);
1071  pp.queryAdd("if_snap_partial_cells",if_snap_partial_cells);
1072  // The snapped staircase puts full-strength forcing on every wall face,
1073  // whose explicit relaxation rate (Cd / dx per substep) sits at the
1074  // stability limit and fails where faces stack at rims and corners; the
1075  // point-implicit form holds at any rate, so the snap uses it.
1077  amrex::Print() << "erf.if_snap_partial_cells: using the point-implicit drag (erf.if_implicit_drag = true)\n";
1078  if_implicit_drag = true;
1079  }
1080  pp.queryAdd("if_stability_correction",if_stability_correction);
1081  pp.queryAdd("if_ws_floor",if_ws_floor);
1082  pp.queryAdd("if_damp_alpha",if_damp_alpha);
1083 
1084  if ((if_init_surf_temp > zero && if_surf_temp_flux != amrex::Real(1e-8)) ||
1085  (if_init_surf_temp > zero && if_Olen_in != amrex::Real(1e-8)) ||
1086  (if_Olen_in != amrex::Real(1e-8) && if_surf_temp_flux != amrex::Real(1e-8)))
1087  {
1088  amrex::Error("Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
1089  }
1090 
1091  // Flag to do MOST rotations with terrain
1092  pp.queryAdd("use_rotate_surface_flux",use_rotate_surface_flux);
1094  AMREX_ASSERT_WITH_MESSAGE(terrain_type != TerrainType::None,"MOST stress rotations are only valid with terrain!");
1095  }
1096 
1097  // Which external forcings?
1098  abl_driver_type = ABLDriverType::None; // Default: no ABL driver for simulating classical fluid dynamics problems
1099  pp.query_enum_case_insensitive("abl_driver_type",abl_driver_type);
1100  pp.queryAdd("const_massflux_u", const_massflux_u);
1101  pp.queryAdd("const_massflux_v", const_massflux_v);
1102  pp.queryAdd("const_massflux_tau", const_massflux_tau);
1103  pp.queryAdd("const_massflux_layer_lo", const_massflux_layer_lo);
1104  pp.queryAdd("const_massflux_layer_hi", const_massflux_layer_hi);
1105 
1106  // Which type of inflow turbulent generation
1107  pert_type.resize(max_level+1);
1108  for (int lev = 0; lev <= max_level; ++lev) {
1109  pert_type[lev] = PerturbationType::None; // Default
1111  pp, "perturbation_type", pert_type[lev], lev, max_level);
1112  }
1113 
1114  amrex::Vector<amrex::Real> abl_pressure_grad_in = {zero, zero, zero};
1115  pp.queryarr("abl_pressure_grad",abl_pressure_grad_in);
1116  for(int i = 0; i < AMREX_SPACEDIM; ++i) abl_pressure_grad[i] = abl_pressure_grad_in[i];
1117 
1118  amrex::Vector<amrex::Real> abl_geo_forcing_in = {zero, zero, zero};
1119  if(pp.queryarr("abl_geo_forcing",abl_geo_forcing_in)) {
1120  amrex::Print() << "Specified abl_geo_forcing: (";
1121  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
1122  abl_geo_forcing[i] = abl_geo_forcing_in[i];
1123  amrex::Print() << abl_geo_forcing[i] << " ";
1124  }
1125  amrex::Print() << ")" << std::endl;
1126  }
1127 
1128  if (use_coriolis)
1129  {
1131  }
1132 
1133  pp.queryAdd("add_custom_rhotheta_forcing", custom_rhotheta_forcing);
1134  pp.queryAdd("add_custom_moisture_forcing", custom_moisture_forcing);
1135  pp.queryAdd("add_custom_w_subsidence", custom_w_subsidence);
1136  pp.queryAdd("add_do_theta_advection", do_theta_advection); // If true, apply custom subsidence to (rho*theta) when add_custom_w_subsidence is used
1137  pp.queryAdd("add_do_mom_advection", do_mom_advection); // If true, apply custom subsidence to momentum when add_custom_w_subsidence is used
1138  pp.queryAdd("add_custom_geostrophic_profile", custom_geostrophic_profile);
1139  pp.queryAdd("custom_forcing_uses_primitive_vars", custom_forcing_prim_vars);
1140  pp.queryAdd("spatial_rhotheta_forcing", spatial_rhotheta_forcing);
1141  pp.queryAdd("spatial_moisture_forcing", spatial_moisture_forcing);
1142 
1143  pp.queryAdd("nudging_from_input_sounding", nudging_from_input_sounding);
1144 
1145  int nudging_u_z1_set = pp.queryAdd("nudging_u_z1", nudging_u_z1);
1146  int nudging_u_z2_set = pp.queryAdd("nudging_u_z2", nudging_u_z2);
1147  pp.queryAdd("nudging_t_z1", nudging_t_z1);
1148  pp.queryAdd("nudging_t_z2", nudging_t_z2);
1149  pp.queryAdd("nudging_q_z1", nudging_q_z1);
1150  pp.queryAdd("nudging_q_z2", nudging_q_z2);
1151 
1153  "nudging_u_z1 must be less than or equal to nudging_u_z2");
1155  "nudging_t_z1 must be less than or equal to nudging_t_z2");
1157  "nudging_q_z1 must be less than or equal to nudging_q_z2");
1158 
1159  pp.queryAdd("nudging_u", nudging_u);
1160  pp.queryAdd("nudging_t", nudging_t);
1161  pp.queryAdd("nudging_q", nudging_q);
1162 
1163  pp.queryAdd("large_scale_forcing", large_scale_forcing);
1164 
1166  if (!nudging_u) {
1167  amrex::Print() << "WARNING: erf.nudging_u = false has no effect when erf.large_scale_forcing "
1168  "= true; momentum nudging is then controlled solely by large_scale_forcing.\n";
1169  }
1170  if (nudging_u_z1_set || nudging_u_z2_set) {
1171  amrex::Print() << "WARNING: erf.nudging_u_z1/erf.nudging_u_z2 are ignored when "
1172  "erf.large_scale_forcing = true; momentum nudging is then applied "
1173  "at all heights.\n";
1174  }
1175  }
1176 
1179  "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
1180 
1181  pp.queryAdd("Ave_Plane", ave_plane);
1182 
1183  // Use numerical diffusion?
1184  pp.queryAdd("num_diff_coeff",num_diff_coeff);
1186  "Numerical diffusion coefficient must be between 0 & one");
1187  use_num_diff = (num_diff_coeff > 0);
1188  if (use_num_diff) {
1189  amrex::Print() << "6th-order numerical diffusion turned on with coefficient = "
1190  << num_diff_coeff << std::endl;
1191  num_diff_coeff *= amrex::Math::powi<-6>(two);
1192  }
1193 
1194  advChoice.init_params(pp_prefix);
1195  diffChoice.init_params(pp_prefix);
1196  dampingChoice.init_params(pp_prefix);
1197  spongeChoice.init_params(pp_prefix);
1198  ebChoice.init_params(pp_prefix);
1199 
1200  turbChoice.resize(max_level+1);
1201  for (int lev = 0; lev <= max_level; lev++) {
1202  turbChoice[lev].init_params(lev,max_level,pp_prefix);
1203  }
1204 
1205  // erf.radiation_model = TwoStream selects the two-stream model; its
1206  // erf.radiation.* sub-options are read only then.
1207  radChoice.init_params(rad_type == RadiationType::TwoStream, max_level, pp_prefix);
1208 
1209  vert_implicit_fac.resize(max_level+1);
1210  for (int lev = 0; lev <= max_level; lev++) {
1211  vert_implicit_fac[lev].resize(3);
1212  vert_implicit_fac[lev][0] = one;
1213  vert_implicit_fac[lev][1] = one;
1214  vert_implicit_fac[lev][2] = zero;
1215  }
1216 
1217  // YSU PBL: use consistent coriolis frequency
1218  for (int lev = 0; lev <= max_level; lev++) {
1219  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1220  if (use_coriolis) {
1221  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
1222  if (lev == 0) {
1223  amrex::Print() << "YSU PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1224  }
1225  } else {
1226  amrex::Error("YSU cannot use ERF coriolis frequency if not using coriolis");
1227  }
1228  }
1229  }
1230  // MRF
1231  for (int lev = 0; lev <= max_level; lev++) {
1232  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1233  if (use_coriolis) {
1234  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
1235  if (lev == 0) {
1236  amrex::Print() << "MRF PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1237  }
1238  } else {
1239  amrex::Error("MRF cannot use ERF coriolis frequency if not using coriolis");
1240  }
1241  }
1242  }
1243 
1244  // What's the strength of the bdy nudging?
1245  pp.queryAdd("bdy_nudge_factor",bdy_nudge_factor);
1246 
1247  // Optionally use the dry-air density reconstructed from wrfbdy.
1248  pp.queryAdd("use_wrf_bdy_density", use_wrf_bdy_density);
1249 
1250  // Optionally ingest cloud water and cloud ice from wrfinput/wrfbdy.
1251  pp.queryAdd("use_wrf_bdy_qc_qi", use_wrf_bdy_qc_qi);
1252 
1253  if (!use_real_bcs || init_type != InitType::WRFInput) {
1254  use_wrf_bdy_density = false;
1255  }
1256 
1257  pp.queryAdd("bdy_rho_nudge_factor", bdy_rho_nudge_factor);
1258 
1259  // Which approach to nudging the moist variables in the boundary region?
1260  pp.queryAdd("bdy_moist_nudge_type",bdy_moist_nudge_type);
1261  if (bdy_moist_nudge_type < 0 || bdy_moist_nudge_type > 3) {
1262  amrex::Error("erf.bdy_moist_nudge_type must be one of 0, 1, 2, or 3");
1263  }
1264  if (bdy_moist_nudge_type == 3 && !use_wrf_bdy_qc_qi) {
1265  amrex::Error("erf.bdy_moist_nudge_type = 3 requires erf.use_wrf_bdy_qc_qi = true");
1266  }
1267  if (use_wrf_bdy_qc_qi) {
1268  if (moisture_type == MoistureType::None) {
1269  amrex::Error("erf.use_wrf_bdy_qc_qi requires an active moisture model");
1270  }
1271  if (!use_real_bcs || init_type != InitType::WRFInput) {
1272  amrex::Error("erf.use_wrf_bdy_qc_qi requires WRFInput real boundary conditions");
1273  }
1276  amrex::Error("erf.use_wrf_bdy_qc_qi requires active qv and qc component indices");
1277  }
1278  const int optional_moisture_comps[] = {moisture_indices.qi,
1282  for (const int comp : optional_moisture_comps) {
1283  if (comp != -1 && (comp < RhoQ1_comp || comp > RhoQ11_comp)) {
1284  amrex::Error("erf.use_wrf_bdy_qc_qi found an invalid active moisture component index");
1285  }
1286  }
1287  }
1288 
1289  // Are me transporting the scalar component?
1290  pp.queryAdd("transport_scalar",transport_scalar);
1291 
1292  for (int lev = 0; lev <= max_level; ++lev) {
1293  if (turbChoice[lev].uses_eamxx_shoc()) {
1294  use_eamxx_shoc = true;
1295  }
1296  if (turbChoice[lev].uses_native_shoc()) {
1297  use_native_shoc = true;
1299  }
1300  }
1301 
1302  // Set up the vertical implicit diffusion solve
1303  int n_impfac = pp.countval("vert_implicit_fac");
1304  AMREX_ALWAYS_ASSERT(n_impfac == 0 || n_impfac == 1 || n_impfac==3);
1305  if (n_impfac == 1) {
1306  amrex::Real fac_in;
1307  pp.get("vert_implicit_fac", fac_in);
1308  for (int lev = 0; lev <= max_level; lev++) {
1309  for (int i=0; i<3; ++i) {
1310  vert_implicit_fac[lev][i] = fac_in;
1311  }
1312  }
1313  } else if (n_impfac == 3) {
1314  for (int lev = 0; lev <= max_level; lev++) {
1315  pp.getarr("vert_implicit_fac", vert_implicit_fac[lev]);
1316  }
1317  }
1318 
1319  // Record whether the user explicitly requested these
1320  const bool user_set_imp_thermal = pp.contains("implicit_thermal_diffusion");
1321  const bool user_set_imp_moisture = pp.contains("implicit_moisture_diffusion");
1322  const bool user_set_imp_ke = pp.contains("implicit_ke_diffusion");
1323  const bool user_set_imp_momentum = pp.contains("implicit_momentum_diffusion");
1324 
1325  // If true (default), include implicit contributions to vertical thermal diffusion
1326  pp.queryAdd("implicit_thermal_diffusion", implicit_thermal_diffusion);
1327 
1328  // If true (default), include implicit contributions to vertical moisture diffusion
1329  pp.queryAdd("implicit_moisture_diffusion", implicit_moisture_diffusion);
1330 
1331  // If true (default), include implicit contributions to vertical KE diffusion
1332  pp.queryAdd("implicit_ke_diffusion", implicit_ke_diffusion);
1333 
1334  // If true (default), include implicit contributions in tau13, tau23,
1335  pp.queryAdd("implicit_momentum_diffusion", implicit_momentum_diffusion);
1336 
1337  // The default is true (i.e. that it happens before the acoustic substepping).
1338  pp.queryAdd("implicit_before_substep", implicit_before_substep);
1339  for (int lev = 0; lev <= max_level; lev++) {
1340  if ( (substepping_type[lev] == SubsteppingType::None) && !implicit_before_substep) {
1341  amrex::Print() << "implicit_before_substep cannot be false without substepping; setting to true." << "\n";
1342  implicit_before_substep = true;
1343  }
1344  }
1345 
1346  // Handle shoc case -- SHOC owns whatever vertical diffusion the host does not
1347  if (uses_shoc_family()) {
1348  const bool host_owns_scalars = host_owns_vertical_scalar_diffusion();
1349  const bool host_owns_momentum = host_owns_vertical_momentum_diffusion();
1350  if (!host_owns_scalars &&
1351  ( (user_set_imp_thermal && implicit_thermal_diffusion ) ||
1352  (user_set_imp_moisture && implicit_moisture_diffusion) ||
1353  (user_set_imp_ke && implicit_ke_diffusion ) ) ) {
1354  amrex::Print() << "Ignoring erf.implicit_{thermal,moisture,ke}_diffusion = true; "
1355  << "SHOC owns vertical scalar diffusion." << "\n";
1356  }
1357  if (!host_owns_momentum && user_set_imp_momentum && implicit_momentum_diffusion) {
1358  amrex::Print() << "Ignoring erf.implicit_momentum_diffusion = true; "
1359  << "SHOC owns vertical momentum diffusion." << "\n";
1360  }
1361 
1362  implicit_thermal_diffusion = (implicit_thermal_diffusion && host_owns_scalars);
1364  implicit_ke_diffusion = (implicit_ke_diffusion && host_owns_scalars);
1365  implicit_momentum_diffusion = (implicit_momentum_diffusion && host_owns_momentum);
1366 
1367  // Make the resulting configuration visible in the run log
1368  if (!host_owns_scalars && !host_owns_momentum) {
1369  amrex::Print() << "Turning off vertical implicit solve for all components since SHOC owns diffusion." << "\n";
1370  } else {
1371  amrex::Print() << "SHOC hands vertical diffusion of"
1372  << (host_owns_scalars ? " scalars" : "")
1373  << (host_owns_momentum ? " momentum" : "")
1374  << " to the host; keeping the vertical implicit solve on (theta = "
1376  << ", moisture = " << implicit_moisture_diffusion
1377  << ", tke = " << implicit_ke_diffusion
1378  << ", momenta = " << implicit_momentum_diffusion << ")." << "\n";
1379  }
1380  } // uses_shoc_family
1381 
1382  // Do not allow implicit vertical diff if user turns it off
1383  bool do_vert_implicit = true;
1384  pp.queryAdd("vert_implicit", do_vert_implicit);
1385  if (!do_vert_implicit) {
1386  for (int lev = 0; lev <= max_level; lev++) {
1387  amrex::Print() << "Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
1388  vert_implicit_fac[lev][0] = zero;
1389  vert_implicit_fac[lev][1] = zero;
1390  vert_implicit_fac[lev][2] = zero;
1391  }
1392  }
1393 
1394  // The implicit vertical diffusion is only second order in an anelastic run when
1395  // the two stages are the midpoint method and the solve is done in the first stage
1396  // alone: S^* = S^n + (dt/2) F(S^*) and S^{n+1} = S^n + dt F(S^*) give
1397  // S^* = (S^n + S^{n+1})/2, i.e. the implicit midpoint rule. Solving again in the
1398  // second stage would reduce the pair to backward Euler, and with the RK2 (Heun)
1399  // stages there is no stage that plays the role of the midpoint at all.
1400  for (int lev = 0; lev <= max_level; lev++) {
1401  if (anelastic[lev]) {
1402  if (anelastic_type[lev] == AnelasticType::RK2) {
1403  amrex::Print() << "Turning off native vertical implicit solve flag because anelastic at level " << lev
1404  << " with RK2 scheme." << std::endl;
1405  vert_implicit_fac[lev][0] = zero;
1406  vert_implicit_fac[lev][1] = zero;
1407  vert_implicit_fac[lev][2] = zero;
1408  } else if (anelastic_type[lev] == AnelasticType::MidPoint) {
1409  if (do_vert_implicit && vert_implicit_fac[lev][0] != one) {
1410  amrex::Print() << "Forcing implicit factor 1 in first stage of MidPoint to ensure second-order accuracy." << std::endl;
1411  vert_implicit_fac[lev][0] = one;
1412  }
1413  if (vert_implicit_fac[lev][1] > zero) {
1414  amrex::Print() << "Turning off the second-stage vertical implicit solve at level " << lev
1415  << " because anelastic with MidPoint solves in the first stage only."
1416  << std::endl;
1417  }
1418  // The anelastic integrator only takes two stages, so [2] is never used
1419  vert_implicit_fac[lev][1] = zero;
1420  vert_implicit_fac[lev][2] = zero;
1421  }
1422  }
1423  }
1424 
1425  // Do not allow implicit vertical diff with EB
1426  if (terrain_type == TerrainType::EB) {
1427  for (int lev = 0; lev <= max_level; lev++) {
1428  if (do_vert_implicit) {
1429  amrex::Print() << "Implicit diffusion is not supported with EB; turning off at level " << lev << "\n";
1430  vert_implicit_fac[lev][0] = zero;
1431  vert_implicit_fac[lev][1] = zero;
1432  vert_implicit_fac[lev][2] = zero;
1433  }
1434  }
1435  }
1436 
1437  // The EB diffusion path adds no buoyancy, shear or dissipation source for
1438  // a prognostic TKE closure
1439  if (terrain_type == TerrainType::EB) {
1440  for (int lev = 0; lev <= max_level; lev++) {
1441  if (turbChoice[lev].use_keqn) {
1442  amrex::Error("erf.terrain_type = EB cannot be used with erf.les_type = Deardorff "
1443  "or erf.rans_type = kEqn: the EB diffusion path has no TKE sources");
1444  }
1445  }
1446  }
1447 
1448  // Do not allow implicit vertical diff when all the components are false
1453  amrex::Print() << "Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
1454  for (int lev = 0; lev <= max_level; lev++) {
1455  vert_implicit_fac[lev][0] = zero;
1456  vert_implicit_fac[lev][1] = zero;
1457  vert_implicit_fac[lev][2] = zero;
1458  }
1459  }
1460 
1461  // Which type of multilevel coupling
1462  coupling_type = CouplingType::TwoWay; // Default
1463  pp.query_enum_case_insensitive("coupling_type",coupling_type);
1464 
1465  // Test for hybrid (compressible + anelastic) -- in this case we must use one-way coupling
1466  if (any_anelastic && any_compress) {
1467  coupling_type = CouplingType::OneWay;
1468  }
1469 
1470  // Which type of windfarm model
1471  windfarm_type = WindFarmType::None; // Default
1472  pp.query_enum_case_insensitive("windfarm_type",windfarm_type);
1473 
1474  windfarm_loc_type = WindFarmLocType::None;
1475  pp.query_enum_case_insensitive("windfarm_loc_type",windfarm_loc_type);
1476 
1477  pp.queryAdd("windfarm_loc_table", windfarm_loc_table);
1478  pp.queryAdd("windfarm_spec_table", windfarm_spec_table);
1479  pp.queryAdd("windfarm_blade_table", windfarm_blade_table);
1480  pp.queryAdd("windfarm_airfoil_tables", windfarm_airfoil_tables);
1481  pp.queryAdd("windfarm_spec_table_extra", windfarm_spec_table_extra);
1482 
1483  // Sampling distance upstream of the turbine to find the
1484  // incoming free stream velocity as a factor of the diameter of the
1485  // turbine. ie. the sampling distance will be this number multiplied
1486  // by the diameter of the turbine
1487  pp.queryAdd("sampling_distance_by_D", sampling_distance_by_D);
1488  pp.queryAdd("turb_disk_angle_from_x", turb_disk_angle);
1489 
1490  pp.queryAdd("windfarm_x_shift",windfarm_x_shift);
1491  pp.queryAdd("windfarm_y_shift",windfarm_y_shift);
1492  // Test if time averaged data is to be output
1493  pp.queryAdd("time_avg_vel",time_avg_vel);
1494 
1495  // Interval means and resolved turbulent moments for plotfile output
1496  pp.queryAdd("compute_mean_vars", compute_mean_vars);
1497  pp.queryAdd("mean_vars_reset_mode", mean_vars_reset_mode);
1498  pp.queryAdd("mean_vars_reset_time", mean_vars_reset_time);
1499 
1500  if (compute_mean_vars &&
1501  mean_vars_reset_mode != "plotfile" && mean_vars_reset_mode != "time") {
1502  amrex::Error("erf.mean_vars_reset_mode must be either 'plotfile' or 'time'");
1503  }
1504  if (compute_mean_vars && mean_vars_reset_mode == "time" &&
1506  amrex::Error("erf.mean_vars_reset_time must be non-negative when "
1507  "erf.mean_vars_reset_mode = 'time'");
1508  }
1509 
1510  pp.queryAdd("hindcast_lateral_forcing", hindcast_lateral_forcing);
1511 
1513  pp.queryAdd("hindcast_boundary_data_dir", hindcast_boundary_data_dir);
1514 
1515  if(hindcast_boundary_data_dir.empty()) {
1516  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
1517  }
1518  pp.queryAdd("hindcast_data_interval_in_hrs", hindcast_data_interval_in_hrs);
1520  amrex::Error("ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
1521  "data files is either missing or set to less than zero");
1522  }
1523  pp.queryAdd("hindcast_lateral_sponge_strength", hindcast_lateral_sponge_strength);
1524  pp.queryAdd("hindcast_lateral_sponge_length", hindcast_lateral_sponge_length);
1525 
1526  pp.queryAdd("hindcast_zhi_sponge_length", hindcast_zhi_sponge_length);
1527  pp.queryAdd("hindcast_zhi_sponge_strength", hindcast_zhi_sponge_strength);
1528 
1529  pp.queryAdd("hindcast_zhi_sponge_damping", hindcast_zhi_sponge_damping);
1530 
1532  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
1533  }
1534 
1536  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
1537  }
1538 
1540  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_length' or it is specified to be less than zero");
1541  }
1542 
1544  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
1545  }
1546  }
1547 
1548  pp.queryAdd("hindcast_surface_bcs", hindcast_surface_bcs);
1549  if(hindcast_surface_bcs) {
1550  pp.queryAdd("hindcast_surface_data_dir", hindcast_surface_data_dir);
1551  }
1552 
1553  pp.queryAdd("io_hurricane_eye_tracker", io_hurricane_eye_tracker);
1555  pp.queryAdd("hurricane_eye_latitude", hurricane_eye_latitude);
1556  pp.queryAdd("hurricane_eye_longitude", hurricane_eye_longitude);
1558  amrex::Error("ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
1559  " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
1560  " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
1561  " location of the eye in the initial condition");
1562  }
1563  }
1564 
1565  pp.queryAdd("is_init_for_ensemble", is_init_for_ensemble);
1566  if(is_init_for_ensemble) {
1567  amrex::ParmParse pp_ens("ensemble");
1568  pp_ens.queryAdd("n_members", n_ensemble);
1569  if(n_ensemble < 2) {
1570  amrex::Abort("You are using an ensemble run. There needs to be at least 2 ensemble members. "
1571  "erf.n_ensemble must be >=2.");
1572  }
1573  pp_ens.queryAdd("coarse_bckgnd_data_file", coarse_bckgnd_data_file);
1574  if (coarse_bckgnd_data_file.empty()) {
1575  amrex::Abort("coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
1576  "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
1577  "which contains the filename in the inputs.");
1578  }
1579  pp_ens.queryAdd("ens_pert_amplitude", ens_pert_amplitude);
1580  if(ens_pert_amplitude <= 0.0) {
1581  amrex::Error("You are using initialization for ensemble simulations using the inputs option "
1582  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1583  "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
1584  "to be added to the background state and has to be greater than 0.0");
1585  }
1586  pp_ens.queryAdd("ens_pert_correlated_radius", ens_pert_correlated_radius);
1587  if(ens_pert_correlated_radius <= 0.0) {
1588  amrex::Error("You are using initialization with spatially correlated perturbations using the inputs option "
1589  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1590  "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
1591  "and has to be greater than 0.0");
1592  }
1593  }
1594  }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:56
constexpr amrex::Real R_d
Definition: ERF_Constants.H:34
bool anelastic_superdroplets_configuration_invalid(const MoistureType moisture_type, const bool any_anelastic) noexcept
Whether an anelastic SuperDroplets configuration is unsupported.
Definition: ERF_DataStruct.H:132
#define RhoQ11_comp
Definition: ERF_IndexDefines.H:55
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:31
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:30
void read_shoc_transport_modes(ShocTransportMode &transport_mode, ShocMomentumTransport &momentum_transport)
Read the native SHOC transport modes from the erf.shoc input namespace.
Definition: ERF_ShocTransportStruct.H:118
int query_one_or_per_level_enum_case_insensitive(const amrex::ParmParse &pp, const char *query_string, T &query_var, const int lev, const int maxlev)
Query a scalar or per-level enum input value using case-insensitive matching.
Definition: ERF_TurbStruct.H:81
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:238
int qr
rain
Definition: ERF_DataStruct.H:237
int qi
cloud ice
Definition: ERF_DataStruct.H:236
int qv
water vapor
Definition: ERF_DataStruct.H:234
int qc
cloud liquid water
Definition: ERF_DataStruct.H:235
int qg
graupel
Definition: ERF_DataStruct.H:239
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:323
void init_params(bool two_stream_selected, int max_level, std::string pp_prefix)
Definition: ERF_RadStruct.H:727
bool use_coupled_sst
Definition: ERF_DataStruct.H:2250
bool custom_geostrophic_profile
Whether a custom geostrophic wind profile is used.
Definition: ERF_DataStruct.H:2080
int n_ensemble
Number of ensemble members.
Definition: ERF_DataStruct.H:2324
bool implicit_before_substep
Whether implicit diffusion is applied before acoustic substepping.
Definition: ERF_DataStruct.H:2006
std::string hindcast_boundary_data_dir
Directory containing hindcast lateral boundary data.
Definition: ERF_DataStruct.H:2312
amrex::Real ens_pert_correlated_radius
Spatial correlation radius for ensemble perturbations.
Definition: ERF_DataStruct.H:2325
amrex::Real forest_leaf_theta_fixed
Definition: ERF_DataStruct.H:2301
static InitType init_type
Initial-condition source selected for the run.
Definition: ERF_DataStruct.H:1943
bool io_hurricane_eye_tracker
Whether hurricane-eye tracking output is enabled.
Definition: ERF_DataStruct.H:2320
amrex::Real const_massflux_layer_lo
Lower height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2307
amrex::Real hindcast_zhi_sponge_length
Length of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2317
amrex::Real gravity
Effective gravitational acceleration.
Definition: ERF_DataStruct.H:2060
bool variable_coriolis
Whether spatially varying Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2258
amrex::Real poisson_abstol
Absolute tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2014
amrex::Real if_Cd_momentum
Immersed-forcing drag coefficient for momentum.
Definition: ERF_DataStruct.H:2036
bool nudging_t
Definition: ERF_DataStruct.H:2097
amrex::Real if_Olen_in
Input Obukhov length for immersed-forcing MOST [m].
Definition: ERF_DataStruct.H:2046
bool forest_biophysics
Definition: ERF_DataStruct.H:2299
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Build constant-latitude Coriolis forcing parameters.
Definition: ERF_DataStruct.H:1870
bool use_pert_pres_gradient
Whether momentum equations use perturbational pressure gradients.
Definition: ERF_DataStruct.H:2022
amrex::Vector< int > project_initial_velocity
Per-level flag for projecting the initial velocity.
Definition: ERF_DataStruct.H:1984
int ave_plane
Averaging plane index used by diagnostics.
Definition: ERF_DataStruct.H:2260
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:1920
bool nudging_q
Definition: ERF_DataStruct.H:2098
int ncorr
Number of projection correction iterations.
Definition: ERF_DataStruct.H:2008
bool use_rotate_surface_flux
Whether MOST surface fluxes are rotated with terrain.
Definition: ERF_DataStruct.H:2105
bool moisture_tight_coupling
Whether moisture updates use tight coupling.
Definition: ERF_DataStruct.H:2265
bool compute_mean_vars
Definition: ERF_DataStruct.H:2122
amrex::Real beta_s
Time off-centering coefficient for forward weighting.
Definition: ERF_DataStruct.H:1993
bool interp_atmos_from_coarse
Definition: ERF_DataStruct.H:2293
amrex::Real if_z0
Immersed-forcing roughness length [m].
Definition: ERF_DataStruct.H:2042
bool forest_substep
Whether canopy source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2033
bool use_wrf_bdy_density
Definition: ERF_DataStruct.H:2278
std::string mean_vars_reset_mode
Definition: ERF_DataStruct.H:2125
amrex::Real num_diff_coeff
Numerical diffusion coefficient after input scaling.
Definition: ERF_DataStruct.H:2234
amrex::Real bdy_nudge_factor
Boundary sponge nudging factor.
Definition: ERF_DataStruct.H:2275
amrex::Real rdOcp
Ratio of dry-air gas constant to c_p.
Definition: ERF_DataStruct.H:2062
bool hindcast_lateral_forcing
Whether hindcast lateral forcing is enabled.
Definition: ERF_DataStruct.H:2314
bool do_theta_advection
Whether custom vertical subsidence is applied to rho-theta.
Definition: ERF_DataStruct.H:2078
amrex::Real nudging_q_z2
Definition: ERF_DataStruct.H:2094
static bool use_real_bcs
Whether real-data lateral boundary conditions are used.
Definition: ERF_DataStruct.H:1955
bool spatial_moisture_forcing
Whether spatially varying moisture forcing is enabled.
Definition: ERF_DataStruct.H:2083
amrex::Real nudging_u_z2
Definition: ERF_DataStruct.H:2090
static SoundingType sounding_type
Interpretation used for input sounding profiles.
Definition: ERF_DataStruct.H:1946
int bdy_moist_nudge_type
Moist-variable nudging strategy in boundary regions.
Definition: ERF_DataStruct.H:2287
amrex::Real poisson_reltol
Relative tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2015
bool time_avg_vel
Whether time-averaged velocity fields are output.
Definition: ERF_DataStruct.H:2119
bool have_geo_wind_profile
Whether a geostrophic wind profile has been configured.
Definition: ERF_DataStruct.H:2256
RadChoice radChoice
Definition: ERF_DataStruct.H:1976
bool four_stream_radiation
Whether the four-stream radiation approximation is enabled.
Definition: ERF_DataStruct.H:2029
amrex::Real if_damp_alpha
Immersed-forcing damping coefficient.
Definition: ERF_DataStruct.H:2051
bool rebalance_wrf_input
Whether to rebalance states from wrfinput and wrfbdy data.
Definition: ERF_DataStruct.H:2057
amrex::Real hindcast_data_interval_in_hrs
Time interval between hindcast data files [hr].
Definition: ERF_DataStruct.H:2313
amrex::Real const_massflux_layer_hi
Upper height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2308
std::string wall_dist_type
Definition: ERF_DataStruct.H:2009
bool avg_grid_faces_to_nodes
Definition: ERF_DataStruct.H:2290
std::string windfarm_spec_table_extra
Additional wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2267
amrex::Real if_ws_floor
Wind-speed floor for immersed-forcing MOST [m/s].
Definition: ERF_DataStruct.H:2050
bool is_init_for_ensemble
Whether initialization is for an ensemble simulation.
Definition: ERF_DataStruct.H:2323
bool uses_shoc_family() const noexcept
Query whether any SHOC-family PBL scheme is active.
Definition: ERF_DataStruct.H:2177
bool test_mapfactor
Whether to use test map scale factors.
Definition: ERF_DataStruct.H:2018
amrex::Real nudging_u_z1
Definition: ERF_DataStruct.H:2089
bool if_snap_partial_cells
Definition: ERF_DataStruct.H:2048
std::string coarse_bckgnd_data_file
Coarse background data file used for ensemble initialization.
Definition: ERF_DataStruct.H:2327
amrex::Real dz0
Initial vertical grid spacing for stretched-grid setup.
Definition: ERF_DataStruct.H:2067
amrex::Real ens_pert_amplitude
Amplitude of ensemble initialization perturbations.
Definition: ERF_DataStruct.H:2326
std::string windfarm_airfoil_tables
Wind-farm airfoil table paths.
Definition: ERF_DataStruct.H:2268
amrex::Real bdy_rho_nudge_factor
Definition: ERF_DataStruct.H:2284
amrex::Real nudging_q_z1
Definition: ERF_DataStruct.H:2093
bool transport_scalar
Whether the passive scalar component is transported.
Definition: ERF_DataStruct.H:2116
bool hindcast_zhi_sponge_damping
Whether upper-boundary hindcast sponge damping is enabled.
Definition: ERF_DataStruct.H:2318
amrex::Real hurricane_eye_longitude
Initial hurricane-eye longitude.
Definition: ERF_DataStruct.H:2321
LandSurfaceType lsm_type
Land-surface model.
Definition: ERF_DataStruct.H:2240
bool large_scale_forcing
Definition: ERF_DataStruct.H:2100
bool substepping_diag
Whether to emit extra CFL diagnostics for compressible substepping.
Definition: ERF_DataStruct.H:1989
amrex::Real mean_vars_reset_time
Definition: ERF_DataStruct.H:2126
std::string windfarm_blade_table
Wind-farm blade table path.
Definition: ERF_DataStruct.H:2268
amrex::Vector< int > is_land
Per-level land/water selector.
Definition: ERF_DataStruct.H:1986
amrex::Real hindcast_lateral_sponge_strength
Strength of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2316
bool forest_biophysics_heat
Definition: ERF_DataStruct.H:2300
ShocTransportMode shoc_transport_mode
Definition: ERF_DataStruct.H:2112
amrex::Real hurricane_eye_latitude
Initial hurricane-eye latitude.
Definition: ERF_DataStruct.H:2321
amrex::Real if_Cd_scalar
Immersed-forcing drag coefficient for scalars.
Definition: ERF_DataStruct.H:2037
std::string windfarm_loc_table
Wind-farm location table path.
Definition: ERF_DataStruct.H:2267
std::string hindcast_surface_data_dir
Directory containing hindcast surface boundary data.
Definition: ERF_DataStruct.H:2312
bool custom_rhotheta_forcing
Whether custom rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2075
amrex::Real zsurf
Nominal surface height for stretched-grid setup.
Definition: ERF_DataStruct.H:2066
amrex::Real if_init_surf_temp
Initial immersed-forcing surface temperature [K].
Definition: ERF_DataStruct.H:2044
amrex::Real nudging_t_z2
Definition: ERF_DataStruct.H:2092
std::string windfarm_spec_table
Wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2267
amrex::Real if_surf_temp_flux
Immersed-forcing surface temperature flux [K m/s].
Definition: ERF_DataStruct.H:2043
bool spatial_rhotheta_forcing
Whether spatially varying rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2082
bool custom_w_subsidence
Whether custom vertical subsidence is enabled.
Definition: ERF_DataStruct.H:2077
bool custom_moisture_forcing
Whether custom moisture forcing is enabled.
Definition: ERF_DataStruct.H:2076
amrex::Real if_surf_heating_rate
Immersed-forcing surface heating rate [K/hr].
Definition: ERF_DataStruct.H:2045
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:2263
amrex::Real grid_stretching_ratio
Vertical grid stretching ratio.
Definition: ERF_DataStruct.H:2065
bool hindcast_surface_bcs
Whether hindcast surface boundary conditions are enabled.
Definition: ERF_DataStruct.H:2315
bool host_owns_vertical_scalar_diffusion() const noexcept
Test whether the host owns scalar diffusion.
Definition: ERF_DataStruct.H:2197
bool immersed_forcing_substep
Whether immersed-forcing source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2032
bool if_use_most
Whether immersed-forcing MOST is enabled.
Definition: ERF_DataStruct.H:2047
amrex::Real const_massflux_tau
Relaxation time scale for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2306
amrex::Real hindcast_lateral_sponge_length
Length of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2316
bool host_owns_vertical_momentum_diffusion() const noexcept
Test whether the host owns momentum diffusion.
Definition: ERF_DataStruct.H:2186
amrex::Real hindcast_zhi_sponge_strength
Strength of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2317
int force_stage1_single_substep
Flag forcing a single substep in the first RK stage.
Definition: ERF_DataStruct.H:1978
amrex::Real c_p
Specific heat at constant pressure for dry air [J/(kg-K)].
Definition: ERF_DataStruct.H:2061
bool if_implicit_drag
Definition: ERF_DataStruct.H:2040
bool do_mom_advection
Whether custom vertical subsidence is applied to momentum.
Definition: ERF_DataStruct.H:2079
bool if_stability_correction
Whether immersed-forcing stability corrections are enabled.
Definition: ERF_DataStruct.H:2049
amrex::Real nudging_t_z1
Definition: ERF_DataStruct.H:2091
bool custom_forcing_prim_vars
Whether custom forcing operates on primitive variables.
Definition: ERF_DataStruct.H:2081
bool nudging_u
Definition: ERF_DataStruct.H:2096
bool nudging_from_input_sounding
Whether solution fields are nudged toward input sounding data.
Definition: ERF_DataStruct.H:2087
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:2233
bool use_wrf_bdy_qc_qi
Whether WRF cloud water and active cloud ice are ingested at real boundaries.
Definition: ERF_DataStruct.H:2281
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.
2209  {
2210  return uses_shoc_family();
2211  }
Here is the call graph for this function:

◆ rad_uses_interface()

bool SolverChoice::rad_uses_interface ( ) const
inline

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

2245  {
2246  return (rad_type == RadiationType::RRTMGP) || (rad_type == RadiationType::Simple);
2247  }

◆ 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.
1922  {
1923  amrex::ParmParse pp("erf");
1924  int nvals = pp.countval(string_to_read);
1925  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
1926  amrex::Vector<int> temp; temp.resize(nvals);
1927  pp.queryarr(string_to_read,temp);
1928 
1929  if (vec_to_fill.size() < max_level+1) {
1930  vec_to_fill.resize(max_level+1);
1931  }
1932 
1933  if (nvals == 0) {
1934  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
1935  } else if (nvals == 1) {
1936  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
1937  } else {
1938  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
1939  }
1940  }

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.
1966  {
1967  mesh_type = new_mesh_type;
1968  }

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.
2147  {
2148  return pert_type[lev] == PerturbationType::Direct ||
2149  pert_type[lev] == PerturbationType::CPM ||
2150  pert_type[lev] == PerturbationType::CPM_W;
2151  }

◆ 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.
2134  {
2135  return pert_type[lev] == PerturbationType::Source ||
2136  pert_type[lev] == PerturbationType::Direct ||
2137  pert_type[lev] == PerturbationType::CPM ||
2138  pert_type[lev] == PerturbationType::CPM_W;
2139  }

◆ 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.
2159  {
2160  return pert_type[lev] == PerturbationType::Source;
2161  }

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.
2169  {
2170  return pert_type[lev] == PerturbationType::CPM_W;
2171  }

◆ 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.
2178  {
2179  return (use_eamxx_shoc || use_native_shoc);
2180  }

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

◆ anelastic_type

SolverChoice::anelastic_type

Per-level two-stage scheme used by the anelastic integrator.

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

◆ ave_plane

SolverChoice::ave_plane {2}

Averaging plane index used by diagnostics.

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

◆ avg_grid_faces_to_nodes

bool SolverChoice::avg_grid_faces_to_nodes {false}

Referenced by init_params().

◆ bdy_moist_nudge_type

SolverChoice::bdy_moist_nudge_type = 1

Moist-variable nudging strategy in boundary regions.

Referenced by init_params().

◆ bdy_nudge_factor

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

Boundary sponge nudging factor.

Referenced by init_params().

◆ bdy_rho_nudge_factor

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

Referenced by init_params().

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

SolverChoice::if_snap_partial_cells = false

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

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

◆ if_stability_correction

SolverChoice::if_stability_correction = false

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

◆ interp_atmos_from_coarse

bool SolverChoice::interp_atmos_from_coarse {false}

Referenced by init_params().

◆ io_hurricane_eye_tracker

SolverChoice::io_hurricane_eye_tracker = false

Whether hurricane-eye tracking output is enabled.

Referenced by init_params().

◆ is_init_for_ensemble

SolverChoice::is_init_for_ensemble = false

Whether initialization is for an ensemble simulation.

Referenced by init_params().

◆ is_land

SolverChoice::is_land

Per-level land/water selector.

Referenced by init_params().

◆ large_scale_forcing

bool SolverChoice::large_scale_forcing = false

Referenced by init_params(), and make_mom_sources().

◆ lsf_file

std::string SolverChoice::lsf_file = ""

◆ lsf_timescale

amrex::Real SolverChoice::lsf_timescale = zero

◆ lsm_type

SolverChoice::lsm_type

Land-surface model.

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

◆ rad_type

SolverChoice::rad_type

◆ radChoice

RadChoice SolverChoice::radChoice

Referenced by init_params().

◆ rdOcp

◆ rebalance_wrf_input

SolverChoice::rebalance_wrf_input = true

Whether to rebalance states from wrfinput and wrfbdy data.

Referenced by init_params().

◆ 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

ShocTransportMode SolverChoice::shoc_transport_mode = ShocTransportMode::StateUpdate

◆ sinphi

SolverChoice::sinphi = zero

Sine of the latitude used for Coriolis forcing.

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

◆ sounding_type

SolverChoice::sounding_type = SoundingType::Ideal
inlinestatic

Interpretation used for input sounding profiles.

Referenced by init_params().

◆ spatial_moisture_forcing

SolverChoice::spatial_moisture_forcing = false

Whether spatially varying moisture forcing is enabled.

Referenced by init_params(), and make_sources().

◆ spatial_rhotheta_forcing

SolverChoice::spatial_rhotheta_forcing = false

Whether spatially varying rho-theta forcing is enabled.

Referenced by init_params(), and make_sources().

◆ spongeChoice

SolverChoice::spongeChoice

Sponge-layer options.

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

◆ substepping_diag

SolverChoice::substepping_diag = false

Whether to emit extra CFL diagnostics for compressible substepping.

Referenced by init_params().

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

◆ wall_dist_type

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

Referenced by init_params().

◆ windfarm_airfoil_tables

SolverChoice::windfarm_airfoil_tables

Wind-farm airfoil table paths.

Referenced by init_params().

◆ windfarm_blade_table

SolverChoice::windfarm_blade_table

Wind-farm blade table path.

Referenced by init_params().

◆ windfarm_loc_table

SolverChoice::windfarm_loc_table

Wind-farm location table path.

Referenced by init_params().

◆ windfarm_loc_type

SolverChoice::windfarm_loc_type

Coordinate system for wind-farm turbine locations.

Referenced by check_params(), and init_params().

◆ windfarm_spec_table

SolverChoice::windfarm_spec_table

Wind-farm turbine specification table path.

Referenced by init_params().

◆ windfarm_spec_table_extra

SolverChoice::windfarm_spec_table_extra

Additional wind-farm turbine specification table path.

Referenced by init_params().

◆ windfarm_type

SolverChoice::windfarm_type

Wind-farm model.

Referenced by check_params(), 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: