1 #ifndef ERF_DATA_STRUCT_H_
2 #define ERF_DATA_STRUCT_H_
8 #include <AMReX_ParmParse.H>
9 #include <AMReX_Print.H>
10 #include <AMReX_Gpu.H>
11 #include <AMReX_Geometry.H>
56 None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, ConstantDensity, ConstantDensityLinearTheta,
57 Isentropic, MoistBaseState, HindCast
64 ConstantDensity, Ideal, Isentropic, DryIsentropic
71 None, PressureGradient, GeostrophicWind
104 ConstantDz, StretchedDz, VariableDz
116 gmres_fft, mlmg, gmres_mlmg
123 None, StaticFittedMesh, MovingFittedMesh, EB, ImmersedForcing
130 None, ImmersedForcing
137 Eulerian, Lagrangian, Undefined
144 SAM, SAM_NoIce, SAM_NoPrecip_NoIce,
Kessler, Kessler_NoRain,
SatAdj,
Morrison, Morrison_NoIce,
WSM6,
WDM6, SuperDroplets,
MoistNoCondensation, SBM,
None
154 const MoistureType moisture_type,
155 const bool any_anelastic) noexcept
157 return any_anelastic && moisture_type == MoistureType::SuperDroplets;
192 None, RRTMGP, Simple, TwoStream
334 :
qv(qv_comp),
qc(qc_comp),
qi(qi_comp),
qr(qr_comp),
qs(qs_comp),
qg(qg_comp),
335 nc(nc_comp),
ni(ni_comp),
nr(nr_comp),
ns(ns_comp),
ng(ng_comp),
361 switch (moisture_type) {
367 case MoistureType::MoistNoCondensation:
368 case MoistureType::SAM_NoPrecip_NoIce:
369 case MoistureType::Kessler_NoRain:
376 case MoistureType::SatAdj:
384 case MoistureType::Kessler:
395 case MoistureType::SBM:
403 case MoistureType::SAM_NoIce:
413 case MoistureType::SAM:
414 case MoistureType::WSM6:
429 case MoistureType::Morrison:
449 case MoistureType::Morrison_NoIce:
463 case MoistureType::WDM6:
482 case MoistureType::SuperDroplets:
501 amrex::Abort(
"Unknown MoistureType in MoistureComponentIndices::from_moisture_model");
523 [[nodiscard]]
bool empty ()
const {
return (
size == 0); }
567 return ( (comp >= 0) &&
568 ( (comp ==
qv) || (comp ==
qc) || (comp ==
qi) ||
569 (comp ==
qr) || (comp ==
qs) || (comp ==
qg) ||
570 (comp ==
nc) || (comp ==
ni) || (comp ==
nr) ||
571 (comp ==
ns) || (comp ==
ng) || (comp ==
nn) ) );
605 if (
name ==
"qv") {
return qv; }
606 if (
name ==
"qc") {
return qc; }
607 if (
name ==
"qi") {
return qi; }
608 if (
name ==
"qrain") {
return qr; }
609 if (
name ==
"qsnow") {
return qs; }
610 if (
name ==
"qgraup") {
return qg; }
611 if (
name ==
"nc") {
return nc; }
612 if (
name ==
"ni") {
return ni; }
613 if (
name ==
"nr") {
return nr; }
614 if (
name ==
"ns") {
return ns; }
615 if (
name ==
"ng") {
return ng; }
616 if (
name ==
"nn") {
return nn; }
662 if ( (
name ==
"qv") || (
name ==
"qc") || (
name ==
"qi") ||
663 (
name ==
"qrain") || (
name ==
"qsnow") || (
name ==
"qgraup") ||
670 if ( (
name ==
"rain_accum") || (
name ==
"snow_accum") ||
671 (
name ==
"graupel_accum") || (
name ==
"precip_accum") ||
672 (
name ==
"rel_humidity") ||
673 (
name ==
"condensation_rate") ) {
683 if ( (
name ==
"qn") || (
name ==
"moist_density") ) {
684 return {
true, (
qv >= 0) && (
qc >= 0)};
688 if ( (
name ==
"qsat") || (
name ==
"precipitable") ) {
692 return {
false,
false};
724 amrex::ParmParse
pp(pp_prefix);
727 if (
pp.query(
"use_terrain",bogus_bool) > 0) {
728 amrex::Error(
"The input use_terrain is deprecated. Set terrain_type instead.");
731 if (
pp.query(
"use_moist_background",bogus_bool) > 0) {
732 amrex::Error(
"The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
743 amrex::Abort(
"erf.test_mapfactor and erf.test_mapfactor_amp cannot be used together");
759 amrex::Error(
"The input moisture_type is deprecated. Set moisture_model instead.");
770 amrex::Error(
"SBM test fault-injection options require moisture_model=SBM");
781 if (
pp.contains(
"sbm_zero_transport_fixture")) {
782 bool legacy_zero_transport =
false;
783 pp.get(
"sbm_zero_transport_fixture", legacy_zero_transport);
784 if (legacy_zero_transport) {
785 amrex::Error(
"erf.sbm_zero_transport_fixture=true is obsolete; M3 advances the mapped spectral state, so remove this option");
796 amrex::Error(
"SBM requires sbm_nbins >= 2 and sbm_moment_mode equal to 1 or 2");
808 sbm_pivots[
static_cast<std::size_t
>(b)] = std::sqrt(
813 if (
sbm_nbins < 2) amrex::Error(
"sbm_edges must define at least two bins");
817 sbm_pivots[
static_cast<std::size_t
>(b)] = std::sqrt(
823 amrex::Error(
"sbm_pivots must contain one value per SBM bin");
826 if (sbm_cloud_rain_split <= 0 || sbm_cloud_rain_split >=
sbm_nbins) {
827 amrex::Error(
"sbm_cloud_rain_split must be strictly inside the liquid bin range");
832 amrex::Error(
"sbm_fixture_initial_state must match the full runtime SBM component count");
835 if (!std::isfinite(value) || value <
amrex::Real(0.0)) {
836 amrex::Error(
"sbm_fixture_initial_state values must be finite and nonnegative");
843 for (
int i = 0; i <= max_level; ++i) {
857 pp.query_enum_case_insensitive(
"land_surface_model",
lsm_type);
861 pp.query_enum_case_insensitive(
"urban_model",
urban_type);
863 for (
int lev = 0; lev <= max_level; ++lev) {
865 amrex::Error(
"urban_lev_active should be 0 or 1");
876 for (
int lev = 0; lev <= max_level; ++lev) {
878 amrex::Print() <<
"Level " << lev <<
" is land" << std::endl;
879 }
else if (
is_land[lev] == 0) {
880 amrex::Print() <<
"Level " << lev <<
" is water" << std::endl;
882 amrex::Error(
"is_land should be 0 or 1");
888 pp.query_enum_case_insensitive(
"radiation_model",
rad_type);
891 #ifndef ERF_USE_RRTMGP
892 if (
rad_type == RadiationType::RRTMGP)
894 amrex::Error(
"ERF was not compiled with RRTMGP enabled!");
899 std::string terrain_type_temp =
"";
900 pp.queryAdd(
"terrain_type", terrain_type_temp);
901 if (terrain_type_temp ==
"Moving") {
902 amrex::Error(
"erf.terrain_type = Moving is no longer supported; please replace Moving by MovingFittedMesh");
903 }
else if (terrain_type_temp ==
"Static") {
904 amrex::Error(
"erf.terrain_type = Static is no longer supported; please replace Static by StaticFittedMesh");
913 std::string buildings_type_temp =
"";
914 pp.queryAdd(
"buildings_type", buildings_type_temp);
915 if (buildings_type_temp ==
"ImmersedForcing") {
923 std::string init_type_temp_string;
925 int found =
pp.queryAdd(
"init_type",init_type_temp_string);
927 if ( (init_type_temp_string ==
"Real") || (init_type_temp_string ==
"real") ) {
928 amrex::Error(
"erf.init_type = Real is deprecated; please replace Real by WRFInput");
929 }
else if ( (init_type_temp_string ==
"Ideal") || (init_type_temp_string ==
"ideal") ) {
930 amrex::Error(
"erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
932 pp.query_enum_case_insensitive(
"init_type",
init_type);
938 amrex::Error(
"Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
942 if (
init_type == InitType::MoistBaseState) {
944 amrex::Error(
"Makes no sense to have moist base state with no moisture model");
950 amrex::Error(
"Can't have moisture_type = None with init_type = WRFInput");
954 std::string nc_bdy_file_temp_string;
955 bool has_bdy =
pp.queryAdd(
"nc_bdy_file", nc_bdy_file_temp_string);
959 pp.queryAdd(
"use_real_bcs", use_real_bcs_temp);
966 amrex::Print() <<
"init_type must now be set. The options are " << std::endl;
967 amrex::Print() <<
" Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
968 amrex::Print() <<
" ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
969 amrex::Error(
"Please add a string for init_type to your inputs file or command line");
973 if (
init_type == InitType::Input_Sounding) {
983 amrex::Error(
"erf.flat_terrain requires terrain_type = StaticFittedMesh");
988 if (
terrain_type == TerrainType::MovingFittedMesh && max_level > 0) {
989 amrex::Error(
"erf.terrain_type = MovingFittedMesh requires amr.max_level = 0");
995 amrex::Error(
"erf.buildings_type = ImmersedForcing is not supported with erf.terrain_type = EB");
1003 amrex::Abort(
"SAM is not correct with variable dz -- choose another moisture model");
1007 const bool have_stretching_ratio =
pp.contains(
"grid_stretching_ratio");
1011 "The grid stretching ratio must be greater than 1");
1016 const bool solve_stretching_ratio = !have_stretching_ratio &&
pp.contains(
"initial_dz");
1021 if (
mesh_type == MeshType::ConstantDz) {
1024 pp.get(
"initial_dz",
dz0);
1029 if (
pp.contains(
"zsurface")) {
1030 amrex::Abort(
"erf.zsurface is no longer supported: a stretched vertical grid now starts "
1031 "at geometry.prob_lo[2], so set the bottom of the domain there instead");
1034 int n_zlevels =
pp.countval(
"terrain_z_levels");
1040 if (
mesh_type == MeshType::ConstantDz) {
1057 if (
pp.contains(
"use_wrf_height_grid")) {
1058 amrex::Abort(
"erf.use_wrf_height_grid has been renamed. "
1059 "Set erf.avg_grid_faces_to_nodes instead; it carries "
1060 "the same meaning (average the input z-face heights "
1061 "onto the nodes rather than reconstructing them).");
1073 amrex::Print() <<
"Must rebalance when not averaging the input height grid. Setting rebalance_wrf_input to true \n";
1082 amrex::Print() <<
"Setting use_gravity to true due to init_type = WRFInput / Metgrid " << std::endl;
1088 pp.queryAdd(
"c_p",
c_p);
1096 const bool fixed_density_given =
1103 bool any_anelastic =
false;
1104 bool any_compress =
false;
1105 for (
int i = 0; i <= max_level; ++i) {
1108 amrex::Print() <<
"WARNING: erf.fixed_density = 0 is ignored at level " << i
1109 <<
" because erf.anelastic = 1 there; the anelastic equations"
1110 <<
" always hold the density fixed in time." << std::endl;
1115 any_anelastic =
true;
1117 any_compress =
true;
1122 amrex::Error(
"erf.moisture_model = SuperDroplets is not supported with "
1123 "erf.anelastic = 1: the Super-Droplet path currently uses "
1124 "the compressible equation of state. Use compressible "
1125 "dynamics or a supported Eulerian moisture model.");
1131 if (any_anelastic) {
1146 for (
int i = 0; i <= max_level; i++) {
1150 for (
int i = 0; i <= max_level; i++) {
1155 if (
pp.contains(
"anelastic_type") && !any_anelastic) {
1156 amrex::Print() <<
"Ignoring erf.anelastic_type because no level is anelastic" << std::endl;
1157 for (
int i = 0; i <= max_level; i++) {
anelastic_type[i] = AnelasticType::RK2; }
1165 for (
int i = 0; i <= max_level; i++) {
1169 for (
int i = 0; i <= max_level; i++) {
1181 amrex::Abort(
"erf.beta_d must lie in [0, 1]; got " + std::to_string(
beta_d));
1191 "erf.beta_s_min must be less than or equal to erf.beta_s_max");
1193 "erf.beta_s_min and erf.beta_s_max must lie in [-1, 1]");
1199 int nvals_old =
pp.countval(
"no_substepping");
1200 if (nvals_old > 0) {
1201 amrex::Error(
"The no_substepping flag is deprecated -- set substepping_type instead");
1210 amrex::Error(
"erf.wall_dist_type must be poisson or terrain_height");
1217 if (
pp.contains(
"terrain_poisson_solver") &&
1219 amrex::Print() <<
"WARNING: erf.terrain_poisson_solver is ignored: it applies only to the "
1220 <<
"projection on a terrain-fitted mesh (erf.terrain_type = StaticFittedMesh "
1221 <<
"or MovingFittedMesh)" << std::endl;
1223 #ifdef AMREX_USE_FLOAT
1227 for (
int lev = 0; lev <= max_level; lev++) {
1254 "forest_biophysics_heat requires forest_biophysics = true");
1258 "forest_biophysics_heat requires a positive forest_leaf_theta_fixed");
1261 "forest_leaf_theta_fixed requires forest_biophysics_heat = true");
1289 amrex::Print() <<
"erf.if_snap_partial_cells: using the point-implicit drag (erf.if_implicit_drag = true)\n";
1298 std::string if_wall_form_in =
"legacy";
1299 pp.queryAdd(
"if_wall_form", if_wall_form_in);
1300 if (if_wall_form_in ==
"fraction_stress") {
1302 }
else if (if_wall_form_in !=
"legacy") {
1303 amrex::Abort(
"erf.if_wall_form must be legacy or fraction_stress, not " + if_wall_form_in);
1310 std::string if_wall_face_spacing_in =
"log";
1311 pp.queryAdd(
"if_wall_face_spacing", if_wall_face_spacing_in);
1313 amrex::Abort(
"erf.if_wall_face_spacing belongs to erf.if_wall_form = fraction_stress");
1318 else { amrex::Abort(
"erf.if_wall_face_spacing must be log, physical or grid"); }
1327 amrex::Abort(
"erf.if_wall_tke = true and erf.if_wall_tke_time_factor != 1 belong to erf.if_wall_form = fraction_stress");
1330 amrex::Abort(
"erf.if_wall_tke_time_factor must be >= 1 (steps over which the wall TKE is relaxed)");
1339 amrex::Abort(
"erf.if_flat_wall_dissipation = true belongs to erf.if_wall_form = fraction_stress");
1343 amrex::Abort(
"erf.if_wall_form = fraction_stress needs erf.terrain_type = ImmersedForcing");
1346 amrex::Abort(
"erf.if_wall_form = fraction_stress is not available with erf.buildings_type = ImmersedForcing");
1349 amrex::Abort(
"erf.if_wall_form = fraction_stress is a wall law: it needs erf.if_use_most = true");
1351 if (
mesh_type != MeshType::ConstantDz) {
1352 amrex::Abort(
"erf.if_wall_form = fraction_stress needs a constant-dz mesh");
1357 amrex::Abort(
"erf.if_wall_form = fraction_stress runs with the anelastic model (erf.anelastic = 1 on "
1358 "every level); it does not support erf.immersed_forcing_substep = true");
1365 amrex::Abort(
"erf.if_surf_heating_rate needs erf.if_init_surf_temp");
1368 amrex::Abort(
"erf.if_wall_form = fraction_stress always applies the stability functions; "
1369 "erf.if_stability_correction is for the legacy wall law");
1380 amrex::Abort(
"erf.if_stability_wind_floor must be >= 0 [m/s] (0 leaves the wind as it is)");
1383 amrex::Abort(
"erf.if_psi_cap_factor must be in (0, 1] (1 caps psi at ln(z/z0))");
1389 amrex::Abort(
"erf.if_average_down must be plain or fluid_mass");
1395 amrex::Abort(
"erf.if_average_down = fluid_mass needs erf.terrain_type = ImmersedForcing "
1396 "or erf.buildings_type = ImmersedForcing");
1403 amrex::Abort(
"erf.if_cf_mismatch_warning must be in [0, 1] (a spread of solid fractions; 0 turns it off)");
1413 amrex::Abort(
"erf.cf_loglaw_z0 belongs to erf.cf_loglaw_fill = true");
1416 if (
mesh_type != MeshType::ConstantDz) {
1417 amrex::Abort(
"erf.cf_loglaw_fill needs a constant-dz mesh");
1420 amrex::Abort(
"erf.cf_loglaw_fill is not implemented for erf.terrain_type = EB "
1421 "(its wall is not the bottom of the domain)");
1436 amrex::Abort(
"erf.cf_loglaw_z0 must be > 0 [m] (the roughness length of the log-law coarse/fine fill)");
1442 (if_psi_cap_factor < one || if_stability_wind_floor >
zero))
1444 amrex::Print() <<
"Immersed wall law: erf.if_psi_cap_factor = " <<
if_psi_cap_factor
1446 <<
" m/s (WRF-style bounds; the defaults 1 and 0 turn them off)\n";
1453 amrex::Error(
"Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
1457 amrex::Abort(
"erf.if_Olen = 0 is not an Obukhov length: give a nonzero length [m] (a large |L| is near neutral)");
1465 amrex::ParmParse pp_eb2(
"eb2");
1468 amrex::Abort(
"eb2.small_volfrac must be in [0, 1) with immersed forcing");
1478 const bool if_terrain = (
terrain_type == TerrainType::ImmersedForcing);
1479 const bool if_buildings = (
buildings_type == BuildingsType::ImmersedForcing);
1480 if (!if_terrain && !if_buildings) {
1481 amrex::Abort(
"erf.if_implicit_projection needs erf.terrain_type = ImmersedForcing or "
1482 "erf.buildings_type = ImmersedForcing");
1484 if (if_terrain && if_buildings) {
1485 amrex::Abort(
"erf.if_implicit_projection is not implemented for erf.terrain_type = ImmersedForcing "
1486 "together with erf.buildings_type = ImmersedForcing");
1488 if (
mesh_type != MeshType::ConstantDz) {
1489 amrex::Abort(
"erf.if_implicit_projection needs a constant-dz mesh");
1491 for (
int lev = 0; lev <= max_level; ++lev) {
1493 amrex::Abort(
"erf.if_implicit_projection needs erf.anelastic = 1 on every level");
1497 amrex::Abort(
"erf.if_implicit_projection needs a build with FFT (its GMRES solve is FFT-preconditioned)");
1516 amrex::Abort(
"erf.const_massflux_tau must be > 0 (got " +
1531 amrex::Abort(
"Automatic perturbations require perturbation_auto_period > 0 and "
1532 "0 < perturbation_auto_pbl_fraction <= 1");
1535 for (
int lev = 0; lev <= max_level; ++lev) {
1538 pp,
"perturbation_type",
pert_type[lev], lev, max_level);
1541 amrex::Vector<amrex::Real> abl_pressure_grad_in = {
zero,
zero,
zero};
1542 pp.queryarr(
"abl_pressure_grad",abl_pressure_grad_in);
1543 for(
int i = 0; i < AMREX_SPACEDIM; ++i)
abl_pressure_grad[i] = abl_pressure_grad_in[i];
1545 amrex::Vector<amrex::Real> abl_geo_forcing_in = {
zero,
zero,
zero};
1546 if(
pp.queryarr(
"abl_geo_forcing",abl_geo_forcing_in)) {
1547 amrex::Print() <<
"Specified abl_geo_forcing: (";
1548 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
1552 amrex::Print() <<
")" << std::endl;
1576 amrex::Abort(
"erf.nudging_from_observations does not support erf.terrain_type = EB; "
1577 "use a terrain-fitted mesh or immersed forcing");
1580 int nudging_u_z1_set =
pp.queryAdd(
"nudging_u_z1",
nudging_u_z1);
1581 int nudging_u_z2_set =
pp.queryAdd(
"nudging_u_z2",
nudging_u_z2);
1588 "nudging_u_z1 must be less than or equal to nudging_u_z2");
1590 "nudging_t_z1 must be less than or equal to nudging_t_z2");
1592 "nudging_q_z1 must be less than or equal to nudging_q_z2");
1602 amrex::Print() <<
"WARNING: erf.nudging_u = false has no effect when erf.large_scale_forcing "
1603 "= true; momentum nudging is then controlled solely by large_scale_forcing.\n";
1605 if (nudging_u_z1_set || nudging_u_z2_set) {
1606 amrex::Print() <<
"WARNING: erf.nudging_u_z1/erf.nudging_u_z2 are ignored when "
1607 "erf.large_scale_forcing = true; momentum nudging is then applied "
1608 "at all heights.\n";
1614 "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
1621 "Numerical diffusion coefficient must be between 0 & one");
1624 amrex::Print() <<
"6th-order numerical diffusion turned on with coefficient = "
1636 for (
int lev = 0; lev <= max_level; lev++) {
1637 turbChoice[lev].init_params(lev,max_level,pp_prefix);
1643 for (
int lev = 0; lev <= max_level; ++lev) {
1645 if (lev == 0 || tc.les_type ==
LESType::None || tc.smag2d ||
1655 bool smag2d_requested =
false;
1656 bool smag2d_somewhere =
false;
1657 for (
int lev = 0; lev <= max_level; lev++) {
1658 smag2d_requested = smag2d_requested ||
turbChoice[lev].smag2d_limits_requested;
1659 smag2d_somewhere = smag2d_somewhere ||
turbChoice[lev].smag2d;
1661 if (smag2d_requested && !smag2d_somewhere) {
1662 amrex::Error(
"erf.smag2d_slope_limiter and erf.smag2d_kh_cap apply only to "
1663 "erf.les_type = Smagorinsky2D, which no level uses");
1665 for (
int lev = 0; lev <= max_level; lev++) {
1666 const bool fitted = (
terrain_type == TerrainType::StaticFittedMesh ||
1668 if (
turbChoice[lev].smag2d_slope_limiter && !fitted) {
1669 amrex::Error(
"erf.smag2d_slope_limiter requires erf.terrain_type = StaticFittedMesh "
1670 "or MovingFittedMesh");
1673 amrex::Error(
"erf.smag2d_kh_cap is not supported with erf.terrain_type = EB");
1680 if (
rad_type == RadiationType::RRTMGP) {
1686 "Topographic radiation requires erf.terrain_type = StaticFittedMesh");
1688 "Topographic radiation currently requires erf.radiation_model = RRTMGP");
1699 amrex::Print() <<
"WARNING: erf.land_surface_model = NOAHMP with erf.radiation_model = "
1700 << amrex::getEnumNameString(
rad_type)
1701 <<
": only RRTMGP and TwoStream supply the downwelling shortwave, "
1702 "downwelling longwave and solar zenith angle Noah-MP needs. Noah-MP "
1703 "will run with no radiative forcing (zero SWDOWN, GLW and COSZEN).\n";
1707 for (
int lev = 0; lev <= max_level; lev++) {
1715 for (
int lev = 0; lev <= max_level; lev++) {
1716 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1720 amrex::Print() <<
"YSU PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1723 amrex::Error(
"YSU cannot use ERF coriolis frequency if not using coriolis");
1728 for (
int lev = 0; lev <= max_level; lev++) {
1729 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1733 amrex::Print() <<
"MRF PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1736 amrex::Error(
"MRF cannot use ERF coriolis frequency if not using coriolis");
1758 if (bdy_moist_nudge_type < 0 || bdy_moist_nudge_type > 3) {
1759 amrex::Error(
"erf.bdy_moist_nudge_type must be one of 0, 1, 2, or 3");
1762 amrex::Error(
"erf.bdy_moist_nudge_type = 3 requires erf.use_wrf_bdy_qc_qi = true");
1766 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires an active moisture model");
1769 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires WRFInput real boundary conditions");
1773 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires active qv and qc component indices");
1779 for (
const int comp : optional_moisture_comps) {
1780 if (comp != -1 && (comp < RhoQ1_comp || comp >
RhoQ11_comp)) {
1781 amrex::Error(
"erf.use_wrf_bdy_qc_qi found an invalid active moisture component index");
1789 for (
int lev = 0; lev <= max_level; ++lev) {
1800 int n_impfac =
pp.countval(
"vert_implicit_fac");
1802 if (n_impfac == 1) {
1804 pp.get(
"vert_implicit_fac", fac_in);
1805 for (
int lev = 0; lev <= max_level; lev++) {
1806 for (
int i=0; i<3; ++i) {
1810 }
else if (n_impfac == 3) {
1811 for (
int lev = 0; lev <= max_level; lev++) {
1817 const bool user_set_imp_thermal =
pp.contains(
"implicit_thermal_diffusion");
1818 const bool user_set_imp_moisture =
pp.contains(
"implicit_moisture_diffusion");
1819 const bool user_set_imp_ke =
pp.contains(
"implicit_ke_diffusion");
1820 const bool user_set_imp_momentum =
pp.contains(
"implicit_momentum_diffusion");
1841 for (
int lev = 0; lev <= max_level; lev++) {
1843 amrex::Print() <<
"implicit_before_substep cannot be false without substepping; setting to true." <<
"\n";
1852 if (!host_owns_scalars &&
1856 amrex::Print() <<
"Ignoring erf.implicit_{thermal,moisture,ke}_diffusion = true; "
1857 <<
"SHOC owns vertical scalar diffusion." <<
"\n";
1860 amrex::Print() <<
"Ignoring erf.implicit_momentum_diffusion = true; "
1861 <<
"SHOC owns vertical momentum diffusion." <<
"\n";
1870 if (!host_owns_scalars && !host_owns_momentum) {
1871 amrex::Print() <<
"Turning off vertical implicit solve for all components since SHOC owns diffusion." <<
"\n";
1873 amrex::Print() <<
"SHOC hands vertical diffusion of"
1874 << (host_owns_scalars ?
" scalars" :
"")
1875 << (host_owns_momentum ?
" momentum" :
"")
1876 <<
" to the host; keeping the vertical implicit solve on (theta = "
1885 bool do_vert_implicit =
true;
1886 pp.queryAdd(
"vert_implicit", do_vert_implicit);
1887 if (!do_vert_implicit) {
1888 for (
int lev = 0; lev <= max_level; lev++) {
1889 amrex::Print() <<
"Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
1902 for (
int lev = 0; lev <= max_level; lev++) {
1905 amrex::Print() <<
"Turning off native vertical implicit solve flag because anelastic at level " << lev
1906 <<
" with RK2 scheme." << std::endl;
1912 amrex::Print() <<
"Forcing implicit factor 1 in first stage of MidPoint to ensure second-order accuracy." << std::endl;
1916 amrex::Print() <<
"Turning off the second-stage vertical implicit solve at level " << lev
1917 <<
" because anelastic with MidPoint solves in the first stage only."
1929 for (
int lev = 0; lev <= max_level; lev++) {
1930 if (do_vert_implicit) {
1931 amrex::Print() <<
"Implicit diffusion is not supported with EB; turning off at level " << lev <<
"\n";
1942 for (
int lev = 0; lev <= max_level; lev++) {
1944 amrex::Error(
"erf.terrain_type = EB cannot be used with erf.les_type = Deardorff "
1945 "or erf.rans_type = kEqn: the EB diffusion path has no TKE sources");
1955 amrex::Print() <<
"Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
1956 for (
int lev = 0; lev <= max_level; lev++) {
1968 if (any_anelastic && any_compress) {
2004 amrex::Error(
"erf.mean_vars_reset_mode must be either 'plotfile' or 'time'");
2008 amrex::Error(
"erf.mean_vars_reset_time must be non-negative when "
2009 "erf.mean_vars_reset_mode = 'time'");
2018 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
2022 amrex::Error(
"ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
2023 "data files is either missing or set to less than zero");
2034 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
2038 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
2042 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_length' or it is specified to be less than zero");
2046 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
2060 amrex::Error(
"ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
2061 " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
2062 " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
2063 " location of the eye in the initial condition");
2069 amrex::ParmParse pp_ens(
"ensemble");
2072 amrex::Abort(
"You are using an ensemble run. There needs to be at least 2 ensemble members. "
2073 "erf.n_ensemble must be >=2.");
2077 amrex::Abort(
"coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
2078 "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
2079 "which contains the filename in the inputs.");
2083 amrex::Error(
"You are using initialization for ensemble simulations using the inputs option "
2084 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
2085 "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
2086 "to be added to the background state and has to be greater than 0.0");
2090 amrex::Error(
"You are using initialization with spatially correlated perturbations using the inputs option "
2091 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
2092 "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
2093 "and has to be greater than 0.0");
2104 void check_params (
int max_level,
const amrex::Vector<amrex::Geometry>& geom_vect, amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type)
2108 if (max_level > 0 &&
coupling_type == CouplingType::TwoWay) {
2109 amrex::Print() <<
"Immersed forcing: erf.if_average_down = fluid_mass (the cell average down "
2110 <<
"over refined levels is weighted by the fluid mass of the fine cells)\n";
2112 amrex::Warning(
"erf.if_average_down = fluid_mass has no effect without refined levels "
2113 "(amr.max_level > 0) and erf.coupling_type = TwoWay");
2119 for (
int lev = 0; lev <= max_level; ++lev) {
2122 amrex::Abort(
"erf.if_wall_form = fraction_stress needs erf.if_z0 < dz/4 on every level (level " +
2123 std::to_string(lev) +
": z0 = " + std::to_string(
if_z0) +
" m, dz = " +
2124 std::to_string(
dz) +
" m)");
2129 bool any_keqn =
false;
2130 for (
int lev = 0; lev <= max_level; ++lev) {
2131 any_keqn = any_keqn || (
turbChoice[lev].rans_type == RANSType::kEqn);
2134 amrex::Abort(
"erf.if_wall_tke and erf.if_flat_wall_dissipation act on the k-eqn RANS closure: "
2135 "set erf.rans_type = kEqn on a level, or turn them off (erf.if_flat_wall_dissipation = false)");
2139 amrex::Print() <<
"Immersed forcing: erf.if_wall_form = fraction_stress (wall stress in the wall cell, "
2140 <<
"the wall face closed to diffusion; face spacing "
2147 const bool immersed = (
terrain_type == TerrainType::ImmersedForcing ||
2149 if (!immersed && phys_bc_type[amrex::Orientation(amrex::Direction::z, amrex::Orientation::low)] !=
ERF_BC::surface_layer) {
2150 amrex::Abort(
"erf.cf_loglaw_fill needs an immersed surface (erf.terrain_type or "
2151 "erf.buildings_type = ImmersedForcing) or zlo.type = surface_layer");
2153 if (max_level > 0) {
2154 amrex::Print() <<
"Coarse/fine faces: erf.cf_loglaw_fill = true (the wall coarse face's flux is shared "
2155 <<
"among its fine sub-faces by the integral of ln(1 + z/z0), z0 = " <<
cf_loglaw_z0 <<
" m)\n";
2157 amrex::Warning(
"erf.cf_loglaw_fill has no effect without refined levels (amr.max_level > 0)");
2162 amrex::Abort(
"Automatic perturbations currently support flat, stretched, and fitted-terrain meshes; "
2163 "immersed/embedded terrain requires a ground-relative parent PBL-height conversion");
2167 for (
int lev = 0; lev <= max_level; lev++) {
2169 amrex::Warning(
"\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
2176 for (
int lev = 0; lev <= max_level; lev++) {
2178 amrex::Error(
"buoyancy_type must be 1, 2, 3 or 4");
2183 amrex::Error(
"Can't turn off lagged_delta_rt when terrain not moving");
2190 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
2191 " erf.sampling_distance_by_D in the inputs which specifies the upstream"
2192 " distance as a factor of the turbine diameter at which the incoming free stream"
2193 " velocity will be computed at.");
2197 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
2198 " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
2199 " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
2200 " will have turb_disk_angle value of 90 deg.");
2203 amrex::Error(
"You are using windfarms with latitude-logitude option to position the turbines."
2204 " For this you should provide the inputs erf.windfarm_x_shift and"
2205 " erf.windfarm_y_shift which are the values by which the bounding box of the"
2206 " windfarm is shifted from the x and the y axes.");
2211 amrex::Error(
"Constant mass flux (in x) should be used with periodic boundaries");
2215 amrex::Error(
"Constant mass flux (in y) should be used with periodic boundaries");
2219 for (
int lev = 0; lev <= max_level; lev++) {
2220 if ((geom_vect[lev].CellSize(0) >
amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) >
amrex::Real(2000.)))
2223 amrex::Warning(
"Should use 2-D Smagorinsky for mesoscale resolution");
2224 }
else if (
turbChoice[lev].les_type == LESType::Deardorff) {
2225 amrex::Warning(
"Should not use Deardorff LES for mesoscale resolution");
2232 for (
int lev = 1; lev <= max_level; lev++) {
2233 l_use_kturb = (l_use_kturb ||
turbChoice[lev].use_kturb);
2237 for (
int lev = 0; lev <= max_level; lev++) {
2241 if (l_implicit_diff && !l_use_diff) {
2242 amrex:: Print() <<
"No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
2251 max_level > 0 && l_use_diff) {
2252 amrex::Warning(
"erf.coupling_type = TwoWay with erf.terrain_type = EB does not reflux the "
2253 "diffusive fluxes: diffusion does not conserve the scalars across "
2254 "coarse/fine boundaries");
2261 if (
mesh_type != MeshType::VariableDz) {
2262 amrex::Abort(
"erf.implicit_terrain_metric = true requires a terrain-fitted mesh with "
2263 "non-flat terrain (erf.terrain_type = StaticFittedMesh or MovingFittedMesh); "
2264 "on a flat or a purely stretched mesh there are no terrain-metric terms");
2271 for (
int lev = 0; lev <= max_level; lev++) {
2272 for (
int i = 0; i < 3; ++i) {
2274 amrex::Abort(
"erf.implicit_terrain_metric = true needs the vertical implicit solve "
2275 "in every Runge-Kutta stage at every level, but erf.vert_implicit_fac "
2276 "is not positive in stage " + std::to_string(i+1) +
" at level " +
2277 std::to_string(lev) +
". Set erf.vert_implicit_fac = 1 1 1; the "
2278 "option cannot be used where the implicit solve is turned off "
2279 "(erf.vert_implicit = false, every erf.implicit_*_diffusion = false, "
2280 "no molecular or turbulent diffusion, or anelastic, which solves in "
2281 "its first stage only or not at all)");
2288 amrex::Print() <<
"WARNING: erf.implicit_terrain_metric = true with "
2289 <<
"erf.implicit_momentum_diffusion = false: the momentum terrain-metric "
2290 <<
"terms stay explicit; only the scalars are treated implicitly" << std::endl;
2292 }
else if (
mesh_type == MeshType::VariableDz) {
2297 bool explicit_stage_with_kh =
false;
2298 for (
int lev = 0; lev <= max_level; lev++) {
2300 for (
int i = 0; i < 3; ++i) {
2304 if (explicit_stage_with_kh) {
2305 amrex::Print() <<
"NOTE: terrain-fitted mesh with an LES closure (horizontal eddy "
2306 <<
"viscosity K_h) and an explicit vertical-diffusion stage "
2307 <<
"(erf.vert_implicit_fac has a zero): the terrain-metric term "
2308 <<
"K_h h^2 d2/dz2 stays explicit there and limits the time step on "
2309 <<
"steep slopes. To relax it, use erf.vert_implicit_fac = 1 1 1 with "
2310 <<
"erf.implicit_terrain_metric = true, or erf.smag2d_slope_limiter = true "
2311 <<
"for Smagorinsky2D; erf.diffusive_dt_check reports the limit."
2317 for (
int lev = 0; lev <= max_level; lev++) {
2318 if (
turbChoice[lev].enable_mrf_countergradient) {
2323 "enable_mrf_countergradient requires vert_implicit_fac > 0");
2326 "enable_mrf_countergradient requires implicit_thermal_diffusion = true");
2330 "enable_mrf_countergradient with moisture requires implicit_moisture_diffusion = true");
2335 for (
int lev = 0; lev <= max_level; lev++) {
2345 void display (
int max_level, std::string pp_prefix)
2347 amrex::Print() <<
"SOLVER CHOICE: " << std::endl;
2349 amrex::Print() <<
"Automatic LES-nest perturbations: parent update period = "
2353 for (
int lev = 0; lev <= max_level; lev++) {
2354 amrex::Print() <<
"At level " << lev <<
" : " << std::endl;
2356 amrex::Print() <<
" anelastic with no substepping, using the "
2357 << ((
anelastic_type[lev] == AnelasticType::MidPoint) ?
"MidPoint" :
"RK2")
2358 <<
" integrator" << std::endl;
2361 amrex::Print() <<
" compressible with no substepping" << std::endl;
2363 amrex::Print() <<
" compressible with implicit substepping" << std::endl;
2367 amrex::Print() <<
" and fixed density" << std::endl;
2371 for (
int lev = 0; lev <= max_level; lev++) {
2372 amrex::Print() <<
"vert_implicit_fac at level " << lev <<
" : "
2385 amrex::Print() <<
"; terrain metric implicit";
2387 amrex::Print() <<
")";
2390 amrex::Print() << std::endl;
2391 amrex::Print() <<
"use_coriolis : " <<
use_coriolis << std::endl;
2392 amrex::Print() <<
"use_gravity : " <<
use_gravity << std::endl;
2395 amrex::Print() <<
"Moisture Model: SAM" << std::endl;
2397 amrex::Print() <<
"Moisture Model: SAM No Ice" << std::endl;
2398 }
else if (
moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
2399 amrex::Print() <<
"Moisture Model: SAM No Precip No Ice" << std::endl;
2401 amrex::Print() <<
"Moisture Model: Morrison" << std::endl;
2403 amrex::Print() <<
"Moisture Model: Morrison_NoIce" << std::endl;
2405 amrex::Print() <<
"Moisture Model: WSM6" << std::endl;
2407 amrex::Print() <<
"Moisture Model: WDM6" << std::endl;
2409 amrex::Print() <<
"Moisture Model: Kessler" << std::endl;
2411 amrex::Print() <<
"Moisture Model: Kessler No Rain" << std::endl;
2413 amrex::Print() <<
"Moisture Model: Saturation Adjustment" << std::endl;
2415 amrex::Print() <<
"Moisture Model: SuperDroplets" << std::endl;
2416 }
else if (
moisture_type == MoistureType::MoistNoCondensation) {
2417 amrex::Print() <<
"Moisture Model: MoistNoCondensation" << std::endl;
2419 amrex::Print() <<
"Moisture Model: SBM mapped spectral advection (M3)" << std::endl;
2421 amrex::Print() <<
"Moisture Model: None" << std::endl;
2425 amrex::Print() <<
"Terrain Type: StaticFittedMesh" << std::endl;
2426 }
else if (
terrain_type == TerrainType::MovingFittedMesh) {
2427 amrex::Print() <<
"Terrain Type: MovingFittedMesh" << std::endl;
2429 amrex::Print() <<
"Terrain Type: EB" << std::endl;
2431 }
else if (
terrain_type == TerrainType::ImmersedForcing) {
2432 amrex::Print() <<
"Terrain Type: ImmersedForcing" << std::endl;
2434 amrex::Print() <<
"Terrain Type: None" << std::endl;
2437 amrex::Print() <<
"Flat fitted terrain: "
2441 amrex::Print() <<
"Buildings Type: ImmersedForcing" << std::endl;
2443 amrex::Print() <<
"Buildings Type: None" << std::endl;
2446 if (
mesh_type == MeshType::ConstantDz) {
2447 amrex::Print() <<
" Mesh Type: ConstantDz" << std::endl;
2448 }
else if (
mesh_type == MeshType::StretchedDz) {
2449 amrex::Print() <<
" Mesh Type: StretchedDz" << std::endl;
2450 }
else if (
mesh_type == MeshType::VariableDz) {
2451 amrex::Print() <<
" Mesh Type: VariableDz" << std::endl;
2453 amrex::Error(
"No mesh_type set!");
2456 amrex::Print() <<
"ABL Driver Type: " << std::endl;
2458 amrex::Print() <<
" None" << std::endl;
2460 amrex::Print() <<
" Pressure Gradient "
2464 amrex::Print() <<
" Geostrophic Wind "
2469 if (max_level > 0) {
2470 amrex::Print() <<
"Coupling Type: " << std::endl;
2472 amrex::Print() <<
" Two-way" << std::endl;
2474 amrex::Print() <<
" One-way" << std::endl;
2478 if (
rad_type == RadiationType::RRTMGP) {
2479 amrex::Print() <<
"Radiation Model: RRTMGP" << std::endl;
2480 }
else if (
rad_type == RadiationType::Simple) {
2481 amrex::Print() <<
"Radiation Model: Simple" << std::endl;
2482 }
else if (
rad_type == RadiationType::TwoStream) {
2483 amrex::Print() <<
"Radiation Model: TwoStream" << std::endl;
2485 amrex::Print() <<
"Radiation Model: None" << std::endl;
2488 amrex::Print() <<
"Gradp_type : " <<
gradp_type << std::endl;
2490 for (
int lev = 0; lev <= max_level; lev++) {
2491 amrex::Print() <<
"Buoyancy_type at level " << lev <<
" : " <<
buoyancy_type[lev] << std::endl;
2499 for (
int lev = 0; lev <= max_level; lev++) {
2510 amrex::ParmParse
pp(pp_prefix);
2513 double rot_time_period = 86400.0;
2514 pp.queryAdd(
"rotational_time_period", rot_time_period);
2522 pp.queryAdd(
"latitude", latitude_for_coriolis);
2524 sinphi = std::sin(latitude_for_coriolis);
2528 cosphi = std::cos(latitude_for_coriolis);
2536 amrex::Vector<amrex::Real> abl_geo_wind(3);
2537 pp.queryarr(
"abl_geo_wind",abl_geo_wind);
2546 amrex::Print() <<
"NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
2560 amrex::Vector<int>& vec_to_fill,
int default_int)
2562 amrex::ParmParse
pp(
"erf");
2563 int nvals =
pp.countval(string_to_read);
2565 amrex::Vector<int> temp; temp.resize(nvals);
2566 pp.queryarr(string_to_read,temp);
2568 if (vec_to_fill.size() < max_level+1) {
2569 vec_to_fill.resize(max_level+1);
2573 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
2574 }
else if (nvals == 1) {
2575 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
2577 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
2672 #ifdef AMREX_USE_FLOAT
2811 std::sqrt(geom.CellSize(0) * geom.CellSize(1)) <=
2822 return pert_type[lev] == PerturbationType::Source ||
2823 pert_type[lev] == PerturbationType::Direct ||
2824 pert_type[lev] == PerturbationType::CPM ||
2825 pert_type[lev] == PerturbationType::CPM_W;
2835 return pert_type[lev] == PerturbationType::Direct ||
2836 pert_type[lev] == PerturbationType::CPM ||
2837 pert_type[lev] == PerturbationType::CPM_W;
2847 return pert_type[lev] == PerturbationType::Source;
2857 return pert_type[lev] == PerturbationType::CPM_W;
2907 if (type == PerturbationType::Source ||
2908 type == PerturbationType::Direct ||
2909 type == PerturbationType::CPM ||
2910 type == PerturbationType::CPM_W) {
2921 for (
int source = lev-1; source >= 0; --source) {
2924 for (
int source = lev-1; source >= 0; --source) {
2926 if (tc.les_type !=
LESType::None && !tc.smag2d) {
return source; }
2961 return (
rad_type == RadiationType::RRTMGP) || (
rad_type == RadiationType::Simple);
2975 return (
rad_type == RadiationType::RRTMGP) ||
2976 (
rad_type == RadiationType::TwoStream &&
lsm_type == LandSurfaceType::NOAHMP);
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:51
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:19
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:72
constexpr amrex::Real R_d
Definition: ERF_Constants.H:49
static const std::string BoundaryFaceName[]
Definition: ERF_DataStruct.H:218
TauType
Stress tensor component indices.
Definition: ERF_DataStruct.H:48
@ tau12
Definition: ERF_DataStruct.H:49
@ tau23
Definition: ERF_DataStruct.H:49
@ tau33
Definition: ERF_DataStruct.H:49
@ tau22
Definition: ERF_DataStruct.H:49
@ tau11
Definition: ERF_DataStruct.H:49
@ tau32
Definition: ERF_DataStruct.H:49
@ tau31
Definition: ERF_DataStruct.H:49
@ tau21
Definition: ERF_DataStruct.H:49
@ tau13
Definition: ERF_DataStruct.H:49
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:153
Rayleigh
Rayleigh damping profile component indices.
Definition: ERF_DataStruct.H:206
@ ubar
Definition: ERF_DataStruct.H:207
@ wbar
Definition: ERF_DataStruct.H:207
@ nvars
Definition: ERF_DataStruct.H:207
@ vbar
Definition: ERF_DataStruct.H:207
@ thetabar
Definition: ERF_DataStruct.H:207
Sponge
Sponge reference-state component indices.
Definition: ERF_DataStruct.H:214
@ nvars_sponge
Definition: ERF_DataStruct.H:215
@ vbar_sponge
Definition: ERF_DataStruct.H:215
@ ubar_sponge
Definition: ERF_DataStruct.H:215
MapFacType
Indices for map scale factors on mass and face grids.
Definition: ERF_DataStruct.H:36
@ v_x
Definition: ERF_DataStruct.H:38
@ num
Definition: ERF_DataStruct.H:38
@ u_y
Definition: ERF_DataStruct.H:39
@ v_y
Definition: ERF_DataStruct.H:39
@ m_y
Definition: ERF_DataStruct.H:39
@ u_x
Definition: ERF_DataStruct.H:38
@ m_x
Definition: ERF_DataStruct.H:38
Coord
Coordinate-axis selector.
Definition: ERF_DataStruct.H:198
AMREX_ENUM(PlotFileType, None, Amrex, Netcdf)
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:69
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:67
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:68
#define RhoQ11_comp
Definition: ERF_IndexDefines.H:76
#define RhoQ9_comp
Definition: ERF_IndexDefines.H:74
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:66
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:71
#define RhoQ8_comp
Definition: ERF_IndexDefines.H:73
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:70
#define RhoQ7_comp
Definition: ERF_IndexDefines.H:72
#define RhoQ10_comp
Definition: ERF_IndexDefines.H:75
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:46
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:116
Radiation model type and control parameters.
amrex::Real Real
Definition: ERF_ShocInterface.H:19
ShocMomentumTransport
Definition: ERF_ShocTransportStruct.H:16
bool shoc_disables_momentum_transport(ShocMomentumTransport mode)
Definition: ERF_ShocTransportStruct.H:47
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
ShocTransportMode
Definition: ERF_ShocTransportStruct.H:11
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:85
AMREX_ASSERT_WITH_MESSAGE(wbar_cutoff_min > wbar_cutoff_max, "ERROR: wbar_cutoff_min < wbar_cutoff_max")
Definition: ERF_Fitch.H:9
Definition: ERF_GeneralAD.H:8
Definition: ERF_Kessler.H:78
Definition: ERF_MoistNoCondensation.H:13
Definition: ERF_Morrison.H:124
Definition: ERF_NOAHMP.H:57
Definition: ERF_SLM.H:185
Definition: ERF_SatAdj.H:47
Definition: ERF_SimpleAD.H:8
Definition: ERF_WDM6.H:115
Definition: ERF_WSM6.H:128
@ None
Definition: ERF_LSM_Types.H:6
@ dz
Definition: ERF_AdvanceWDM6.cpp:273
Definition: ERF_AdvStruct.H:19
void display(std::string &pp_prefix)
Print the configured advection choices.
Definition: ERF_AdvStruct.H:245
void init_params(std::string pp_prefix)
Read advection options from the input parameter database.
Definition: ERF_AdvStruct.H:25
Definition: ERF_CanopyTurbStruct.H:16
void init_params(amrex::ParmParse &pp)
Definition: ERF_CanopyTurbStruct.H:32
Definition: ERF_DampingStruct.H:22
void init_params(std::string pp_prefix)
Read damping options from the input parameter database.
Definition: ERF_DampingStruct.H:28
void display()
Print the configured damping options.
Definition: ERF_DampingStruct.H:71
Definition: ERF_DiffStruct.H:24
MolecDiffType molec_diff_type
Selected molecular transport model.
Definition: ERF_DiffStruct.H:96
void init_params(std::string pp_prefix)
Read diffusion options from the input parameter database.
Definition: ERF_DiffStruct.H:30
void display()
Print the configured diffusion options.
Definition: ERF_DiffStruct.H:79
Definition: ERF_EBStruct.H:36
void init_params(std::string pp_prefix)
Read embedded-boundary options from the input parameter database.
Definition: ERF_EBStruct.H:42
void display()
Print the configured embedded-boundary options.
Definition: ERF_EBStruct.H:63
An ordered list of conserved-state components forming an aggregate moisture output variable (qt,...
Definition: ERF_DataStruct.H:514
int comp[max_size]
Definition: ERF_DataStruct.H:516
int size
Definition: ERF_DataStruct.H:517
bool empty() const
Definition: ERF_DataStruct.H:523
void append(int c)
Append a component, ignoring the ones the scheme does not carry.
Definition: ERF_DataStruct.H:520
static constexpr int max_size
qv, qc, qi, qr, qs, qg
Definition: ERF_DataStruct.H:515
Whether this map decides a variable's availability, and if so whether the variable is available.
Definition: ERF_DataStruct.H:643
bool available
the active scheme carries the data behind it
Definition: ERF_DataStruct.H:645
bool governed
the name is a moisture output variable
Definition: ERF_DataStruct.H:644
The moisture data carried by the active microphysics scheme.
Definition: ERF_DataStruct.H:251
int nc
cloud liquid water number
Definition: ERF_DataStruct.H:272
int qs
snow
Definition: ERF_DataStruct.H:266
int cond_rate
condensation rate
Definition: ERF_DataStruct.H:301
int comp_for_var(const std::string &name) const
The conserved-state component behind a single-species output name, or absent if the name is not a sin...
Definition: ERF_DataStruct.H:604
int nn
CCN / total aerosol number.
Definition: ERF_DataStruct.H:282
int qr
rain
Definition: ERF_DataStruct.H:265
static constexpr int absent
not carried by the active scheme
Definition: ERF_DataStruct.H:254
bool has_comp(int comp) const
Test whether a conserved-state component holds one of the moisture variables this scheme carries.
Definition: ERF_DataStruct.H:566
int precip_accum
accumulated surface precipitation, all species
Definition: ERF_DataStruct.H:299
MoistureComponentIndices()=default
Construct an empty map, i.e. a dry run.
int qi
cloud ice
Definition: ERF_DataStruct.H:264
int rel_hum
relative humidity
Definition: ERF_DataStruct.H:300
int graupel_accum
accumulated surface graupel
Definition: ERF_DataStruct.H:298
static constexpr int computed_from_state
Definition: ERF_DataStruct.H:255
int ni
cloud ice number
Definition: ERF_DataStruct.H:273
int qv
water vapor
Definition: ERF_DataStruct.H:262
int rain_accum
accumulated surface rain
Definition: ERF_DataStruct.H:296
CompList nonprecipitating_comps() const
Components summed for non-precipitating water, "qn": vapor plus the suspended condensate....
Definition: ERF_DataStruct.H:542
bool has_reflectivity_species() const
Test whether the active scheme carries rain, snow and graupel in the RhoQ4/RhoQ5/RhoQ6 slots assumed ...
Definition: ERF_DataStruct.H:582
int snow_accum
accumulated surface snow
Definition: ERF_DataStruct.H:297
CompList total_water_comps() const
Components summed for total water, "qt": every mass mixing ratio.
Definition: ERF_DataStruct.H:531
int nr
rain number
Definition: ERF_DataStruct.H:274
int qc
cloud liquid water
Definition: ERF_DataStruct.H:263
int ng
graupel number
Definition: ERF_DataStruct.H:276
CompList precipitating_comps() const
Components summed for precipitating water, "qp": the falling species.
Definition: ERF_DataStruct.H:551
int qg
graupel
Definition: ERF_DataStruct.H:267
bool has_moisture() const
Test whether the active scheme carries any moisture at all.
Definition: ERF_DataStruct.H:592
int ns
snow number
Definition: ERF_DataStruct.H:275
VarAvailability query_var(const std::string &name) const
Classify an output variable name against this index map.
Definition: ERF_DataStruct.H:659
bool has_derived_var(const std::string &name) const
Test whether the moist species behind a derived/plot variable name is carried by the active scheme.
Definition: ERF_DataStruct.H:705
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:357
MoistureComponentIndices(int qv_comp, int qc_comp, int qi_comp=absent, int qr_comp=absent, int qs_comp=absent, int qg_comp=absent, int nc_comp=absent, int ni_comp=absent, int nr_comp=absent, int ns_comp=absent, int ng_comp=absent, int nn_comp=absent)
Construct the conserved-state component map.
Definition: ERF_DataStruct.H:323
int qmoist_index_for_var(const std::string &name) const
The qmoist slot behind a moist diagnostic output name.
Definition: ERF_DataStruct.H:629
Definition: ERF_RadStruct.H:73
void read(const std::string &prefix)
Definition: ERF_RadStruct.H:79
Container holding radiation-related choices and parameters.
Definition: ERF_RadStruct.H:132
void init_params(bool two_stream_selected, std::string pp_prefix)
Definition: ERF_RadStruct.H:904
Definition: ERF_DataStruct.H:715
bool use_coupled_sst
Definition: ERF_DataStruct.H:2980
int sbm_moment_mode
Definition: ERF_DataStruct.H:2944
bool custom_geostrophic_profile
Whether a custom geostrophic wind profile is used.
Definition: ERF_DataStruct.H:2755
int n_ensemble
Number of ensemble members.
Definition: ERF_DataStruct.H:3063
WindFarmLocType windfarm_loc_type
Coordinate system for wind-farm turbine locations.
Definition: ERF_DataStruct.H:2952
bool implicit_before_substep
Whether implicit diffusion is applied before acoustic substepping.
Definition: ERF_DataStruct.H:2664
amrex::Real const_massflux_v
Target constant mass flux in the y direction.
Definition: ERF_DataStruct.H:3044
std::string hindcast_boundary_data_dir
Directory containing hindcast lateral boundary data.
Definition: ERF_DataStruct.H:3051
amrex::Real if_psi_cap_factor
Cap on psi_m in the immersed momentum wall law as a fraction of ln(z/z0) (1: none).
Definition: ERF_DataStruct.H:2722
amrex::Real ens_pert_correlated_radius
Spatial correlation radius for ensemble perturbations.
Definition: ERF_DataStruct.H:3064
amrex::Real forest_leaf_theta_fixed
Definition: ERF_DataStruct.H:3038
static InitType init_type
Initial-condition source selected for the run.
Definition: ERF_DataStruct.H:2583
amrex::Real coriolis_factor
Twice the planetary rotation rate used for Coriolis forcing.
Definition: ERF_DataStruct.H:2745
int perturbation_pblh_level(int lev) const
Definition: ERF_DataStruct.H:2919
bool io_hurricane_eye_tracker
Whether hurricane-eye tracking output is enabled.
Definition: ERF_DataStruct.H:3059
static bool flat_terrain
Permit fixed-index planar averages after validating a flat fitted mesh.
Definition: ERF_DataStruct.H:2592
std::string abl_geo_wind_table
Path to a time-varying geostrophic wind table.
Definition: ERF_DataStruct.H:2985
amrex::Vector< int > fixed_density
Per-level flag selecting fixed-density treatment; always 1 at an anelastic level.
Definition: ERF_DataStruct.H:2631
amrex::Vector< TurbChoice > turbChoice
Turbulence options for each AMR level.
Definition: ERF_DataStruct.H:2620
amrex::Real const_massflux_layer_lo
Lower height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:3046
amrex::Real hindcast_zhi_sponge_length
Length of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:3056
TopographicShadingChoice topographicChoice
Definition: ERF_DataStruct.H:2624
bool if_fraction_stress
erf.if_wall_form = fraction_stress: the wall stress of ERF_ImmersedWallCell.H in the wall cell of eac...
Definition: ERF_DataStruct.H:2714
amrex::Real gravity
Effective gravitational acceleration.
Definition: ERF_DataStruct.H:2736
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.
Definition: ERF_DataStruct.H:2104
bool pbl_suppresses_microphysics_condensation() const noexcept
Query whether the active PBL scheme suppresses microphysics condensation.
Definition: ERF_DataStruct.H:2895
amrex::Real perturbation_auto_period
Seconds between automatic parent-wind and PBL-height updates.
Definition: ERF_DataStruct.H:2934
bool variable_coriolis
Whether spatially varying Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2988
bool implicit_moisture_diffusion
Whether implicit vertical moisture diffusion is included.
Definition: ERF_DataStruct.H:2661
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:2942
void display(int max_level, std::string pp_prefix)
Print the configured solver, physics, and transport options.
Definition: ERF_DataStruct.H:2345
amrex::Real poisson_abstol
Absolute tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2676
amrex::Real if_Cd_momentum
Immersed-forcing drag coefficient for momentum.
Definition: ERF_DataStruct.H:2699
bool nudging_t
Definition: ERF_DataStruct.H:2776
amrex::Real if_Olen_in
Input Obukhov length for immersed-forcing MOST [m].
Definition: ERF_DataStruct.H:2710
amrex::Vector< int > buoyancy_type
Per-level buoyancy formulation selector.
Definition: ERF_DataStruct.H:2633
bool forest_biophysics
Definition: ERF_DataStruct.H:3036
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Build constant-latitude Coriolis forcing parameters.
Definition: ERF_DataStruct.H:2508
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:2941
bool use_pert_pres_gradient
Whether momentum equations use perturbational pressure gradients.
Definition: ERF_DataStruct.H:2685
bool sbm_test_native_qc_write_fault
Definition: ERF_DataStruct.H:2946
amrex::Vector< int > project_initial_velocity
Per-level flag for projecting the initial velocity.
Definition: ERF_DataStruct.H:2632
int ave_plane
Averaging plane index used by diagnostics.
Definition: ERF_DataStruct.H:2990
amrex::Real const_massflux_u
Target constant mass flux in the x direction.
Definition: ERF_DataStruct.H:3043
bool nudging_q
Definition: ERF_DataStruct.H:2777
int ncorr
Number of projection correction iterations.
Definition: ERF_DataStruct.H:2669
amrex::Real if_small_volfrac
Immersed-forcing solid fraction below which a cell or face counts as fluid; read from eb2....
Definition: ERF_DataStruct.H:2723
static bool buildings_fc_factories
Use native face-centered EB factories for immersed buildings on a static fitted mesh.
Definition: ERF_DataStruct.H:2598
amrex::Real sampling_distance_by_D
Turbine inflow sampling distance normalized by rotor diameter.
Definition: ERF_DataStruct.H:2999
amrex::Real windfarm_y_shift
Wind-farm y-coordinate shift.
Definition: ERF_DataStruct.H:3002
bool use_rotate_surface_flux
Whether MOST surface fluxes are rotated with terrain.
Definition: ERF_DataStruct.H:2784
bool use_building_immersed_forcing(const amrex::Geometry &geom) const noexcept
Definition: ERF_DataStruct.H:2808
bool moisture_tight_coupling
Whether moisture updates use tight coupling.
Definition: ERF_DataStruct.H:2995
EBChoice ebChoice
Embedded-boundary options.
Definition: ERF_DataStruct.H:2621
bool compute_mean_vars
Definition: ERF_DataStruct.H:2801
amrex::Real test_mapfactor_amp
Amplitude of the spatially varying test map scale factors on level 0 (0: not used).
Definition: ERF_DataStruct.H:2681
amrex::Real beta_s
Time off-centering coefficient for forward weighting.
Definition: ERF_DataStruct.H:2641
bool implicit_ke_diffusion
Whether implicit vertical TKE diffusion is included.
Definition: ERF_DataStruct.H:2662
bool interp_atmos_from_coarse
Definition: ERF_DataStruct.H:3030
bool any_perturbation() const
Query whether any level uses a turbulent perturbation mode.
Definition: ERF_DataStruct.H:2904
amrex::Real if_z0
Immersed-forcing roughness length [m].
Definition: ERF_DataStruct.H:2706
bool forest_substep
Whether canopy source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2696
bool use_wrf_bdy_density
Definition: ERF_DataStruct.H:3008
bool implicit_thermal_diffusion
Whether implicit vertical thermal diffusion is included.
Definition: ERF_DataStruct.H:2660
bool if_implicit_projection
Definition: ERF_DataStruct.H:2704
std::string mean_vars_reset_mode
Definition: ERF_DataStruct.H:2804
bool use_gravity
Whether gravitational forcing is enabled.
Definition: ERF_DataStruct.H:2688
amrex::Real beta_s_max
Upper bound of the spatially varying beta_s.
Definition: ERF_DataStruct.H:2647
amrex::Real num_diff_coeff
Numerical diffusion coefficient after input scaling.
Definition: ERF_DataStruct.H:2939
amrex::Real if_wall_tke_time_factor
1 (the default) pins the wall cell after every stage and in the implicit TKE solve; a larger value re...
Definition: ERF_DataStruct.H:2717
amrex::Real bdy_nudge_factor
Boundary sponge nudging factor.
Definition: ERF_DataStruct.H:3005
int sbm_cloud_rain_split
Definition: ERF_DataStruct.H:2945
amrex::Real rdOcp
Ratio of dry-air gas constant to c_p.
Definition: ERF_DataStruct.H:2738
bool use_wvel_perturbation(int lev) const
Query whether vertical-velocity CPM perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2855
bool hindcast_lateral_forcing
Whether hindcast lateral forcing is enabled.
Definition: ERF_DataStruct.H:3053
bool do_theta_advection
Whether custom vertical subsidence is applied to rho-theta.
Definition: ERF_DataStruct.H:2753
bool use_native_shoc
Whether any level uses the native SHOC PBL scheme.
Definition: ERF_DataStruct.H:2788
amrex::Real nudging_q_z2
Definition: ERF_DataStruct.H:2773
static bool use_real_bcs
Whether real-data lateral boundary conditions are used.
Definition: ERF_DataStruct.H:2601
bool spatial_moisture_forcing
Whether spatially varying moisture forcing is enabled.
Definition: ERF_DataStruct.H:2758
bool perturbation_auto
Select LES nests, using parent winds and a PBL ancestor's height, or the nearest LES ancestor's diagn...
Definition: ERF_DataStruct.H:2933
RRTMGPSolarChoice rrtmgpSolarChoice
Definition: ERF_DataStruct.H:2623
amrex::Vector< SubsteppingType > substepping_type
Acoustic substepping type for each AMR level.
Definition: ERF_DataStruct.H:2628
amrex::Real nudging_u_z2
Definition: ERF_DataStruct.H:2769
bool use_perturbation(int lev) const
Query whether any turbulent perturbation mode is enabled on a level.
Definition: ERF_DataStruct.H:2820
static SoundingType sounding_type
Interpretation used for input sounding profiles.
Definition: ERF_DataStruct.H:2586
int bdy_moist_nudge_type
Moist-variable nudging strategy in boundary regions.
Definition: ERF_DataStruct.H:3017
amrex::Real poisson_reltol
Relative tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2677
bool use_coriolis
Whether Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2689
amrex::Vector< PerturbationType > pert_type
Turbulent perturbation type for each AMR level.
Definition: ERF_DataStruct.H:2932
static MeshType mesh_type
Vertical mesh representation.
Definition: ERF_DataStruct.H:2604
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:2616
UrbanType urban_type
Definition: ERF_DataStruct.H:2954
SpongeChoice spongeChoice
Sponge-layer options.
Definition: ERF_DataStruct.H:2619
void init_params(int max_level, std::string pp_prefix)
Read solver-wide algorithmic options from the input parameter database.
Definition: ERF_DataStruct.H:722
bool time_avg_vel
Whether time-averaged velocity fields are output.
Definition: ERF_DataStruct.H:2798
bool use_direct_perturbation(int lev) const
Query whether direct turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2833
bool have_geo_wind_profile
Whether a geostrophic wind profile has been configured.
Definition: ERF_DataStruct.H:2986
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Applied ABL pressure-gradient forcing vector.
Definition: ERF_DataStruct.H:2983
RadChoice radChoice
Definition: ERF_DataStruct.H:2622
amrex::Vector< int > anelastic
Per-level flag selecting anelastic dynamics.
Definition: ERF_DataStruct.H:2629
bool four_stream_radiation
Whether the four-stream radiation approximation is enabled.
Definition: ERF_DataStruct.H:2692
amrex::Real perturbation_auto_pbl_fraction
Fraction of the selected ancestor's PBL height occupied by perturbations.
Definition: ERF_DataStruct.H:2935
amrex::Real beta_s_min
Lower bound of the spatially varying beta_s.
Definition: ERF_DataStruct.H:2646
int gradp_type
Terrain-fitted horizontal pressure-gradient formulation.
Definition: ERF_DataStruct.H:2683
DampingChoice dampingChoice
Damping-related options.
Definition: ERF_DataStruct.H:2618
amrex::Real if_damp_alpha
Immersed-forcing damping coefficient.
Definition: ERF_DataStruct.H:2720
bool rebalance_wrf_input
Whether to rebalance states from wrfinput and wrfbdy data.
Definition: ERF_DataStruct.H:2733
bool wrfinput_zlevels_from_file
Definition: ERF_DataStruct.H:3027
amrex::Vector< amrex::Real > sbm_edges
Definition: ERF_DataStruct.H:2948
amrex::Real turb_disk_angle
Turbine disk angle from the x axis [deg].
Definition: ERF_DataStruct.H:3000
amrex::Real hindcast_data_interval_in_hrs
Time interval between hindcast data files [hr].
Definition: ERF_DataStruct.H:3052
amrex::Real const_massflux_layer_hi
Upper height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:3047
std::string wall_dist_type
Definition: ERF_DataStruct.H:2670
bool avg_grid_faces_to_nodes
Definition: ERF_DataStruct.H:3020
amrex::Real cf_loglaw_z0
Roughness length [m] of that share; by default erf.if_z0 with immersed forcing, else the inputs' erf....
Definition: ERF_DataStruct.H:2727
std::string windfarm_spec_table_extra
Additional wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2997
amrex::Real if_ws_floor
Wind-speed floor [m/s] in the per-step change limit of the building wall-law forcing.
Definition: ERF_DataStruct.H:2719
amrex::Real lsf_timescale
Definition: ERF_DataStruct.H:2781
bool is_init_for_ensemble
Whether initialization is for an ensemble simulation.
Definition: ERF_DataStruct.H:3062
bool uses_shoc_family() const noexcept
Query whether any SHOC-family PBL scheme is active.
Definition: ERF_DataStruct.H:2864
bool test_mapfactor
Whether to use test map scale factors.
Definition: ERF_DataStruct.H:2680
amrex::Real nudging_u_z1
Definition: ERF_DataStruct.H:2768
bool if_snap_partial_cells
Definition: ERF_DataStruct.H:2712
amrex::Vector< amrex::Real > sbm_pivots
Definition: ERF_DataStruct.H:2949
std::string coarse_bckgnd_data_file
Coarse background data file used for ensemble initialization.
Definition: ERF_DataStruct.H:3066
bool do_forest_drag
Whether forest canopy drag is enabled.
Definition: ERF_DataStruct.H:3033
amrex::Real dz0
Initial vertical grid spacing for stretched-grid setup.
Definition: ERF_DataStruct.H:2742
amrex::Real windfarm_x_shift
Wind-farm x-coordinate shift.
Definition: ERF_DataStruct.H:3001
bool use_lagged_delta_rt
Whether to use lagged delta terms for moving terrain.
Definition: ERF_DataStruct.H:2730
amrex::Real ens_pert_amplitude
Amplitude of ensemble initialization perturbations.
Definition: ERF_DataStruct.H:3065
std::string windfarm_airfoil_tables
Wind-farm airfoil table paths.
Definition: ERF_DataStruct.H:2998
amrex::Vector< AnelasticType > anelastic_type
Per-level two-stage scheme used by the anelastic integrator.
Definition: ERF_DataStruct.H:2630
amrex::Real bdy_rho_nudge_factor
Definition: ERF_DataStruct.H:3014
amrex::Real nudging_q_z1
Definition: ERF_DataStruct.H:2772
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Per-level, per-stage implicit vertical diffusion factors.
Definition: ERF_DataStruct.H:2657
bool transport_scalar
Whether the passive scalar component is transported.
Definition: ERF_DataStruct.H:2795
bool cf_loglaw_fill
Share the flux of the first coarse face above a wall among its fine sub-faces at the lateral coarse/f...
Definition: ERF_DataStruct.H:2726
TerrainPoissonSolver terrain_poisson_solver
Projection solver on a terrain-fitted mesh: gmres_fft (default), mlmg or gmres_mlmg.
Definition: ERF_DataStruct.H:2671
bool hindcast_zhi_sponge_damping
Whether upper-boundary hindcast sponge damping is enabled.
Definition: ERF_DataStruct.H:3057
amrex::Real hurricane_eye_longitude
Initial hurricane-eye longitude.
Definition: ERF_DataStruct.H:3060
bool nudging_from_observations
Whether solution fields are nudged toward observations at stations.
Definition: ERF_DataStruct.H:2766
LandSurfaceType lsm_type
Land-surface model.
Definition: ERF_DataStruct.H:2953
int massflux_khi
Upper vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:3049
bool large_scale_forcing
Definition: ERF_DataStruct.H:2779
bool implicit_terrain_metric
Whether the compact terrain-metric part of the vertical diffusion is solved implicitly.
Definition: ERF_DataStruct.H:2667
bool if_wall_tke
Hold the k-eqn TKE of the fraction-stress wall cell at its flat-ground wall value (ib_wall::wall_tke)...
Definition: ERF_DataStruct.H:2716
bool substepping_diag
Whether to emit extra CFL diagnostics for compressible substepping.
Definition: ERF_DataStruct.H:2637
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:2589
amrex::Real mean_vars_reset_time
Definition: ERF_DataStruct.H:2805
std::string windfarm_blade_table
Wind-farm blade table path.
Definition: ERF_DataStruct.H:2998
bool if_flat_wall_dissipation
Partial fraction-stress wall cells dissipate TKE with the length scale of flat ground's first cell; o...
Definition: ERF_DataStruct.H:2718
CanopyTurbulence canopyTurb
Definition: ERF_DataStruct.H:3040
amrex::Vector< int > is_land
Per-level land/water selector.
Definition: ERF_DataStruct.H:2634
amrex::Real hindcast_lateral_sponge_strength
Strength of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:3055
bool forest_biophysics_heat
Definition: ERF_DataStruct.H:3037
std::string if_average_down
Cell average down over immersed-forcing levels: "plain" (the default, the plain cell average) or "flu...
Definition: ERF_DataStruct.H:2724
ShocTransportMode shoc_transport_mode
Definition: ERF_DataStruct.H:2791
amrex::Real hurricane_eye_latitude
Initial hurricane-eye latitude.
Definition: ERF_DataStruct.H:3060
bool rad_uses_interface() const
True for the models that run through the IRadiation interface (RRTMGP, Simple); the two-stream model ...
Definition: ERF_DataStruct.H:2960
amrex::Real cosphi
Cosine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2746
amrex::Real if_Cd_scalar
Immersed-forcing drag coefficient for scalars.
Definition: ERF_DataStruct.H:2700
amrex::Real if_cf_mismatch_warning
Spread of the fine solid fractions under a coarse cell along a lateral coarse/fine face at or above w...
Definition: ERF_DataStruct.H:2725
static BuildingsType buildings_type
Building representation.
Definition: ERF_DataStruct.H:2595
std::string windfarm_loc_table
Wind-farm location table path.
Definition: ERF_DataStruct.H:2997
std::string hindcast_surface_data_dir
Directory containing hindcast surface boundary data.
Definition: ERF_DataStruct.H:3051
int if_wall_face_spacing
Spacing the face above the fraction-stress wall cell differences over: 0 the cell height,...
Definition: ERF_DataStruct.H:2715
ShocMomentumTransport shoc_momentum_transport
Definition: ERF_DataStruct.H:2792
bool custom_rhotheta_forcing
Whether custom rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2750
amrex::Real beta_d
Divergence damping coefficient used in the acoustic substepping.
Definition: ERF_DataStruct.H:2651
bool sbm_test_donor_cfl_fault
Definition: ERF_DataStruct.H:2947
amrex::Real if_init_surf_temp
Initial immersed-forcing surface temperature [K].
Definition: ERF_DataStruct.H:2708
amrex::Real nudging_t_z2
Definition: ERF_DataStruct.H:2771
int massflux_klo
Lower vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:3048
std::string lsf_file
Definition: ERF_DataStruct.H:2780
std::string windfarm_spec_table
Wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2997
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Applied geostrophic-wind forcing vector.
Definition: ERF_DataStruct.H:2984
bool read_int_string(int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
Read one integer value or one value per AMR level.
Definition: ERF_DataStruct.H:2559
ABLDriverType abl_driver_type
Atmospheric boundary-layer driver type.
Definition: ERF_DataStruct.H:2982
DiffChoice diffChoice
Diffusion-related options.
Definition: ERF_DataStruct.H:2617
amrex::Real if_surf_temp_flux
Immersed-forcing surface temperature flux [K m/s].
Definition: ERF_DataStruct.H:2707
bool spatial_rhotheta_forcing
Whether spatially varying rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2757
amrex::Vector< int > urban_enabled_lev
Definition: ERF_DataStruct.H:2955
WindFarmType windfarm_type
Wind-farm model.
Definition: ERF_DataStruct.H:2951
bool use_variable_beta_s
Whether beta_s varies on the w-faces with the terrain slope.
Definition: ERF_DataStruct.H:2645
bool use_source_perturbation(int lev) const
Query whether source-term turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2845
bool custom_w_subsidence
Whether custom vertical subsidence is enabled.
Definition: ERF_DataStruct.H:2752
bool rad_feeds_lsm() const
True when the radiation model's outputs feed the land model (downwelling shortwave,...
Definition: ERF_DataStruct.H:2974
bool custom_moisture_forcing
Whether custom moisture forcing is enabled.
Definition: ERF_DataStruct.H:2751
amrex::Real if_surf_heating_rate
Immersed-forcing surface heating rate [K/hr].
Definition: ERF_DataStruct.H:2709
int sbm_nbins
Definition: ERF_DataStruct.H:2943
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:2993
RadiationType rad_type
Radiation model.
Definition: ERF_DataStruct.H:2956
amrex::Real grid_stretching_ratio
Vertical grid stretching ratio.
Definition: ERF_DataStruct.H:2741
bool hindcast_surface_bcs
Whether hindcast surface boundary conditions are enabled.
Definition: ERF_DataStruct.H:3054
bool host_owns_vertical_scalar_diffusion() const noexcept
Test whether the host owns scalar diffusion.
Definition: ERF_DataStruct.H:2884
bool immersed_forcing_substep
Whether immersed-forcing source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2695
bool if_use_most
Whether immersed-forcing MOST is enabled.
Definition: ERF_DataStruct.H:2711
amrex::Real const_massflux_tau
Relaxation time scale for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:3045
amrex::Real hindcast_lateral_sponge_length
Length of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:3055
bool use_eamxx_shoc
Whether any level uses the EAMxx SHOC PBL scheme.
Definition: ERF_DataStruct.H:2787
amrex::Real sinphi
Sine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2747
bool host_owns_vertical_momentum_diffusion() const noexcept
Test whether the host owns momentum diffusion.
Definition: ERF_DataStruct.H:2873
amrex::Real hindcast_zhi_sponge_strength
Strength of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:3056
bool coriolis_3d
Whether the three-dimensional Coriolis terms are included.
Definition: ERF_DataStruct.H:2690
int force_stage1_single_substep
Flag forcing a single substep in the first RK stage.
Definition: ERF_DataStruct.H:2626
amrex::Real c_p
Specific heat at constant pressure for dry air [J/(kg-K)].
Definition: ERF_DataStruct.H:2737
bool if_implicit_drag
Definition: ERF_DataStruct.H:2703
bool implicit_momentum_diffusion
Whether implicit vertical momentum diffusion is included.
Definition: ERF_DataStruct.H:2663
bool do_mom_advection
Whether custom vertical subsidence is applied to momentum.
Definition: ERF_DataStruct.H:2754
bool if_stability_correction
Whether immersed-forcing stability corrections are enabled.
Definition: ERF_DataStruct.H:2713
amrex::Real nudging_t_z1
Definition: ERF_DataStruct.H:2770
amrex::Vector< amrex::Real > sbm_fixture_initial_state
Definition: ERF_DataStruct.H:2950
bool custom_forcing_prim_vars
Whether custom forcing operates on primitive variables.
Definition: ERF_DataStruct.H:2756
amrex::Real if_stability_wind_floor
Wind-speed floor [m/s] behind the friction velocity of the wall law's stability estimate (0: none).
Definition: ERF_DataStruct.H:2721
bool nudging_u
Definition: ERF_DataStruct.H:2775
bool nudging_from_input_sounding
Whether solution fields are nudged toward input sounding data.
Definition: ERF_DataStruct.H:2762
static void set_mesh_type(MeshType new_mesh_type)
Override the globally selected mesh type.
Definition: ERF_DataStruct.H:2611
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:2938
bool use_wrf_bdy_qc_qi
Whether WRF cloud water and active cloud ice are ingested at real boundaries.
Definition: ERF_DataStruct.H:3011
Definition: ERF_SpongeStruct.H:22
void display()
Print the configured sponge-layer options.
Definition: ERF_SpongeStruct.H:85
void init_params(std::string pp_prefix)
Read sponge-layer options from the input parameter database.
Definition: ERF_SpongeStruct.H:28
Definition: ERF_RadStruct.H:103
void read(const std::string &prefix, const RRTMGPSolarChoice &solar)
Definition: ERF_TopographicShading.cpp:39
bool active() const
Definition: ERF_RadStruct.H:113