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>
58 None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, ConstantDensity, ConstantDensityLinearTheta,
59 Isentropic, MoistBaseState, HindCast
66 ConstantDensity, Ideal, Isentropic, DryIsentropic
73 None, PressureGradient, GeostrophicWind
101 FullyCompressible, Anelastic, PseudoIncompressible
113 ChainRule, HydrostaticHybrid
138 RK3_ImplicitSubstep, RK3_NoSubstepping, RK2, MidPoint
145 ConstantDz, StretchedDz, VariableDz
157 gmres_fft, mlmg, gmres_mlmg
164 None, StaticFittedMesh, MovingFittedMesh, EB, ImmersedForcing
171 None, ImmersedForcing
178 Eulerian, Lagrangian, Undefined
185 SAM, SAM_NoIce, SAM_NoPrecip_NoIce,
Kessler, Kessler_NoRain,
SatAdj,
Morrison, Morrison_NoIce,
WSM6,
WDM6, SuperDroplets,
MoistNoCondensation, SBM,
None
220 None, RRTMGP, Simple, TwoStream
362 :
qv(qv_comp),
qc(qc_comp),
qi(qi_comp),
qr(qr_comp),
qs(qs_comp),
qg(qg_comp),
363 nc(nc_comp),
ni(ni_comp),
nr(nr_comp),
ns(ns_comp),
ng(ng_comp),
389 switch (moisture_type) {
395 case MoistureType::MoistNoCondensation:
396 case MoistureType::SAM_NoPrecip_NoIce:
397 case MoistureType::Kessler_NoRain:
404 case MoistureType::SatAdj:
412 case MoistureType::Kessler:
423 case MoistureType::SBM:
431 case MoistureType::SAM_NoIce:
441 case MoistureType::SAM:
442 case MoistureType::WSM6:
457 case MoistureType::Morrison:
477 case MoistureType::Morrison_NoIce:
491 case MoistureType::WDM6:
510 case MoistureType::SuperDroplets:
529 amrex::Abort(
"Unknown MoistureType in MoistureComponentIndices::from_moisture_model");
551 [[nodiscard]]
bool empty ()
const {
return (
size == 0); }
595 return ( (comp >= 0) &&
596 ( (comp ==
qv) || (comp ==
qc) || (comp ==
qi) ||
597 (comp ==
qr) || (comp ==
qs) || (comp ==
qg) ||
598 (comp ==
nc) || (comp ==
ni) || (comp ==
nr) ||
599 (comp ==
ns) || (comp ==
ng) || (comp ==
nn) ) );
633 if (
name ==
"qv") {
return qv; }
634 if (
name ==
"qc") {
return qc; }
635 if (
name ==
"qi") {
return qi; }
636 if (
name ==
"qrain") {
return qr; }
637 if (
name ==
"qsnow") {
return qs; }
638 if (
name ==
"qgraup") {
return qg; }
639 if (
name ==
"nc") {
return nc; }
640 if (
name ==
"ni") {
return ni; }
641 if (
name ==
"nr") {
return nr; }
642 if (
name ==
"ns") {
return ns; }
643 if (
name ==
"ng") {
return ng; }
644 if (
name ==
"nn") {
return nn; }
690 if ( (
name ==
"qv") || (
name ==
"qc") || (
name ==
"qi") ||
691 (
name ==
"qrain") || (
name ==
"qsnow") || (
name ==
"qgraup") ||
698 if ( (
name ==
"rain_accum") || (
name ==
"snow_accum") ||
699 (
name ==
"graupel_accum") || (
name ==
"precip_accum") ||
700 (
name ==
"rel_humidity") ||
701 (
name ==
"condensation_rate") ) {
711 if ( (
name ==
"qn") || (
name ==
"moist_density") ) {
712 return {
true, (
qv >= 0) && (
qc >= 0)};
716 if ( (
name ==
"qsat") || (
name ==
"precipitable") ) {
720 return {
false,
false};
752 amrex::ParmParse
pp(pp_prefix);
755 if (
pp.query(
"use_terrain",bogus_bool) > 0) {
756 amrex::Error(
"The input use_terrain is deprecated. Set terrain_type instead.");
759 if (
pp.query(
"use_moist_background",bogus_bool) > 0) {
760 amrex::Error(
"The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
771 amrex::Abort(
"erf.test_mapfactor and erf.test_mapfactor_amp cannot be used together");
780 if (
pp.contains(
"gradp_type")) {
781 std::string gradp_str;
782 pp.get(
"gradp_type", gradp_str);
783 if (gradp_str ==
"0" || gradp_str ==
"1" || gradp_str ==
"2") {
784 if (gradp_str ==
"1") {
785 amrex::Abort(
"erf.gradp_type = 1 has been removed; use erf.gradp_type = HydrostaticHybrid");
787 gradp_type = (gradp_str ==
"0") ? GradpType::ChainRule : GradpType::HydrostaticHybrid;
788 amrex::Print() <<
"WARNING: integer values of erf.gradp_type are deprecated; use erf.gradp_type = "
789 << amrex::getEnumNameString(
gradp_type) << std::endl;
796 amrex::Abort(
"erf.gradp_type must be ChainRule or HydrostaticHybrid, not '"
813 amrex::Error(
"The input moisture_type is deprecated. Set moisture_model instead.");
818 #ifdef ERF_SBM_AMR_QUALIFICATION
820 pp.queryAdd(
"sbm_amr_qualification_expect_zero_flow",
822 pp.queryAdd(
"sbm_amr_qualification_expect_split",
824 pp.queryAdd(
"sbm_amr_qualification_expect_empty_fine_rank",
826 pp.queryAdd(
"sbm_amr_qualification_unique_profile",
828 pp.queryAdd(
"sbm_amr_qualification_parent_store_fault",
830 pp.queryAdd(
"sbm_amr_qualification_regrid",
832 pp.queryAdd(
"sbm_amr_qualification_regrid_reject_fault",
834 pp.queryAdd(
"sbm_amr_qualification_uniform_ratio",
837 for (
const char*
name : {
"sbm_amr_qualification_test",
838 "sbm_amr_qualification_expect_zero_flow",
839 "sbm_amr_qualification_expect_split",
840 "sbm_amr_qualification_expect_empty_fine_rank",
841 "sbm_amr_qualification_unique_profile",
842 "sbm_amr_qualification_parent_store_fault",
843 "sbm_amr_qualification_regrid",
844 "sbm_amr_qualification_regrid_reject_fault",
845 "sbm_amr_qualification_uniform_ratio"}) {
847 amrex::Error(std::string(
"erf.") +
name +
" is available only in "
848 "the isolated ERF_ENABLE_SBM_AMR_QUALIFICATION build");
859 amrex::Error(
"SBM test fault-injection options require moisture_model=SBM");
863 amrex::Error(
"erf.sbm_budget_check requires erf.moisture_model = SBM");
874 if (
pp.contains(
"sbm_zero_transport_fixture")) {
875 bool legacy_zero_transport =
false;
876 pp.get(
"sbm_zero_transport_fixture", legacy_zero_transport);
877 if (legacy_zero_transport) {
878 amrex::Error(
"erf.sbm_zero_transport_fixture=true is obsolete; M3 advances the mapped spectral state, so remove this option");
891 pp.queryAdd(
"sbm_particle_mixing_terrain_qualification",
895 amrex::Error(
"SBM requires sbm_nbins >= 2 and sbm_moment_mode equal to 1 or 2");
901 const amrex::Real fraction =
static_cast<amrex::Real
>(b) /
904 std::pow(amrex::Real(10.0), amrex::Real(-18.0) + amrex::Real(6.0) * fraction);
907 sbm_pivots[
static_cast<std::size_t
>(b)] = std::sqrt(
912 if (
sbm_nbins < 2) amrex::Error(
"sbm_edges must define at least two bins");
916 sbm_pivots[
static_cast<std::size_t
>(b)] = std::sqrt(
922 amrex::Error(
"sbm_pivots must contain one value per SBM bin");
925 if (sbm_cloud_rain_split <= 0 || sbm_cloud_rain_split >=
sbm_nbins) {
926 amrex::Error(
"sbm_cloud_rain_split must be strictly inside the liquid bin range");
929 #ifdef ERF_SBM_AMR_QUALIFICATION
936 amrex::Error(
"sbm_fixture_initial_state must match the full runtime SBM component count");
939 if (!std::isfinite(value) || value < amrex::Real(0.0)) {
940 amrex::Error(
"sbm_fixture_initial_state values must be finite and nonnegative");
945 amrex::Error(
"sbm_fixture_initial_state_xhi must have as many values as "
946 "sbm_fixture_initial_state");
949 if (!std::isfinite(value) || value < amrex::Real(0.0)) {
950 amrex::Error(
"sbm_fixture_initial_state_xhi values must be finite and nonnegative");
957 for (
int i = 0; i <= max_level; ++i) {
971 pp.query_enum_case_insensitive(
"land_surface_model",
lsm_type);
975 pp.query_enum_case_insensitive(
"urban_model",
urban_type);
977 for (
int lev = 0; lev <= max_level; ++lev) {
979 amrex::Error(
"urban_lev_active should be 0 or 1");
995 for (
int lev = 0; lev <= max_level; ++lev) {
997 amrex::Print() <<
"Level " << lev <<
" is land" << std::endl;
998 }
else if (
is_land[lev] == 0) {
999 amrex::Print() <<
"Level " << lev <<
" is water" << std::endl;
1001 amrex::Error(
"is_land should be 0 or 1");
1007 pp.query_enum_case_insensitive(
"radiation_model",
rad_type);
1010 #ifndef ERF_USE_RRTMGP
1011 if (
rad_type == RadiationType::RRTMGP)
1013 amrex::Error(
"ERF was not compiled with RRTMGP enabled!");
1018 std::string terrain_type_temp =
"";
1019 pp.queryAdd(
"terrain_type", terrain_type_temp);
1020 if (terrain_type_temp ==
"Moving") {
1021 amrex::Error(
"erf.terrain_type = Moving is no longer supported; please replace Moving by MovingFittedMesh");
1022 }
else if (terrain_type_temp ==
"Static") {
1023 amrex::Error(
"erf.terrain_type = Static is no longer supported; please replace Static by StaticFittedMesh");
1032 std::string buildings_type_temp =
"";
1033 pp.queryAdd(
"buildings_type", buildings_type_temp);
1034 if (buildings_type_temp ==
"ImmersedForcing") {
1042 std::string init_type_temp_string;
1044 int found =
pp.queryAdd(
"init_type",init_type_temp_string);
1046 if ( (init_type_temp_string ==
"Real") || (init_type_temp_string ==
"real") ) {
1047 amrex::Error(
"erf.init_type = Real is deprecated; please replace Real by WRFInput");
1048 }
else if ( (init_type_temp_string ==
"Ideal") || (init_type_temp_string ==
"ideal") ) {
1049 amrex::Error(
"erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
1051 pp.query_enum_case_insensitive(
"init_type",
init_type);
1057 amrex::Error(
"Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
1061 if (
init_type == InitType::MoistBaseState) {
1063 amrex::Error(
"Makes no sense to have moist base state with no moisture model");
1069 amrex::Error(
"Can't have moisture_type = None with init_type = WRFInput");
1073 std::string nc_bdy_file_temp_string;
1074 bool has_bdy =
pp.queryAdd(
"nc_bdy_file", nc_bdy_file_temp_string);
1078 pp.queryAdd(
"use_real_bcs", use_real_bcs_temp);
1085 amrex::Print() <<
"init_type must now be set. The options are " << std::endl;
1086 amrex::Print() <<
" Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
1087 amrex::Print() <<
" ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
1088 amrex::Error(
"Please add a string for init_type to your inputs file or command line");
1092 if (
init_type == InitType::Input_Sounding) {
1102 amrex::Error(
"erf.flat_terrain requires terrain_type = StaticFittedMesh");
1107 if (
terrain_type == TerrainType::MovingFittedMesh && max_level > 0) {
1108 amrex::Error(
"erf.terrain_type = MovingFittedMesh requires amr.max_level = 0");
1114 amrex::Error(
"erf.buildings_type = ImmersedForcing is not supported with erf.terrain_type = EB");
1120 amrex::Error(
"erf.terrain_type = ImmersedForcing and erf.buildings_type = ImmersedForcing "
1121 "cannot be used together");
1129 amrex::Abort(
"SAM is not correct with variable dz -- choose another moisture model");
1133 const bool have_stretching_ratio =
pp.contains(
"grid_stretching_ratio");
1137 "The grid stretching ratio must be greater than 1");
1142 const bool solve_stretching_ratio = !have_stretching_ratio &&
pp.contains(
"initial_dz");
1147 if (
mesh_type == MeshType::ConstantDz) {
1150 pp.get(
"initial_dz",
dz0);
1155 if (
pp.contains(
"zsurface")) {
1156 amrex::Abort(
"erf.zsurface is no longer supported: a stretched vertical grid now starts "
1157 "at geometry.prob_lo[2], so set the bottom of the domain there instead");
1160 int n_zlevels =
pp.countval(
"terrain_z_levels");
1166 if (
mesh_type == MeshType::ConstantDz) {
1183 if (
pp.contains(
"use_wrf_height_grid")) {
1184 amrex::Abort(
"erf.use_wrf_height_grid has been renamed. "
1185 "Set erf.avg_grid_faces_to_nodes instead; it carries "
1186 "the same meaning (average the input z-face heights "
1187 "onto the nodes rather than reconstructing them).");
1199 amrex::Print() <<
"Must rebalance when not averaging the input height grid. Setting rebalance_wrf_input to true \n";
1208 amrex::Print() <<
"Setting use_gravity to true due to init_type = WRFInput / Metgrid " << std::endl;
1214 pp.queryAdd(
"c_p",
c_p);
1222 for (
int i = 0; i <= max_level; ++i) {
1225 if (
pp.contains(
"compressibility_type") &&
pp.contains(
"anelastic")) {
1226 amrex::Abort(
"Specify only one of erf.compressibility_type and erf.anelastic "
1227 "(erf.anelastic is deprecated)");
1229 if (
pp.contains(
"anelastic")) {
1230 amrex::Print() <<
"WARNING: erf.anelastic is deprecated; use erf.compressibility_type"
1231 <<
" = FullyCompressible, Anelastic or PseudoIncompressible" << std::endl;
1232 amrex::Vector<int> anelastic;
1234 for (
int i = 0; i <= max_level; ++i) {
1235 if (anelastic[i] != 0 && anelastic[i] != 1) {
1236 amrex::Abort(
"erf.anelastic must be 0 or 1");
1239 : CompressibilityType::FullyCompressible;
1242 for (
int i = 0; i <= max_level; ++i) {
1247 const bool fixed_density_given =
1256 bool any_anelastic =
false;
1257 bool any_compress =
false;
1258 for (
int i = 0; i <= max_level; ++i) {
1261 amrex::Print() <<
"WARNING: erf.fixed_density = 0 is ignored at level " << i
1262 <<
" because erf.compressibility_type is Anelastic there; the anelastic"
1263 <<
" equations always hold the density fixed in time." << std::endl;
1268 any_anelastic =
true;
1271 amrex::Print() <<
"WARNING: erf.fixed_density = 1 is ignored at level " << i
1272 <<
" because erf.compressibility_type is PseudoIncompressible there; the"
1273 <<
" pseudo-incompressible equations evolve the density." << std::endl;
1276 amrex::Print() <<
"WARNING: erf.buoyancy_type = " <<
buoyancy_type[i] <<
" is replaced by 1 at level "
1277 << i <<
" because erf.compressibility_type is PseudoIncompressible there; the"
1278 <<
" pseudo-incompressible buoyancy is -(rho - rho0) g." << std::endl;
1283 any_anelastic =
true;
1285 any_compress =
true;
1294 if (any_anelastic) {
1310 for (
int i = 0; i <= max_level; i++) {
1312 ? TimesteppingType::RK3_ImplicitSubstep : TimesteppingType::MidPoint;
1315 const bool substepping_type_given =
pp.contains(
"substepping_type");
1316 const bool anelastic_type_given =
pp.contains(
"anelastic_type");
1317 if (
pp.contains(
"timestepping_type")) {
1318 if (substepping_type_given || anelastic_type_given) {
1319 amrex::Abort(
"Specify erf.timestepping_type or the deprecated erf.substepping_type / "
1320 "erf.anelastic_type, not both");
1322 for (
int i = 0; i <= max_level; i++) {
1329 if (substepping_type_given) {
1330 amrex::Print() <<
"WARNING: erf.substepping_type is deprecated; use erf.timestepping_type"
1331 <<
" = RK3_ImplicitSubstep or RK3_NoSubstepping" << std::endl;
1332 for (
int i = 0; i <= max_level; i++) {
1333 SubsteppingType sub = SubsteppingType::Implicit;
1337 ? TimesteppingType::RK3_NoSubstepping
1338 : TimesteppingType::RK3_ImplicitSubstep;
1342 if (anelastic_type_given) {
1343 amrex::Print() <<
"WARNING: erf.anelastic_type is deprecated; use erf.timestepping_type"
1344 <<
" = RK2 or MidPoint" << std::endl;
1345 if (!any_anelastic) {
1346 amrex::Print() <<
"Ignoring erf.anelastic_type because every level is FullyCompressible"
1349 for (
int i = 0; i <= max_level; i++) {
1350 AnelasticType anelastic_scheme = AnelasticType::MidPoint;
1354 ? TimesteppingType::MidPoint : TimesteppingType::RK2;
1361 for (
int i = 0; i <= max_level; i++) {
1363 const bool rk3 = (
timestepping_type[i] == TimesteppingType::RK3_ImplicitSubstep ||
1366 amrex::Abort(
"erf.timestepping_type at level " + std::to_string(i) +
" must be " +
1367 (
fc ?
"RK3_ImplicitSubstep or RK3_NoSubstepping because the level is "
1369 :
"RK2 or MidPoint because the level is not FullyCompressible"));
1377 for (
int i = 0; i <= max_level; i++) {
1379 amrex::Abort(
"erf.terrain_type = MovingFittedMesh requires erf.timestepping_type = "
1380 "RK3_ImplicitSubstep or RK3_NoSubstepping (a FullyCompressible level) "
1381 "at level " + std::to_string(i));
1392 if (!(
beta_d >= amrex::Real(0.0) &&
beta_d <= amrex::Real(1.0))) {
1393 amrex::Abort(
"erf.beta_d must lie in [0, 1]; got " + std::to_string(
beta_d));
1411 int nvals_old =
pp.countval(
"no_substepping");
1412 if (nvals_old > 0) {
1413 amrex::Error(
"The no_substepping flag is deprecated -- set erf.timestepping_type instead");
1416 nvals_old =
pp.countval(
"beta_s_min");
1417 if (nvals_old > 0) {
1418 amrex::Error(
"The beta_s_min flag is deprecated -- remove it from the inputs file");
1420 nvals_old =
pp.countval(
"beta_s_max");
1421 if (nvals_old > 0) {
1422 amrex::Error(
"The beta_s_max flag is deprecated -- remove it from the inputs file");
1431 amrex::Error(
"erf.wall_dist_type must be poisson or terrain_height");
1436 amrex::Abort(
"erf.pi_drift_factor must be non-negative");
1442 if (
pp.contains(
"terrain_poisson_solver") &&
1444 amrex::Print() <<
"WARNING: erf.terrain_poisson_solver is ignored: it applies only to the "
1445 <<
"projection on a terrain-fitted mesh (erf.terrain_type = StaticFittedMesh "
1446 <<
"or MovingFittedMesh)" << std::endl;
1448 #ifdef AMREX_USE_FLOAT
1472 "forest_biophysics_heat requires forest_biophysics = true");
1476 "forest_biophysics_heat requires a positive forest_leaf_theta_fixed");
1479 "forest_leaf_theta_fixed requires forest_biophysics_heat = true");
1509 amrex::Print() <<
"erf.if_snap_partial_cells: using the point-implicit drag (erf.if_implicit_drag = true)\n";
1518 std::string if_wall_form_in =
"legacy";
1519 pp.queryAdd(
"if_wall_form", if_wall_form_in);
1520 if (if_wall_form_in ==
"fraction_stress") {
1522 }
else if (if_wall_form_in !=
"legacy") {
1523 amrex::Abort(
"erf.if_wall_form must be legacy or fraction_stress, not " + if_wall_form_in);
1530 std::string if_wall_face_spacing_in =
"log";
1531 pp.queryAdd(
"if_wall_face_spacing", if_wall_face_spacing_in);
1533 amrex::Abort(
"erf.if_wall_face_spacing belongs to erf.if_wall_form = fraction_stress");
1538 else { amrex::Abort(
"erf.if_wall_face_spacing must be log, physical or grid"); }
1547 amrex::Abort(
"erf.if_wall_tke = true and erf.if_wall_tke_time_factor != 1 belong to erf.if_wall_form = fraction_stress");
1550 amrex::Abort(
"erf.if_wall_tke_time_factor must be >= 1 (steps over which the wall TKE is relaxed)");
1559 amrex::Abort(
"erf.if_flat_wall_dissipation = true belongs to erf.if_wall_form = fraction_stress");
1563 amrex::Abort(
"erf.if_wall_form = fraction_stress needs erf.terrain_type = ImmersedForcing");
1566 amrex::Abort(
"erf.if_wall_form = fraction_stress is not available with erf.buildings_type = ImmersedForcing");
1569 amrex::Abort(
"erf.if_wall_form = fraction_stress is a wall law: it needs erf.if_use_most = true");
1571 if (
mesh_type != MeshType::ConstantDz) {
1572 amrex::Abort(
"erf.if_wall_form = fraction_stress needs a constant-dz mesh");
1577 amrex::Abort(
"erf.if_wall_form = fraction_stress runs only where erf.compressibility_type is not FullyCompressible on "
1578 "every level; it does not support erf.immersed_forcing_substep = true");
1582 for (
int lev = 0; lev <= max_level; ++lev) {
1584 amrex::Abort(
"erf.if_wall_form = fraction_stress needs erf.compressibility_type not FullyCompressible on every level (level " +
1585 std::to_string(lev) +
" is compressible)");
1593 amrex::Abort(
"erf.if_surf_heating_rate needs erf.if_init_surf_temp");
1596 amrex::Abort(
"erf.if_wall_form = fraction_stress always applies the stability functions; "
1597 "erf.if_stability_correction is for the legacy wall law");
1607 if (moist_flux_set || moist_surf_set) {
1609 amrex::Abort(
"erf.if_surf_moist_flux and erf.if_surf_moist belong to erf.if_wall_form = fraction_stress");
1611 if (moist_flux_set && moist_surf_set) {
1612 amrex::Abort(
"erf.if_surf_moist_flux and erf.if_surf_moist: give one surface moisture condition, not both");
1615 amrex::Abort(
"erf.if_surf_moist_flux / erf.if_surf_moist need a moisture model that carries water vapour "
1616 "(erf.moisture_model)");
1619 amrex::Abort(
"erf.if_surf_moist_flux must be in [-0.01, 0.01] kg/kg m/s (a kinematic surface moisture flux; "
1620 "0.0001 is a strong evaporation)");
1622 if (moist_surf_set && !(
if_surf_moist <= amrex::Real(0.1))) {
1623 amrex::Abort(
"erf.if_surf_moist must be in [0, 0.1] kg/kg (a surface water vapour mixing ratio)");
1642 amrex::Abort(
"erf.if_stability_wind_floor must be >= 0 [m/s] (0 leaves the wind as it is)");
1645 amrex::Abort(
"erf.if_psi_cap_factor must be in (0, 1] (1 caps psi at ln(z/z0))");
1651 amrex::Abort(
"erf.if_average_down must be plain or fluid_mass");
1657 amrex::Abort(
"erf.if_average_down = fluid_mass needs erf.terrain_type = ImmersedForcing "
1658 "or erf.buildings_type = ImmersedForcing");
1665 amrex::Abort(
"erf.if_cf_mismatch_warning must be in [0, 1] (a spread of solid fractions; 0 turns it off)");
1675 amrex::Abort(
"erf.cf_loglaw_z0 belongs to erf.cf_loglaw_fill = true");
1678 if (
mesh_type != MeshType::ConstantDz) {
1679 amrex::Abort(
"erf.cf_loglaw_fill needs a constant-dz mesh");
1682 amrex::Abort(
"erf.cf_loglaw_fill is not implemented for erf.terrain_type = EB "
1683 "(its wall is not the bottom of the domain)");
1698 amrex::Abort(
"erf.cf_loglaw_z0 must be > 0 [m] (the roughness length of the log-law coarse/fine fill)");
1704 (if_psi_cap_factor < one || if_stability_wind_floor >
zero))
1706 amrex::Print() <<
"Immersed wall law: erf.if_psi_cap_factor = " <<
if_psi_cap_factor
1708 <<
" m/s (WRF-style bounds; the defaults 1 and 0 turn them off)\n";
1715 amrex::Error(
"Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
1719 amrex::Abort(
"erf.if_Olen = 0 is not an Obukhov length: give a nonzero length [m] (a large |L| is near neutral)");
1727 amrex::ParmParse pp_eb2(
"eb2");
1730 amrex::Abort(
"eb2.small_volfrac must be in [0, 1) with immersed forcing");
1740 const bool if_terrain = (
terrain_type == TerrainType::ImmersedForcing);
1741 const bool if_buildings = (
buildings_type == BuildingsType::ImmersedForcing);
1742 if (!if_terrain && !if_buildings) {
1743 amrex::Abort(
"erf.if_implicit_projection needs erf.terrain_type = ImmersedForcing or "
1744 "erf.buildings_type = ImmersedForcing");
1746 if (
mesh_type == MeshType::VariableDz) {
1747 amrex::Abort(
"erf.if_implicit_projection needs a mesh without terrain-fitted coordinates "
1748 "(constant or stretched dz)");
1752 bool any_projecting_level =
false;
1753 for (
int lev = 0; lev <= max_level; ++lev) {
1755 any_projecting_level =
true;
1758 if (!any_projecting_level) {
1759 amrex::Abort(
"erf.if_implicit_projection needs erf.compressibility_type not FullyCompressible on at least one level");
1778 amrex::Abort(
"erf.const_massflux_tau must be > 0 (got " +
1793 amrex::Abort(
"Automatic perturbations require perturbation_auto_period > 0 and "
1794 "0 < perturbation_auto_pbl_fraction <= 1");
1797 for (
int lev = 0; lev <= max_level; ++lev) {
1800 pp,
"perturbation_type",
pert_type[lev], lev, max_level);
1803 amrex::Vector<amrex::Real> abl_pressure_grad_in = {
zero,
zero,
zero};
1804 pp.queryarr(
"abl_pressure_grad",abl_pressure_grad_in);
1805 for(
int i = 0; i < AMREX_SPACEDIM; ++i)
abl_pressure_grad[i] = abl_pressure_grad_in[i];
1807 amrex::Vector<amrex::Real> abl_geo_forcing_in = {
zero,
zero,
zero};
1808 if(
pp.queryarr(
"abl_geo_forcing",abl_geo_forcing_in)) {
1809 amrex::Print() <<
"Specified abl_geo_forcing: (";
1810 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
1814 amrex::Print() <<
")" << std::endl;
1838 amrex::Abort(
"erf.nudging_from_observations does not support erf.terrain_type = EB; "
1839 "use a terrain-fitted mesh or immersed forcing");
1842 int nudging_u_z1_set =
pp.queryAdd(
"nudging_u_z1",
nudging_u_z1);
1843 int nudging_u_z2_set =
pp.queryAdd(
"nudging_u_z2",
nudging_u_z2);
1850 "nudging_u_z1 must be less than or equal to nudging_u_z2");
1852 "nudging_t_z1 must be less than or equal to nudging_t_z2");
1854 "nudging_q_z1 must be less than or equal to nudging_q_z2");
1864 amrex::Print() <<
"WARNING: erf.nudging_u = false has no effect when erf.large_scale_forcing "
1865 "= true; momentum nudging is then controlled solely by large_scale_forcing.\n";
1867 if (nudging_u_z1_set || nudging_u_z2_set) {
1868 amrex::Print() <<
"WARNING: erf.nudging_u_z1/erf.nudging_u_z2 are ignored when "
1869 "erf.large_scale_forcing = true; momentum nudging is then applied "
1870 "at all heights.\n";
1876 "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
1887 "erf.num_diff_coeff must be 0: the 6th-order numerical diffusion is currently "
1888 "deactivated. Remove erf.num_diff_coeff or set it to 0.");
1900 amrex::Abort(
"erf.if_implicit_projection is not supported with thin immersed bodies "
1901 "(erf.zero_xflux_faces, erf.zero_yflux_faces, erf.zero_zflux_faces): "
1902 "set erf.if_implicit_projection = false or remove the thin bodies");
1908 for (
int lev = 0; lev <= max_level; ++lev) {
1910 amrex::Abort(
"Thin immersed bodies (erf.zero_xflux_faces, erf.zero_yflux_faces, "
1911 "erf.zero_zflux_faces) are not supported with "
1912 "erf.compressibility_type = PseudoIncompressible (level " +
1913 std::to_string(lev) +
")");
1922 bool any_projection =
false;
1924 auto eb_supports = [] (
AdvType t) {
1929 auto check_eb_adv = [&] (
const std::string&
name,
AdvType t) {
1930 if (!eb_supports(
t)) {
1932 " is not supported with erf.terrain_type = EB; use Centered_2nd, "
1933 "Upwind_3rd, Centered_4th, Upwind_5th or Centered_6th");
1946 for (
int lev = 0; lev <= max_level; ++lev) {
1955 for (
int lev = 0; lev <= max_level; ++lev) {
1957 amrex::Abort(
"erf.rayleigh_damping_type = SlowImplicit needs a level without acoustic"
1958 " substeps (anelastic, pseudo-incompressible or RK3_NoSubstepping); level " +
1959 std::to_string(lev) +
" takes them: use FastImplicit");
1966 for (
int lev = 0; lev <= max_level; ++lev) {
1970 amrex::Print() <<
"Level " << lev <<
" takes no acoustic substeps: Rayleigh damping is"
1971 <<
" applied on the slow step there" << std::endl;
1974 amrex::Print() <<
"Level " << lev <<
" takes no acoustic substeps: erf.forest_substep is"
1975 <<
" ignored there and canopy drag is applied on the slow step" << std::endl;
1978 amrex::Print() <<
"Level " << lev <<
" takes no acoustic substeps: erf.immersed_forcing_substep"
1979 <<
" is ignored there and immersed forcing is applied on the slow step" << std::endl;
1984 for (
int lev = 0; lev <= max_level; lev++) {
1985 turbChoice[lev].init_params(lev,max_level,pp_prefix);
1989 amrex::Abort(
"erf.rans_moist_buoyancy needs a moisture model that carries water vapour "
1990 "(erf.moisture_model; level " + std::to_string(lev) +
")");
1994 if (
turbChoice[lev].rans_shear_stencil == RANSShearStencil::log_law) {
1997 amrex::Abort(
"erf.rans_shear_stencil = log_law is not available with erf.terrain_type = EB or "
1998 "ImmersedForcing or erf.buildings_type = ImmersedForcing");
2002 amrex::Abort(
"erf.rans_shear_stencil = log_law is not available with erf.terrain_type = "
2003 "MovingFittedMesh");
2006 amrex::Abort(
"erf.rans_shear_stencil = log_law is not available with thin immersed bodies "
2007 "(erf.zero_xflux_faces, erf.zero_yflux_faces, erf.zero_zflux_faces)");
2015 for (
int lev = 0; lev <= max_level; ++lev) {
2017 if (lev == 0 || tc.les_type ==
LESType::None || tc.smag2d ||
2027 bool smag2d_requested =
false;
2028 bool smag2d_somewhere =
false;
2029 for (
int lev = 0; lev <= max_level; lev++) {
2030 smag2d_requested = smag2d_requested ||
turbChoice[lev].smag2d_limits_requested;
2031 smag2d_somewhere = smag2d_somewhere ||
turbChoice[lev].smag2d;
2033 if (smag2d_requested && !smag2d_somewhere) {
2034 amrex::Error(
"erf.smag2d_slope_limiter and erf.smag2d_kh_cap apply only to "
2035 "erf.les_type = Smagorinsky2D, which no level uses");
2037 for (
int lev = 0; lev <= max_level; lev++) {
2038 const bool fitted = (
terrain_type == TerrainType::StaticFittedMesh ||
2040 if (
turbChoice[lev].smag2d_slope_limiter && !fitted) {
2041 amrex::Error(
"erf.smag2d_slope_limiter requires erf.terrain_type = StaticFittedMesh "
2042 "or MovingFittedMesh");
2045 amrex::Error(
"erf.smag2d_kh_cap is not supported with erf.terrain_type = EB");
2052 if (
rad_type == RadiationType::RRTMGP) {
2058 "Topographic radiation requires erf.terrain_type = StaticFittedMesh");
2060 "Topographic radiation currently requires erf.radiation_model = RRTMGP");
2071 amrex::Print() <<
"WARNING: erf.land_surface_model = NOAHMP with erf.radiation_model = "
2072 << amrex::getEnumNameString(
rad_type)
2073 <<
": only RRTMGP and TwoStream supply the downwelling shortwave, "
2074 "downwelling longwave and solar zenith angle Noah-MP needs. Noah-MP "
2075 "will run with no radiative forcing (zero SWDOWN, GLW and COSZEN).\n";
2079 for (
int lev = 0; lev <= max_level; lev++) {
2087 for (
int lev = 0; lev <= max_level; lev++) {
2088 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
2092 amrex::Print() <<
"YSU PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
2095 amrex::Error(
"YSU cannot use ERF coriolis frequency if not using coriolis");
2100 for (
int lev = 0; lev <= max_level; lev++) {
2101 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
2105 amrex::Print() <<
"MRF PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
2108 amrex::Error(
"MRF cannot use ERF coriolis frequency if not using coriolis");
2134 if (bdy_moist_nudge_type < 0 || bdy_moist_nudge_type > 2) {
2135 amrex::Error(
"erf.bdy_moist_nudge_type must be one of 0, 1, or 2");
2141 for (
int lev = 0; lev <= max_level; ++lev) {
2149 int n_impfac =
pp.countval(
"vert_implicit_fac");
2151 if (n_impfac == 1) {
2153 pp.get(
"vert_implicit_fac", fac_in);
2154 for (
int lev = 0; lev <= max_level; lev++) {
2155 for (
int i=0; i<3; ++i) {
2159 }
else if (n_impfac == 3) {
2160 for (
int lev = 0; lev <= max_level; lev++) {
2166 const bool user_set_imp_thermal =
pp.contains(
"implicit_thermal_diffusion");
2167 const bool user_set_imp_moisture =
pp.contains(
"implicit_moisture_diffusion");
2168 const bool user_set_imp_ke =
pp.contains(
"implicit_ke_diffusion");
2169 const bool user_set_imp_momentum =
pp.contains(
"implicit_momentum_diffusion");
2190 for (
int lev = 0; lev <= max_level; lev++) {
2192 amrex::Print() <<
"implicit_before_substep cannot be false without substepping; setting to true." <<
"\n";
2201 if (!host_owns_scalars &&
2205 amrex::Print() <<
"Ignoring erf.implicit_{thermal,moisture,ke}_diffusion = true; "
2206 <<
"SHOC owns vertical scalar diffusion." <<
"\n";
2209 amrex::Print() <<
"Ignoring erf.implicit_momentum_diffusion = true; "
2210 <<
"SHOC owns vertical momentum diffusion." <<
"\n";
2219 if (!host_owns_scalars && !host_owns_momentum) {
2220 amrex::Print() <<
"Turning off vertical implicit solve for all components since SHOC owns diffusion." <<
"\n";
2222 amrex::Print() <<
"SHOC hands vertical diffusion of"
2223 << (host_owns_scalars ?
" scalars" :
"")
2224 << (host_owns_momentum ?
" momentum" :
"")
2225 <<
" to the host; keeping the vertical implicit solve on (theta = "
2234 bool do_vert_implicit =
true;
2235 pp.queryAdd(
"vert_implicit", do_vert_implicit);
2236 if (!do_vert_implicit) {
2237 for (
int lev = 0; lev <= max_level; lev++) {
2238 amrex::Print() <<
"Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
2252 for (
int lev = 0; lev <= max_level; lev++) {
2255 amrex::Print() <<
"Turning off native vertical implicit solve flag because anelastic at level " << lev
2256 <<
" with RK2 scheme." << std::endl;
2262 amrex::Print() <<
"Forcing implicit factor 1 in first stage of MidPoint to ensure second-order accuracy." << std::endl;
2266 amrex::Print() <<
"Turning off the second-stage vertical implicit solve at level " << lev
2267 <<
" because anelastic with MidPoint solves in the first stage only."
2279 for (
int lev = 0; lev <= max_level; lev++) {
2280 if (do_vert_implicit) {
2281 amrex::Print() <<
"Implicit diffusion is not supported with EB; turning off at level " << lev <<
"\n";
2292 for (
int lev = 0; lev <= max_level; lev++) {
2294 amrex::Error(
"erf.terrain_type = EB cannot be used with erf.les_type = Deardorff "
2295 "or erf.rans_type = kEqn: the EB diffusion path has no TKE sources");
2305 amrex::Print() <<
"Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
2306 for (
int lev = 0; lev <= max_level; lev++) {
2319 if (any_anelastic && any_compress) {
2355 amrex::Error(
"erf.mean_vars_reset_mode must be either 'plotfile' or 'time'");
2359 amrex::Error(
"erf.mean_vars_reset_time must be non-negative when "
2360 "erf.mean_vars_reset_mode = 'time'");
2369 amrex::Print() <<
"WARNING: erf.init_type = hindcast without erf.hindcast_lateral_forcing:"
2370 <<
" Coriolis uses the variable latitude (erf.variable_coriolis)" << std::endl;
2372 amrex::Print() <<
"WARNING: erf.init_type = hindcast without erf.hindcast_lateral_forcing:"
2373 <<
" Coriolis uses the constant erf.latitude"
2374 << (
pp.contains(
"latitude") ?
"" :
", which is not set (default 90 degrees)")
2383 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
2387 amrex::Error(
"ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
2388 "data files is either missing or set to less than zero");
2399 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
2403 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
2407 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_length' or it is specified to be less than zero");
2411 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
2425 amrex::Error(
"ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
2426 " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
2427 " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
2428 " location of the eye in the initial condition");
2433 amrex::Error(
"ERROR: 'erf.io_hurricane_eye_tracker' with erf.init_type = hindcast needs"
2434 " erf.hindcast_lateral_forcing = true: the tracker reads latitude and longitude"
2435 " from the forecast state, which only lateral forcing provides");
2441 amrex::ParmParse pp_ens(
"ensemble");
2444 amrex::Abort(
"You are using an ensemble run. There needs to be at least 2 ensemble members. "
2445 "erf.n_ensemble must be >=2.");
2449 amrex::Abort(
"coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
2450 "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
2451 "which contains the filename in the inputs.");
2455 amrex::Error(
"You are using initialization for ensemble simulations using the inputs option "
2456 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
2457 "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
2458 "to be added to the background state and has to be greater than 0.0");
2462 amrex::Error(
"You are using initialization with spatially correlated perturbations using the inputs option "
2463 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
2464 "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
2465 "and has to be greater than 0.0");
2476 void check_params (
int max_level,
const amrex::Vector<amrex::Geometry>& geom_vect, amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type)
2480 if (max_level > 0 &&
coupling_type == CouplingType::TwoWay) {
2481 amrex::Print() <<
"Immersed forcing: erf.if_average_down = fluid_mass (the cell average down "
2482 <<
"over refined levels is weighted by the fluid mass of the fine cells)\n";
2484 amrex::Warning(
"erf.if_average_down = fluid_mass has no effect without refined levels "
2485 "(amr.max_level > 0) and erf.coupling_type = TwoWay");
2491 for (
int lev = 0; lev <= max_level; ++lev) {
2492 const amrex::Real
dz = geom_vect[lev].CellSize(2);
2493 if (!(
if_z0 < amrex::Real(0.25) *
dz)) {
2494 amrex::Abort(
"erf.if_wall_form = fraction_stress needs erf.if_z0 < dz/4 on every level (level " +
2495 std::to_string(lev) +
": z0 = " + std::to_string(
if_z0) +
" m, dz = " +
2496 std::to_string(
dz) +
" m)");
2501 bool any_keqn =
false;
2502 for (
int lev = 0; lev <= max_level; ++lev) {
2503 any_keqn = any_keqn || (
turbChoice[lev].rans_type == RANSType::kEqn);
2506 amrex::Abort(
"erf.if_wall_tke and erf.if_flat_wall_dissipation act on the k-eqn RANS closure: "
2507 "set erf.rans_type = kEqn on a level, or turn them off (erf.if_flat_wall_dissipation = false)");
2511 amrex::Print() <<
"Immersed forcing: erf.if_wall_form = fraction_stress (wall stress in the wall cell, "
2512 <<
"the wall face closed to diffusion; face spacing "
2517 amrex::Print() <<
"Immersed forcing: the moisture species see a closed wall "
2518 <<
"(no diffusion through the wall face, held in the solid); surface moisture condition: ";
2520 amrex::Print() <<
"flux erf.if_surf_moist_flux = " <<
if_surf_moist_flux <<
" kg/kg m/s (q* = -F_q/u*)";
2522 amrex::Print() <<
"surface mixing ratio erf.if_surf_moist = " <<
if_surf_moist <<
" kg/kg";
2524 amrex::Print() <<
"none (q* = 0)";
2529 amrex::Print() <<
"; the Obukhov length uses theta_v and theta_v* = theta* (1 + epsv qv) + epsv theta q*";
2531 amrex::Print() <<
"\n";
2536 const bool immersed = (
terrain_type == TerrainType::ImmersedForcing ||
2538 if (!immersed && phys_bc_type[amrex::Orientation(amrex::Direction::z, amrex::Orientation::low)] !=
ERF_BC::surface_layer) {
2539 amrex::Abort(
"erf.cf_loglaw_fill needs an immersed surface (erf.terrain_type or "
2540 "erf.buildings_type = ImmersedForcing) or zlo.type = surface_layer");
2542 if (max_level > 0) {
2543 amrex::Print() <<
"Coarse/fine faces: erf.cf_loglaw_fill = true (the wall coarse face's flux is shared "
2544 <<
"among its fine sub-faces by the integral of ln(1 + z/z0), z0 = " <<
cf_loglaw_z0 <<
" m)\n";
2546 amrex::Warning(
"erf.cf_loglaw_fill has no effect without refined levels (amr.max_level > 0)");
2551 amrex::Abort(
"Automatic perturbations currently support flat, stretched, and fitted-terrain meshes; "
2552 "immersed/embedded terrain requires a ground-relative parent PBL-height conversion");
2556 for (
int lev = 0; lev <= max_level; lev++) {
2558 amrex::Warning(
"\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
2565 for (
int lev = 0; lev <= max_level; lev++) {
2567 amrex::Error(
"buoyancy_type must be 1, 2, 3 or 4");
2572 amrex::Error(
"Can't turn off lagged_delta_rt when terrain not moving");
2579 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
2580 " erf.sampling_distance_by_D in the inputs which specifies the upstream"
2581 " distance as a factor of the turbine diameter at which the incoming free stream"
2582 " velocity will be computed at.");
2586 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
2587 " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
2588 " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
2589 " will have turb_disk_angle value of 90 deg.");
2591 #ifdef ERF_USE_WINDFARM
2594 amrex::Error(std::string(
"erf.windfarm_type = ") + amrex::getEnumNameString(
windfarm_type)
2595 +
" needs erf.windfarm_loc_type, either lat_lon or x_y, with the turbine locations"
2596 " in erf.windfarm_loc_table and their specifications in erf.windfarm_spec_table.");
2600 amrex::Error(
"You are using windfarms with latitude-logitude option to position the turbines."
2601 " For this you should provide the inputs erf.windfarm_x_shift and"
2602 " erf.windfarm_y_shift which are the values by which the bounding box of the"
2603 " windfarm is shifted from the x and the y axes.");
2608 amrex::Error(
"Constant mass flux (in x) should be used with periodic boundaries");
2612 amrex::Error(
"Constant mass flux (in y) should be used with periodic boundaries");
2616 for (
int lev = 0; lev <= max_level; lev++) {
2617 if ((geom_vect[lev].CellSize(0) > amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) > amrex::Real(2000.)))
2620 amrex::Warning(
"Should use 2-D Smagorinsky for mesoscale resolution");
2621 }
else if (
turbChoice[lev].les_type == LESType::Deardorff) {
2622 amrex::Warning(
"Should not use Deardorff LES for mesoscale resolution");
2629 for (
int lev = 1; lev <= max_level; lev++) {
2630 l_use_kturb = (l_use_kturb ||
turbChoice[lev].use_kturb);
2634 for (
int lev = 0; lev <= max_level; lev++) {
2638 if (l_implicit_diff && !l_use_diff) {
2639 amrex:: Print() <<
"No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
2648 max_level > 0 && l_use_diff) {
2649 amrex::Warning(
"erf.coupling_type = TwoWay with erf.terrain_type = EB does not reflux the "
2650 "diffusive fluxes: diffusion does not conserve the scalars across "
2651 "coarse/fine boundaries");
2658 if (
mesh_type != MeshType::VariableDz) {
2659 amrex::Abort(
"erf.implicit_terrain_metric = true requires a terrain-fitted mesh with "
2660 "non-flat terrain (erf.terrain_type = StaticFittedMesh or MovingFittedMesh); "
2661 "on a flat or a purely stretched mesh there are no terrain-metric terms");
2668 for (
int lev = 0; lev <= max_level; lev++) {
2669 for (
int i = 0; i < 3; ++i) {
2671 amrex::Abort(
"erf.implicit_terrain_metric = true needs the vertical implicit solve "
2672 "in every Runge-Kutta stage at every level, but erf.vert_implicit_fac "
2673 "is not positive in stage " + std::to_string(i+1) +
" at level " +
2674 std::to_string(lev) +
". Set erf.vert_implicit_fac = 1 1 1; the "
2675 "option cannot be used where the implicit solve is turned off "
2676 "(erf.vert_implicit = false, every erf.implicit_*_diffusion = false, "
2677 "no molecular or turbulent diffusion, or anelastic, which solves in "
2678 "its first stage only or not at all)");
2685 amrex::Print() <<
"WARNING: erf.implicit_terrain_metric = true with "
2686 <<
"erf.implicit_momentum_diffusion = false: the momentum terrain-metric "
2687 <<
"terms stay explicit; only the scalars are treated implicitly" << std::endl;
2689 }
else if (
mesh_type == MeshType::VariableDz) {
2694 bool explicit_stage_with_kh =
false;
2695 for (
int lev = 0; lev <= max_level; lev++) {
2697 for (
int i = 0; i < 3; ++i) {
2701 if (explicit_stage_with_kh) {
2702 amrex::Print() <<
"NOTE: terrain-fitted mesh with an LES closure (horizontal eddy "
2703 <<
"viscosity K_h) and an explicit vertical-diffusion stage "
2704 <<
"(erf.vert_implicit_fac has a zero): the terrain-metric term "
2705 <<
"K_h h^2 d2/dz2 stays explicit there and limits the time step on "
2706 <<
"steep slopes. To relax it, use erf.vert_implicit_fac = 1 1 1 with "
2707 <<
"erf.implicit_terrain_metric = true, or erf.smag2d_slope_limiter = true "
2708 <<
"for Smagorinsky2D; erf.diffusive_dt_check reports the limit."
2714 for (
int lev = 0; lev <= max_level; lev++) {
2715 if (
turbChoice[lev].enable_mrf_countergradient) {
2720 "enable_mrf_countergradient requires vert_implicit_fac > 0");
2723 "enable_mrf_countergradient requires implicit_thermal_diffusion = true");
2727 "enable_mrf_countergradient with moisture requires implicit_moisture_diffusion = true");
2732 for (
int lev = 0; lev <= max_level; lev++) {
2742 void display (
int max_level, std::string pp_prefix)
2744 amrex::Print() <<
"SOLVER CHOICE: " << std::endl;
2746 amrex::Print() <<
"Automatic LES-nest perturbations: parent update period = "
2750 for (
int lev = 0; lev <= max_level; lev++) {
2751 amrex::Print() <<
"At level " << lev <<
" : " << std::endl;
2754 ?
" pseudo-incompressible" :
" anelastic")
2755 <<
" with no substepping, using the "
2756 << ((
timestepping_type[lev] == TimesteppingType::MidPoint) ?
"MidPoint" :
"RK2")
2757 <<
" integrator" << std::endl;
2760 amrex::Print() <<
" compressible with no substepping" << std::endl;
2762 amrex::Print() <<
" compressible with implicit substepping" << std::endl;
2766 amrex::Print() <<
" and fixed density" << std::endl;
2770 for (
int lev = 0; lev <= max_level; lev++) {
2771 amrex::Print() <<
"vert_implicit_fac at level " << lev <<
" : "
2784 amrex::Print() <<
"; terrain metric implicit";
2786 amrex::Print() <<
")";
2789 amrex::Print() << std::endl;
2790 amrex::Print() <<
"use_coriolis : " <<
use_coriolis << std::endl;
2791 amrex::Print() <<
"use_gravity : " <<
use_gravity << std::endl;
2794 amrex::Print() <<
"Moisture Model: SAM" << std::endl;
2796 amrex::Print() <<
"Moisture Model: SAM No Ice" << std::endl;
2797 }
else if (
moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
2798 amrex::Print() <<
"Moisture Model: SAM No Precip No Ice" << std::endl;
2800 amrex::Print() <<
"Moisture Model: Morrison" << std::endl;
2802 amrex::Print() <<
"Moisture Model: Morrison_NoIce" << std::endl;
2804 amrex::Print() <<
"Moisture Model: WSM6" << std::endl;
2806 amrex::Print() <<
"Moisture Model: WDM6" << std::endl;
2808 amrex::Print() <<
"Moisture Model: Kessler" << std::endl;
2810 amrex::Print() <<
"Moisture Model: Kessler No Rain" << std::endl;
2812 amrex::Print() <<
"Moisture Model: Saturation Adjustment" << std::endl;
2814 amrex::Print() <<
"Moisture Model: SuperDroplets" << std::endl;
2815 }
else if (
moisture_type == MoistureType::MoistNoCondensation) {
2816 amrex::Print() <<
"Moisture Model: MoistNoCondensation" << std::endl;
2818 amrex::Print() <<
"Moisture Model: SBM mapped spectral advection (M3)" << std::endl;
2820 amrex::Print() <<
"Moisture Model: None" << std::endl;
2824 amrex::Print() <<
"Terrain Type: StaticFittedMesh" << std::endl;
2825 }
else if (
terrain_type == TerrainType::MovingFittedMesh) {
2826 amrex::Print() <<
"Terrain Type: MovingFittedMesh" << std::endl;
2828 amrex::Print() <<
"Terrain Type: EB" << std::endl;
2830 }
else if (
terrain_type == TerrainType::ImmersedForcing) {
2831 amrex::Print() <<
"Terrain Type: ImmersedForcing" << std::endl;
2833 amrex::Print() <<
"Terrain Type: None" << std::endl;
2836 amrex::Print() <<
"Flat fitted terrain: "
2840 amrex::Print() <<
"Buildings Type: ImmersedForcing" << std::endl;
2842 amrex::Print() <<
"Buildings Type: None" << std::endl;
2845 if (
mesh_type == MeshType::ConstantDz) {
2846 amrex::Print() <<
" Mesh Type: ConstantDz" << std::endl;
2847 }
else if (
mesh_type == MeshType::StretchedDz) {
2848 amrex::Print() <<
" Mesh Type: StretchedDz" << std::endl;
2849 }
else if (
mesh_type == MeshType::VariableDz) {
2850 amrex::Print() <<
" Mesh Type: VariableDz" << std::endl;
2852 amrex::Error(
"No mesh_type set!");
2855 amrex::Print() <<
"ABL Driver Type: " << std::endl;
2857 amrex::Print() <<
" None" << std::endl;
2859 amrex::Print() <<
" Pressure Gradient "
2863 amrex::Print() <<
" Geostrophic Wind "
2868 if (max_level > 0) {
2869 amrex::Print() <<
"Coupling Type: " << std::endl;
2871 amrex::Print() <<
" Two-way" << std::endl;
2873 amrex::Print() <<
" One-way" << std::endl;
2877 if (
rad_type == RadiationType::RRTMGP) {
2878 amrex::Print() <<
"Radiation Model: RRTMGP" << std::endl;
2879 }
else if (
rad_type == RadiationType::Simple) {
2880 amrex::Print() <<
"Radiation Model: Simple" << std::endl;
2881 }
else if (
rad_type == RadiationType::TwoStream) {
2882 amrex::Print() <<
"Radiation Model: TwoStream" << std::endl;
2884 amrex::Print() <<
"Radiation Model: None" << std::endl;
2887 amrex::Print() <<
"Gradp_type : " << amrex::getEnumNameString(
gradp_type) << std::endl;
2890 for (
int lev = 0; lev <= max_level; lev++) {
2891 amrex::Print() <<
"Buoyancy_type at level " << lev <<
" : " <<
buoyancy_type[lev] << std::endl;
2899 for (
int lev = 0; lev <= max_level; lev++) {
2910 amrex::ParmParse
pp(pp_prefix);
2913 double rot_time_period = 86400.0;
2914 pp.queryAdd(
"rotational_time_period", rot_time_period);
2921 amrex::Real latitude_for_coriolis = amrex::Real(90.0);
2922 pp.queryAdd(
"latitude", latitude_for_coriolis);
2923 latitude_for_coriolis *= (
PI/amrex::Real(180.));
2924 sinphi = std::sin(latitude_for_coriolis);
2928 cosphi = std::cos(latitude_for_coriolis);
2936 amrex::Vector<amrex::Real> abl_geo_wind(3);
2937 pp.queryarr(
"abl_geo_wind",abl_geo_wind);
2946 amrex::Print() <<
"NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
2960 amrex::Vector<int>& vec_to_fill,
int default_int)
2962 amrex::ParmParse
pp(
"erf");
2963 int nvals =
pp.countval(string_to_read);
2965 amrex::Vector<int> temp; temp.resize(nvals);
2966 pp.queryarr(string_to_read,temp);
2968 if (vec_to_fill.size() < max_level+1) {
2969 vec_to_fill.resize(max_level+1);
2973 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
2974 }
else if (nvals == 1) {
2975 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
2977 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
3073 #ifdef AMREX_USE_FLOAT
3235 std::sqrt(len[0] * len[1]) <=
3236 amrex::Real(50.0) * (
one + amrex::Real(1.e-6));
3269 if (
mesh_type != MeshType::ConstantDz) {
return true; }
3315 return pert_type[lev] == PerturbationType::Source ||
3316 pert_type[lev] == PerturbationType::Direct ||
3317 pert_type[lev] == PerturbationType::CPM ||
3318 pert_type[lev] == PerturbationType::CPM_W;
3328 return pert_type[lev] == PerturbationType::Direct ||
3329 pert_type[lev] == PerturbationType::CPM ||
3330 pert_type[lev] == PerturbationType::CPM_W;
3340 return pert_type[lev] == PerturbationType::Source;
3350 return pert_type[lev] == PerturbationType::CPM_W;
3398 if (type == PerturbationType::Source ||
3399 type == PerturbationType::Direct ||
3400 type == PerturbationType::CPM ||
3401 type == PerturbationType::CPM_W) {
3412 for (
int source = lev-1; source >= 0; --source) {
3415 for (
int source = lev-1; source >= 0; --source) {
3417 if (tc.les_type !=
LESType::None && !tc.smag2d) {
return source; }
3470 return (
rad_type == RadiationType::RRTMGP) || (
rad_type == RadiationType::Simple);
3484 return (
rad_type == RadiationType::RRTMGP) ||
3485 (
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:246
TauType
Stress tensor component indices.
Definition: ERF_DataStruct.H:50
@ tau12
Definition: ERF_DataStruct.H:51
@ tau23
Definition: ERF_DataStruct.H:51
@ tau33
Definition: ERF_DataStruct.H:51
@ tau22
Definition: ERF_DataStruct.H:51
@ tau11
Definition: ERF_DataStruct.H:51
@ tau32
Definition: ERF_DataStruct.H:51
@ tau31
Definition: ERF_DataStruct.H:51
@ tau21
Definition: ERF_DataStruct.H:51
@ tau13
Definition: ERF_DataStruct.H:51
Rayleigh
Rayleigh damping profile component indices.
Definition: ERF_DataStruct.H:234
@ ubar
Definition: ERF_DataStruct.H:235
@ wbar
Definition: ERF_DataStruct.H:235
@ nvars
Definition: ERF_DataStruct.H:235
@ vbar
Definition: ERF_DataStruct.H:235
@ thetabar
Definition: ERF_DataStruct.H:235
Sponge
Sponge reference-state component indices.
Definition: ERF_DataStruct.H:242
@ nvars_sponge
Definition: ERF_DataStruct.H:243
@ vbar_sponge
Definition: ERF_DataStruct.H:243
@ ubar_sponge
Definition: ERF_DataStruct.H:243
MapFacType
Indices for map scale factors on mass and face grids.
Definition: ERF_DataStruct.H:38
@ v_x
Definition: ERF_DataStruct.H:40
@ num
Definition: ERF_DataStruct.H:40
@ u_y
Definition: ERF_DataStruct.H:41
@ v_y
Definition: ERF_DataStruct.H:41
@ m_y
Definition: ERF_DataStruct.H:41
@ u_x
Definition: ERF_DataStruct.H:40
@ m_x
Definition: ERF_DataStruct.H:40
Coord
Coordinate-axis selector.
Definition: ERF_DataStruct.H:226
AMREX_ENUM(PlotFileType, None, Amrex, Netcdf)
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:81
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:79
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:80
#define RhoQ11_comp
Definition: ERF_IndexDefines.H:88
#define RhoQ9_comp
Definition: ERF_IndexDefines.H:86
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:78
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:83
#define RhoQ8_comp
Definition: ERF_IndexDefines.H:85
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:82
#define RhoQ7_comp
Definition: ERF_IndexDefines.H:84
AdvType
Definition: ERF_IndexDefines.H:329
#define RhoQ10_comp
Definition: ERF_IndexDefines.H:87
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)
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > LengthScaleCellSize(const amrex::Geometry &geom)
Definition: ERF_LengthScaleCellSize.H:28
similarity_funs read_most_similarity_funs(amrex::ParmParse &pp, const std::string &who="Surface layer")
Definition: ERF_MOSTUtils.H:379
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:46
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:139
Radiation model type and control parameters.
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:95
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:187
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
@ fc
Definition: ERF_AdvanceMorrison.cpp:141
@ dz
Definition: ERF_AdvanceWDM6.cpp:273
@ t
Definition: ERF_WSM6.H:295
Definition: ERF_AdvStruct.H:19
void display(std::string &pp_prefix)
Print the configured advection choices.
Definition: ERF_AdvStruct.H:240
void init_params(std::string pp_prefix)
Read advection options from the input parameter database.
Definition: ERF_AdvStruct.H:25
bool have_zero_flux_faces
Whether any zero-flux thin immersed-body faces were specified.
Definition: ERF_AdvStruct.H:424
AdvType dycore_vert_adv_type
Vertical advection scheme for dynamical-core variables.
Definition: ERF_AdvStruct.H:404
AdvType moistscal_vert_adv_type
Vertical advection scheme for moist scalar variables.
Definition: ERF_AdvStruct.H:408
AdvType dryscal_horiz_adv_type
Horizontal advection scheme for dry scalar variables.
Definition: ERF_AdvStruct.H:405
AdvType dycore_horiz_adv_type
Horizontal advection scheme for dynamical-core variables.
Definition: ERF_AdvStruct.H:403
AdvType moistscal_horiz_adv_type
Horizontal advection scheme for moist scalar variables.
Definition: ERF_AdvStruct.H:407
std::string adv_type_convert_int_to_string(AdvType adv_int)
Convert an advection type enum to the corresponding input string.
Definition: ERF_AdvStruct.H:329
AdvType dryscal_vert_adv_type
Vertical advection scheme for dry scalar variables.
Definition: ERF_AdvStruct.H:406
Definition: ERF_CanopyTurbStruct.H:16
void init_params(amrex::ParmParse &pp)
Definition: ERF_CanopyTurbStruct.H:32
Definition: ERF_DampingStruct.H:22
RayleighDampingType rayleigh_damping_type
Selected Rayleigh damping time-integration treatment.
Definition: ERF_DampingStruct.H:116
void init_params(std::string pp_prefix)
Read damping options from the input parameter database.
Definition: ERF_DampingStruct.H:28
bool rayleigh_damp_W
Whether Rayleigh damping is applied to vertical momentum.
Definition: ERF_DampingStruct.H:101
bool rayleigh_damping_type_given
Definition: ERF_DampingStruct.H:117
void display()
Print the configured damping options.
Definition: ERF_DampingStruct.H:76
Definition: ERF_DiffStruct.H:25
MolecDiffType molec_diff_type
Selected molecular transport model.
Definition: ERF_DiffStruct.H:97
void init_params(std::string pp_prefix)
Read diffusion options from the input parameter database.
Definition: ERF_DiffStruct.H:31
void display()
Print the configured diffusion options.
Definition: ERF_DiffStruct.H:80
Definition: ERF_EBStruct.H:36
void display()
Print the configured embedded-boundary options.
Definition: ERF_EBStruct.H:74
void init_params(std::string pp_prefix, bool requires_cover)
Read embedded-boundary options from the input parameter database.
Definition: ERF_EBStruct.H:44
An ordered list of conserved-state components forming an aggregate moisture output variable (qt,...
Definition: ERF_DataStruct.H:542
int comp[max_size]
Definition: ERF_DataStruct.H:544
int size
Definition: ERF_DataStruct.H:545
bool empty() const
Definition: ERF_DataStruct.H:551
void append(int c)
Append a component, ignoring the ones the scheme does not carry.
Definition: ERF_DataStruct.H:548
static constexpr int max_size
qv, qc, qi, qr, qs, qg
Definition: ERF_DataStruct.H:543
Whether this map decides a variable's availability, and if so whether the variable is available.
Definition: ERF_DataStruct.H:671
bool available
the active scheme carries the data behind it
Definition: ERF_DataStruct.H:673
bool governed
the name is a moisture output variable
Definition: ERF_DataStruct.H:672
The moisture data carried by the active microphysics scheme.
Definition: ERF_DataStruct.H:279
int nc
cloud liquid water number
Definition: ERF_DataStruct.H:300
int qs
snow
Definition: ERF_DataStruct.H:294
int cond_rate
condensation rate
Definition: ERF_DataStruct.H:329
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:632
int nn
CCN / total aerosol number.
Definition: ERF_DataStruct.H:310
int qr
rain
Definition: ERF_DataStruct.H:293
static constexpr int absent
not carried by the active scheme
Definition: ERF_DataStruct.H:282
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:594
int precip_accum
accumulated surface precipitation, all species
Definition: ERF_DataStruct.H:327
MoistureComponentIndices()=default
Construct an empty map, i.e. a dry run.
int qi
cloud ice
Definition: ERF_DataStruct.H:292
int rel_hum
relative humidity
Definition: ERF_DataStruct.H:328
int graupel_accum
accumulated surface graupel
Definition: ERF_DataStruct.H:326
static constexpr int computed_from_state
Definition: ERF_DataStruct.H:283
int ni
cloud ice number
Definition: ERF_DataStruct.H:301
int qv
water vapor
Definition: ERF_DataStruct.H:290
int rain_accum
accumulated surface rain
Definition: ERF_DataStruct.H:324
CompList nonprecipitating_comps() const
Components summed for non-precipitating water, "qn": vapor plus the suspended condensate....
Definition: ERF_DataStruct.H:570
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:610
int snow_accum
accumulated surface snow
Definition: ERF_DataStruct.H:325
CompList total_water_comps() const
Components summed for total water, "qt": every mass mixing ratio.
Definition: ERF_DataStruct.H:559
int nr
rain number
Definition: ERF_DataStruct.H:302
int qc
cloud liquid water
Definition: ERF_DataStruct.H:291
int ng
graupel number
Definition: ERF_DataStruct.H:304
CompList precipitating_comps() const
Components summed for precipitating water, "qp": the falling species.
Definition: ERF_DataStruct.H:579
int qg
graupel
Definition: ERF_DataStruct.H:295
bool has_moisture() const
Test whether the active scheme carries any moisture at all.
Definition: ERF_DataStruct.H:620
int ns
snow number
Definition: ERF_DataStruct.H:303
VarAvailability query_var(const std::string &name) const
Classify an output variable name against this index map.
Definition: ERF_DataStruct.H:687
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:733
static MoistureComponentIndices from_moisture_model(const MoistureType moisture_type)
Build the complete index map – conserved-state components and qmoist diagnostic slots – for a moistur...
Definition: ERF_DataStruct.H:385
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:351
int qmoist_index_for_var(const std::string &name) const
The qmoist slot behind a moist diagnostic output name.
Definition: ERF_DataStruct.H:657
Definition: ERF_RadStruct.H:83
void read(const std::string &prefix)
Definition: ERF_RadStruct.H:89
Container holding radiation-related choices and parameters.
Definition: ERF_RadStruct.H:142
void init_params(bool two_stream_selected, std::string pp_prefix)
Definition: ERF_RadStruct.H:1064
Definition: ERF_DataStruct.H:743
bool use_coupled_sst
Definition: ERF_DataStruct.H:3489
int sbm_moment_mode
Definition: ERF_DataStruct.H:3435
bool custom_geostrophic_profile
Whether a custom geostrophic wind profile is used.
Definition: ERF_DataStruct.H:3167
int n_ensemble
Number of ensemble members.
Definition: ERF_DataStruct.H:3571
WindFarmLocType windfarm_loc_type
Coordinate system for wind-farm turbine locations.
Definition: ERF_DataStruct.H:3461
bool implicit_before_substep
Whether implicit diffusion is applied before acoustic substepping.
Definition: ERF_DataStruct.H:3065
amrex::Real const_massflux_v
Target constant mass flux in the y direction.
Definition: ERF_DataStruct.H:3552
std::string hindcast_boundary_data_dir
Directory containing hindcast lateral boundary data.
Definition: ERF_DataStruct.H:3559
amrex::Real if_psi_cap_factor
Cap on psi_m in the immersed momentum wall law as a fraction of ln(z/z0) (1: none).
Definition: ERF_DataStruct.H:3134
amrex::Real ens_pert_correlated_radius
Spatial correlation radius for ensemble perturbations.
Definition: ERF_DataStruct.H:3572
amrex::Real forest_leaf_theta_fixed
Definition: ERF_DataStruct.H:3546
static InitType init_type
Initial-condition source selected for the run.
Definition: ERF_DataStruct.H:2983
amrex::Real coriolis_factor
Twice the planetary rotation rate used for Coriolis forcing.
Definition: ERF_DataStruct.H:3157
bool if_drag_in_projection(int lev) const noexcept
Definition: ERF_DataStruct.H:3223
int perturbation_pblh_level(int lev) const
Definition: ERF_DataStruct.H:3410
bool io_hurricane_eye_tracker
Whether hurricane-eye tracking output is enabled.
Definition: ERF_DataStruct.H:3567
static bool flat_terrain
Permit fixed-index planar averages after validating a flat fitted mesh.
Definition: ERF_DataStruct.H:2992
std::string abl_geo_wind_table
Path to a time-varying geostrophic wind table.
Definition: ERF_DataStruct.H:3496
amrex::Vector< int > fixed_density
Per-level flag selecting fixed-density treatment; always 1 at an anelastic level and 0 at a pseudo-in...
Definition: ERF_DataStruct.H:3030
amrex::Vector< TurbChoice > turbChoice
Turbulence options for each AMR level.
Definition: ERF_DataStruct.H:3020
amrex::Real const_massflux_layer_lo
Lower height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:3554
amrex::Vector< TimesteppingType > timestepping_type
Per-level time integrator (RK3_ImplicitSubstep, RK3_NoSubstepping, RK2 or MidPoint).
Definition: ERF_DataStruct.H:3029
amrex::Real hindcast_zhi_sponge_length
Length of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:3564
TopographicShadingChoice topographicChoice
Definition: ERF_DataStruct.H:3024
bool if_fraction_stress
erf.if_wall_form = fraction_stress: the wall stress of ERF_ImmersedWallCell.H in the wall cell of eac...
Definition: ERF_DataStruct.H:3126
amrex::Real gravity
Effective gravitational acceleration.
Definition: ERF_DataStruct.H:3148
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:2476
bool pbl_suppresses_microphysics_condensation() const noexcept
Query whether the active PBL scheme suppresses microphysics condensation.
Definition: ERF_DataStruct.H:3386
bool rayleigh_fast_uvT(int lev) const noexcept
Definition: ERF_DataStruct.H:3248
amrex::Real perturbation_auto_period
Seconds between automatic parent-wind and PBL-height updates.
Definition: ERF_DataStruct.H:3425
bool variable_coriolis
Whether spatially varying Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:3499
bool implicit_moisture_diffusion
Whether implicit vertical moisture diffusion is included.
Definition: ERF_DataStruct.H:3062
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:3433
void display(int max_level, std::string pp_prefix)
Print the configured solver, physics, and transport options.
Definition: ERF_DataStruct.H:2742
amrex::Real poisson_abstol
Absolute tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:3077
amrex::Real if_Cd_momentum
Immersed-forcing drag coefficient for momentum.
Definition: ERF_DataStruct.H:3106
bool nudging_t
Definition: ERF_DataStruct.H:3188
amrex::Real if_Olen_in
Input Obukhov length for immersed-forcing MOST [m].
Definition: ERF_DataStruct.H:3117
amrex::Vector< int > buoyancy_type
Per-level buoyancy formulation selector.
Definition: ERF_DataStruct.H:3032
bool forest_biophysics
Definition: ERF_DataStruct.H:3544
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Build constant-latitude Coriolis forcing parameters.
Definition: ERF_DataStruct.H:2908
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:3432
bool use_pert_pres_gradient
Whether momentum equations use perturbational pressure gradients.
Definition: ERF_DataStruct.H:3092
bool sbm_particle_mixing_terrain_qualification
Definition: ERF_DataStruct.H:3459
bool sbm_test_native_qc_write_fault
Definition: ERF_DataStruct.H:3446
amrex::Vector< int > project_initial_velocity
Per-level flag for projecting the initial velocity.
Definition: ERF_DataStruct.H:3031
int ave_plane
Averaging plane index used by diagnostics.
Definition: ERF_DataStruct.H:3501
amrex::Real const_massflux_u
Target constant mass flux in the x direction.
Definition: ERF_DataStruct.H:3551
bool nudging_q
Definition: ERF_DataStruct.H:3189
int ncorr
Number of projection correction iterations.
Definition: ERF_DataStruct.H:3070
amrex::Real if_small_volfrac
Immersed-forcing solid fraction below which a cell or face counts as fluid; read from eb2....
Definition: ERF_DataStruct.H:3135
bool forest_fast(int lev) const noexcept
Definition: ERF_DataStruct.H:3297
static bool buildings_fc_factories
Use native face-centered EB factories for immersed buildings on a static fitted mesh.
Definition: ERF_DataStruct.H:2998
amrex::Real sampling_distance_by_D
Turbine inflow sampling distance normalized by rotor diameter.
Definition: ERF_DataStruct.H:3510
std::string sbm_particle_mixing
Definition: ERF_DataStruct.H:3454
amrex::Real windfarm_y_shift
Wind-farm y-coordinate shift.
Definition: ERF_DataStruct.H:3513
bool use_rotate_surface_flux
Whether MOST surface fluxes are rotated with terrain.
Definition: ERF_DataStruct.H:3196
bool use_building_immersed_forcing(const amrex::Geometry &geom) const noexcept
Definition: ERF_DataStruct.H:3231
bool auto_variable_beta_s
Whether erf.use_variable_beta_s may be turned on automatically (it is not set in the inputs).
Definition: ERF_DataStruct.H:3048
bool moisture_tight_coupling
Whether moisture updates use tight coupling.
Definition: ERF_DataStruct.H:3506
EBChoice ebChoice
Embedded-boundary options.
Definition: ERF_DataStruct.H:3021
bool compute_mean_vars
Definition: ERF_DataStruct.H:3212
amrex::Real test_mapfactor_amp
Amplitude of the spatially varying test map scale factors on level 0 (0: not used).
Definition: ERF_DataStruct.H:3086
amrex::Real beta_s
Time off-centering coefficient for forward weighting.
Definition: ERF_DataStruct.H:3040
amrex::Real pi_drift_factor
Definition: ERF_DataStruct.H:3083
bool rayleigh_implicit_w(int lev) const noexcept
Definition: ERF_DataStruct.H:3277
amrex::Vector< amrex::Real > sbm_fixture_initial_state_xhi
Definition: ERF_DataStruct.H:3453
bool implicit_ke_diffusion
Whether implicit vertical TKE diffusion is included.
Definition: ERF_DataStruct.H:3063
bool interp_atmos_from_coarse
Definition: ERF_DataStruct.H:3538
bool any_perturbation() const
Query whether any level uses a turbulent perturbation mode.
Definition: ERF_DataStruct.H:3395
amrex::Real if_z0
Immersed-forcing roughness length [m].
Definition: ERF_DataStruct.H:3113
bool forest_substep
Whether canopy source terms are applied only during substeps.
Definition: ERF_DataStruct.H:3103
bool use_wrf_bdy_density
Definition: ERF_DataStruct.H:3519
bool implicit_thermal_diffusion
Whether implicit vertical thermal diffusion is included.
Definition: ERF_DataStruct.H:3061
bool if_implicit_projection
Definition: ERF_DataStruct.H:3111
std::string mean_vars_reset_mode
Definition: ERF_DataStruct.H:3215
bool use_gravity
Whether gravitational forcing is enabled.
Definition: ERF_DataStruct.H:3095
amrex::Real num_diff_coeff
Numerical diffusion coefficient after input scaling.
Definition: ERF_DataStruct.H:3430
amrex::Real if_wall_tke_time_factor
1 (the default) pins the wall cell after every stage and in the implicit TKE solve; a larger value re...
Definition: ERF_DataStruct.H:3129
similarity_funs most_sfuns
Definition: ERF_DataStruct.H:3125
amrex::Real bdy_nudge_factor
Boundary sponge nudging factor.
Definition: ERF_DataStruct.H:3516
int sbm_cloud_rain_split
Definition: ERF_DataStruct.H:3436
amrex::Real rdOcp
Ratio of dry-air gas constant to c_p.
Definition: ERF_DataStruct.H:3150
bool use_wvel_perturbation(int lev) const
Query whether vertical-velocity CPM perturbations are enabled on a level.
Definition: ERF_DataStruct.H:3348
bool hindcast_lateral_forcing
Whether hindcast lateral forcing is enabled.
Definition: ERF_DataStruct.H:3561
bool do_theta_advection
Whether custom vertical subsidence is applied to rho-theta.
Definition: ERF_DataStruct.H:3165
bool sbm_amr_qualification_regrid
Definition: ERF_DataStruct.H:3443
bool use_native_shoc
Whether any level uses the native SHOC PBL scheme.
Definition: ERF_DataStruct.H:3199
amrex::Real nudging_q_z2
Definition: ERF_DataStruct.H:3185
static bool use_real_bcs
Whether real-data lateral boundary conditions are used.
Definition: ERF_DataStruct.H:3001
bool spatial_moisture_forcing
Whether spatially varying moisture forcing is enabled.
Definition: ERF_DataStruct.H:3170
bool perturbation_auto
Select LES nests, using parent winds and a PBL ancestor's height, or the nearest LES ancestor's diagn...
Definition: ERF_DataStruct.H:3424
RRTMGPSolarChoice rrtmgpSolarChoice
Definition: ERF_DataStruct.H:3023
amrex::Real nudging_u_z2
Definition: ERF_DataStruct.H:3181
bool use_perturbation(int lev) const
Query whether any turbulent perturbation mode is enabled on a level.
Definition: ERF_DataStruct.H:3313
static SoundingType sounding_type
Interpretation used for input sounding profiles.
Definition: ERF_DataStruct.H:2986
int bdy_moist_nudge_type
Moist-variable nudging strategy in boundary regions.
Definition: ERF_DataStruct.H:3525
amrex::Real poisson_reltol
Relative tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:3078
bool use_coriolis
Whether Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:3096
amrex::Vector< PerturbationType > pert_type
Turbulent perturbation type for each AMR level.
Definition: ERF_DataStruct.H:3423
static MeshType mesh_type
Vertical mesh representation.
Definition: ERF_DataStruct.H:3004
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:3016
amrex::Vector< CompressibilityType > compressibility_type
Per-level compressibility (FullyCompressible, Anelastic or PseudoIncompressible).
Definition: ERF_DataStruct.H:3028
UrbanType urban_type
Definition: ERF_DataStruct.H:3463
SpongeChoice spongeChoice
Sponge-layer options.
Definition: ERF_DataStruct.H:3019
void init_params(int max_level, std::string pp_prefix)
Read solver-wide algorithmic options from the input parameter database.
Definition: ERF_DataStruct.H:750
bool time_avg_vel
Whether time-averaged velocity fields are output.
Definition: ERF_DataStruct.H:3209
bool use_direct_perturbation(int lev) const
Query whether direct turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:3326
bool have_geo_wind_profile
Whether a geostrophic wind profile has been configured.
Definition: ERF_DataStruct.H:3497
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Applied ABL pressure-gradient forcing vector.
Definition: ERF_DataStruct.H:3494
RadChoice radChoice
Definition: ERF_DataStruct.H:3022
bool four_stream_radiation
Whether the four-stream radiation approximation is enabled.
Definition: ERF_DataStruct.H:3099
amrex::Real perturbation_auto_pbl_fraction
Fraction of the selected ancestor's PBL height occupied by perturbations.
Definition: ERF_DataStruct.H:3426
GradpType gradp_type
Terrain-fitted horizontal pressure-gradient formulation.
Definition: ERF_DataStruct.H:3088
amrex::Real if_surf_moist
Definition: ERF_DataStruct.H:3121
amrex::Real if_surf_moist_flux
Definition: ERF_DataStruct.H:3120
DampingChoice dampingChoice
Damping-related options.
Definition: ERF_DataStruct.H:3018
amrex::Real if_damp_alpha
Immersed-forcing damping coefficient.
Definition: ERF_DataStruct.H:3132
bool rebalance_wrf_input
Whether to rebalance states from wrfinput and wrfbdy data.
Definition: ERF_DataStruct.H:3145
bool gradp_2nd_order_bndry
Whether ChainRule takes dp/dz at the bottom and top from a second-order one-sided difference.
Definition: ERF_DataStruct.H:3090
bool sbm_amr_qualification_expect_zero_flow
Definition: ERF_DataStruct.H:3438
amrex::Real sbm_particle_mixing_kv
Definition: ERF_DataStruct.H:3456
bool wrfinput_zlevels_from_file
Definition: ERF_DataStruct.H:3535
amrex::Vector< amrex::Real > sbm_edges
Definition: ERF_DataStruct.H:3449
amrex::Real turb_disk_angle
Turbine disk angle from the x axis [deg].
Definition: ERF_DataStruct.H:3511
amrex::Real hindcast_data_interval_in_hrs
Time interval between hindcast data files [hr].
Definition: ERF_DataStruct.H:3560
amrex::Real const_massflux_layer_hi
Upper height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:3555
bool sbm_amr_qualification_test
Definition: ERF_DataStruct.H:3437
std::string wall_dist_type
Definition: ERF_DataStruct.H:3071
bool avg_grid_faces_to_nodes
Definition: ERF_DataStruct.H:3528
amrex::Real cf_loglaw_z0
Roughness length [m] of that share; by default erf.if_z0 with immersed forcing, else the inputs' erf....
Definition: ERF_DataStruct.H:3139
std::string windfarm_spec_table_extra
Additional wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:3508
amrex::Real if_ws_floor
Wind-speed floor [m/s] in the per-step change limit of the building wall-law forcing.
Definition: ERF_DataStruct.H:3131
amrex::Real lsf_timescale
Definition: ERF_DataStruct.H:3193
bool is_init_for_ensemble
Whether initialization is for an ensemble simulation.
Definition: ERF_DataStruct.H:3570
bool uses_shoc_family() const noexcept
Query whether any SHOC-family PBL scheme is active.
Definition: ERF_DataStruct.H:3357
bool sbm_amr_qualification_expect_empty_fine_rank
Definition: ERF_DataStruct.H:3440
bool test_mapfactor
Whether to use test map scale factors.
Definition: ERF_DataStruct.H:3085
amrex::Real nudging_u_z1
Definition: ERF_DataStruct.H:3180
bool if_snap_partial_cells
Definition: ERF_DataStruct.H:3123
amrex::Vector< amrex::Real > sbm_pivots
Definition: ERF_DataStruct.H:3450
std::string coarse_bckgnd_data_file
Coarse background data file used for ensemble initialization.
Definition: ERF_DataStruct.H:3574
amrex::Real sbm_particle_mixing_kh
Definition: ERF_DataStruct.H:3455
bool do_forest_drag
Whether forest canopy drag is enabled.
Definition: ERF_DataStruct.H:3541
bool sbm_amr_qualification_regrid_reject_fault
Definition: ERF_DataStruct.H:3444
amrex::Real dz0
Initial vertical grid spacing for stretched-grid setup.
Definition: ERF_DataStruct.H:3154
amrex::Real windfarm_x_shift
Wind-farm x-coordinate shift.
Definition: ERF_DataStruct.H:3512
bool use_lagged_delta_rt
Whether to use lagged delta terms for moving terrain.
Definition: ERF_DataStruct.H:3142
bool sbm_amr_qualification_unique_profile
Definition: ERF_DataStruct.H:3441
amrex::Real ens_pert_amplitude
Amplitude of ensemble initialization perturbations.
Definition: ERF_DataStruct.H:3573
std::string windfarm_airfoil_tables
Wind-farm airfoil table paths.
Definition: ERF_DataStruct.H:3509
amrex::Real bdy_rho_nudge_factor
Definition: ERF_DataStruct.H:3522
amrex::Real nudging_q_z1
Definition: ERF_DataStruct.H:3184
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Per-level, per-stage implicit vertical diffusion factors.
Definition: ERF_DataStruct.H:3058
bool transport_scalar
Whether the passive scalar component is transported.
Definition: ERF_DataStruct.H:3206
bool cf_loglaw_fill
Share the flux of the first coarse face above a wall among its fine sub-faces at the lateral coarse/f...
Definition: ERF_DataStruct.H:3138
TerrainPoissonSolver terrain_poisson_solver
Projection solver on a terrain-fitted mesh: gmres_fft (default), mlmg or gmres_mlmg.
Definition: ERF_DataStruct.H:3072
bool hindcast_zhi_sponge_damping
Whether upper-boundary hindcast sponge damping is enabled.
Definition: ERF_DataStruct.H:3565
amrex::Real hurricane_eye_longitude
Initial hurricane-eye longitude.
Definition: ERF_DataStruct.H:3568
bool nudging_from_observations
Whether solution fields are nudged toward observations at stations.
Definition: ERF_DataStruct.H:3178
LandSurfaceType lsm_type
Land-surface model.
Definition: ERF_DataStruct.H:3462
int massflux_khi
Upper vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:3557
bool large_scale_forcing
Definition: ERF_DataStruct.H:3191
bool implicit_terrain_metric
Whether the compact terrain-metric part of the vertical diffusion is solved implicitly.
Definition: ERF_DataStruct.H:3068
bool if_wall_tke
Hold the k-eqn TKE of the fraction-stress wall cell at its flat-ground wall value (ib_wall::wall_tke)...
Definition: ERF_DataStruct.H:3128
bool substepping_diag
Whether to emit extra CFL diagnostics for compressible substepping.
Definition: ERF_DataStruct.H:3036
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:2989
amrex::Real mean_vars_reset_time
Definition: ERF_DataStruct.H:3216
std::string windfarm_blade_table
Wind-farm blade table path.
Definition: ERF_DataStruct.H:3509
bool if_flat_wall_dissipation
Partial fraction-stress wall cells dissipate TKE with the length scale of flat ground's first cell; o...
Definition: ERF_DataStruct.H:3130
CanopyTurbulence canopyTurb
Definition: ERF_DataStruct.H:3548
amrex::Vector< int > is_land
Per-level land/water selector.
Definition: ERF_DataStruct.H:3033
amrex::Real hindcast_lateral_sponge_strength
Strength of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:3563
bool forest_biophysics_heat
Definition: ERF_DataStruct.H:3545
std::string if_average_down
Cell average down over immersed-forcing levels: "plain" (the default, the plain cell average) or "flu...
Definition: ERF_DataStruct.H:3136
ShocTransportMode shoc_transport_mode
Definition: ERF_DataStruct.H:3202
amrex::Real hurricane_eye_latitude
Initial hurricane-eye latitude.
Definition: ERF_DataStruct.H:3568
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:3469
amrex::Real cosphi
Cosine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:3158
bool sbm_amr_qualification_uniform_ratio
Definition: ERF_DataStruct.H:3445
amrex::Real if_Cd_scalar
Immersed-forcing drag coefficient for scalars.
Definition: ERF_DataStruct.H:3107
bool immersed_forcing_fast(int lev) const noexcept
Definition: ERF_DataStruct.H:3303
bool sbm_amr_qualification_parent_store_fault
Definition: ERF_DataStruct.H:3442
amrex::Real if_cf_mismatch_warning
Spread of the fine solid fractions under a coarse cell along a lateral coarse/fine face at or above w...
Definition: ERF_DataStruct.H:3137
static BuildingsType buildings_type
Building representation.
Definition: ERF_DataStruct.H:2995
std::string windfarm_loc_table
Wind-farm location table path.
Definition: ERF_DataStruct.H:3508
std::string hindcast_surface_data_dir
Directory containing hindcast surface boundary data.
Definition: ERF_DataStruct.H:3559
int if_wall_face_spacing
Spacing the face above the fraction-stress wall cell differences over: 0 the cell height,...
Definition: ERF_DataStruct.H:3127
bool rayleigh_fast_w(int lev) const noexcept
Definition: ERF_DataStruct.H:3256
ShocMomentumTransport shoc_momentum_transport
Definition: ERF_DataStruct.H:3203
bool custom_rhotheta_forcing
Whether custom rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:3162
amrex::Real beta_d
Divergence damping coefficient used in the acoustic substepping.
Definition: ERF_DataStruct.H:3052
bool sbm_test_donor_cfl_fault
Definition: ERF_DataStruct.H:3447
bool level_substeps(int lev) const noexcept
Definition: ERF_DataStruct.H:3242
amrex::Real if_init_surf_temp
Initial immersed-forcing surface temperature [K].
Definition: ERF_DataStruct.H:3115
amrex::Real nudging_t_z2
Definition: ERF_DataStruct.H:3183
int face_sync_int
Definition: ERF_DataStruct.H:3041
int massflux_klo
Lower vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:3556
std::string lsf_file
Definition: ERF_DataStruct.H:3192
std::string windfarm_spec_table
Wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:3508
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Applied geostrophic-wind forcing vector.
Definition: ERF_DataStruct.H:3495
bool sbm_amr_qualification_expect_split
Definition: ERF_DataStruct.H:3439
bool read_int_string(int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
Read one integer value or one value per AMR level.
Definition: ERF_DataStruct.H:2959
ABLDriverType abl_driver_type
Atmospheric boundary-layer driver type.
Definition: ERF_DataStruct.H:3493
DiffChoice diffChoice
Diffusion-related options.
Definition: ERF_DataStruct.H:3017
amrex::Real if_surf_temp_flux
Immersed-forcing surface temperature flux [K m/s].
Definition: ERF_DataStruct.H:3114
bool spatial_rhotheta_forcing
Whether spatially varying rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:3169
amrex::Vector< int > urban_enabled_lev
Definition: ERF_DataStruct.H:3464
WindFarmType windfarm_type
Wind-farm model.
Definition: ERF_DataStruct.H:3460
bool use_variable_beta_s
Whether beta_s varies on the w-faces with the terrain slope and acoustic Courant number.
Definition: ERF_DataStruct.H:3045
bool use_source_perturbation(int lev) const
Query whether source-term turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:3338
bool custom_w_subsidence
Whether custom vertical subsidence is enabled.
Definition: ERF_DataStruct.H:3164
bool rad_feeds_lsm() const
True when the radiation model's outputs feed the land model (downwelling shortwave,...
Definition: ERF_DataStruct.H:3483
bool custom_moisture_forcing
Whether custom moisture forcing is enabled.
Definition: ERF_DataStruct.H:3163
amrex::Real if_surf_heating_rate
Immersed-forcing surface heating rate [K/hr].
Definition: ERF_DataStruct.H:3116
int sbm_nbins
Definition: ERF_DataStruct.H:3434
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:3504
RadiationType rad_type
Radiation model.
Definition: ERF_DataStruct.H:3465
amrex::Real grid_stretching_ratio
Vertical grid stretching ratio.
Definition: ERF_DataStruct.H:3153
bool hindcast_surface_bcs
Whether hindcast surface boundary conditions are enabled.
Definition: ERF_DataStruct.H:3562
bool rayleigh_slow_implicit_w(int lev) const noexcept
Definition: ERF_DataStruct.H:3288
bool host_owns_vertical_scalar_diffusion() const noexcept
Test whether the host owns scalar diffusion.
Definition: ERF_DataStruct.H:3376
bool immersed_forcing_substep
Whether immersed-forcing source terms are applied only during substeps.
Definition: ERF_DataStruct.H:3102
bool if_use_most
Whether immersed-forcing MOST is enabled.
Definition: ERF_DataStruct.H:3122
amrex::Real const_massflux_tau
Relaxation time scale for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:3553
bool zcc_vertical_metric(int lev) const noexcept
Definition: ERF_DataStruct.H:3267
amrex::Real hindcast_lateral_sponge_length
Length of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:3563
amrex::Real sinphi
Sine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:3159
bool host_owns_vertical_momentum_diffusion() const noexcept
Test whether the host owns momentum diffusion.
Definition: ERF_DataStruct.H:3366
amrex::Real hindcast_zhi_sponge_strength
Strength of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:3564
bool coriolis_3d
Whether the three-dimensional Coriolis terms are included.
Definition: ERF_DataStruct.H:3097
int force_stage1_single_substep
Flag forcing a single substep in the first RK stage.
Definition: ERF_DataStruct.H:3026
amrex::Real c_p
Specific heat at constant pressure for dry air [J/(kg-K)].
Definition: ERF_DataStruct.H:3149
bool if_implicit_drag
Definition: ERF_DataStruct.H:3110
bool implicit_momentum_diffusion
Whether implicit vertical momentum diffusion is included.
Definition: ERF_DataStruct.H:3064
bool do_mom_advection
Whether custom vertical subsidence is applied to momentum.
Definition: ERF_DataStruct.H:3166
bool if_stability_correction
Whether the immersed-forcing wall law applies the MOST similarity functions, in the momentum and the ...
Definition: ERF_DataStruct.H:3124
amrex::Real nudging_t_z1
Definition: ERF_DataStruct.H:3182
amrex::Vector< amrex::Real > sbm_fixture_initial_state
Definition: ERF_DataStruct.H:3451
bool custom_forcing_prim_vars
Whether custom forcing operates on primitive variables.
Definition: ERF_DataStruct.H:3168
amrex::Real if_stability_wind_floor
Wind-speed floor [m/s] behind the friction velocity of the wall law's stability estimate (0: none).
Definition: ERF_DataStruct.H:3133
amrex::Vector< int > zcc_vertical_metric_lev
Definition: ERF_DataStruct.H:3273
bool use_coupled_currents
Definition: ERF_DataStruct.H:3491
bool nudging_u
Definition: ERF_DataStruct.H:3187
bool nudging_from_input_sounding
Whether solution fields are nudged toward input sounding data.
Definition: ERF_DataStruct.H:3174
static void set_mesh_type(MeshType new_mesh_type)
Override the globally selected mesh type.
Definition: ERF_DataStruct.H:3011
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:3429
bool sbm_budget_check
Definition: ERF_DataStruct.H:3448
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:113
void read(const std::string &prefix, const RRTMGPSolarChoice &solar)
Definition: ERF_TopographicShading.cpp:40
bool active() const
Definition: ERF_RadStruct.H:123
Definition: ERF_MOSTUtils.H:84