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>
55 None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, ConstantDensity, ConstantDensityLinearTheta,
56 Isentropic, MoistBaseState, HindCast
63 ConstantDensity, Ideal, Isentropic, DryIsentropic
70 None, PressureGradient, GeostrophicWind
103 ConstantDz, StretchedDz, VariableDz
110 None, StaticFittedMesh, MovingFittedMesh, EB, ImmersedForcing
117 None, ImmersedForcing
124 Eulerian, Lagrangian, Undefined
131 SAM, SAM_NoIce, SAM_NoPrecip_NoIce,
Kessler, Kessler_NoRain,
SatAdj,
Morrison, Morrison_NoIce,
WSM6,
WDM6, SuperDroplets,
MoistNoCondensation, SBM,
None
141 const MoistureType moisture_type,
142 const bool any_anelastic) noexcept
144 return any_anelastic && moisture_type == MoistureType::SuperDroplets;
179 None, RRTMGP, Simple, TwoStream
315 :
qv(qv_comp),
qc(qc_comp),
qi(qi_comp),
qr(qr_comp),
qs(qs_comp),
qg(qg_comp),
316 nc(nc_comp),
ni(ni_comp),
nr(nr_comp),
ns(ns_comp),
ng(ng_comp),
342 switch (moisture_type) {
348 case MoistureType::MoistNoCondensation:
349 case MoistureType::SAM_NoPrecip_NoIce:
350 case MoistureType::Kessler_NoRain:
357 case MoistureType::SatAdj:
365 case MoistureType::Kessler:
373 case MoistureType::SBM:
381 case MoistureType::SAM_NoIce:
390 case MoistureType::SAM:
391 case MoistureType::WSM6:
405 case MoistureType::Morrison:
424 case MoistureType::Morrison_NoIce:
437 case MoistureType::WDM6:
455 case MoistureType::SuperDroplets:
473 amrex::Abort(
"Unknown MoistureType in MoistureComponentIndices::from_moisture_model");
495 [[nodiscard]]
bool empty ()
const {
return (
size == 0); }
539 return ( (comp >= 0) &&
540 ( (comp ==
qv) || (comp ==
qc) || (comp ==
qi) ||
541 (comp ==
qr) || (comp ==
qs) || (comp ==
qg) ||
542 (comp ==
nc) || (comp ==
ni) || (comp ==
nr) ||
543 (comp ==
ns) || (comp ==
ng) || (comp ==
nn) ) );
577 if (
name ==
"qv") {
return qv; }
578 if (
name ==
"qc") {
return qc; }
579 if (
name ==
"qi") {
return qi; }
580 if (
name ==
"qrain") {
return qr; }
581 if (
name ==
"qsnow") {
return qs; }
582 if (
name ==
"qgraup") {
return qg; }
583 if (
name ==
"nc") {
return nc; }
584 if (
name ==
"ni") {
return ni; }
585 if (
name ==
"nr") {
return nr; }
586 if (
name ==
"ns") {
return ns; }
587 if (
name ==
"ng") {
return ng; }
588 if (
name ==
"nn") {
return nn; }
633 if ( (
name ==
"qv") || (
name ==
"qc") || (
name ==
"qi") ||
634 (
name ==
"qrain") || (
name ==
"qsnow") || (
name ==
"qgraup") ||
641 if ( (
name ==
"rain_accum") || (
name ==
"snow_accum") ||
642 (
name ==
"graup_accum") || (
name ==
"rel_humidity") ||
643 (
name ==
"condensation_rate") ) {
653 if ( (
name ==
"qn") || (
name ==
"moist_density") ) {
654 return {
true, (
qv >= 0) && (
qc >= 0)};
658 if ( (
name ==
"qsat") || (
name ==
"precipitable") ) {
662 return {
false,
false};
694 amrex::ParmParse
pp(pp_prefix);
697 if (
pp.query(
"use_terrain",bogus_bool) > 0) {
698 amrex::Error(
"The input use_terrain is deprecated. Set terrain_type instead.");
701 if (
pp.query(
"use_moist_background",bogus_bool) > 0) {
702 amrex::Error(
"The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
721 amrex::Error(
"The input moisture_type is deprecated. Set moisture_model instead.");
732 amrex::Error(
"SBM test fault-injection options require moisture_model=SBM");
743 if (
pp.contains(
"sbm_zero_transport_fixture")) {
744 bool legacy_zero_transport =
false;
745 pp.get(
"sbm_zero_transport_fixture", legacy_zero_transport);
746 if (legacy_zero_transport) {
747 amrex::Error(
"erf.sbm_zero_transport_fixture=true is obsolete; M3 advances the mapped spectral state, so remove this option");
758 amrex::Error(
"SBM requires sbm_nbins >= 2 and sbm_moment_mode equal to 1 or 2");
770 sbm_pivots[
static_cast<std::size_t
>(b)] = std::sqrt(
775 if (
sbm_nbins < 2) amrex::Error(
"sbm_edges must define at least two bins");
779 sbm_pivots[
static_cast<std::size_t
>(b)] = std::sqrt(
785 amrex::Error(
"sbm_pivots must contain one value per SBM bin");
788 if (sbm_cloud_rain_split <= 0 || sbm_cloud_rain_split >=
sbm_nbins) {
789 amrex::Error(
"sbm_cloud_rain_split must be strictly inside the liquid bin range");
794 amrex::Error(
"sbm_fixture_initial_state must match the full runtime SBM component count");
797 if (!std::isfinite(value) || value <
amrex::Real(0.0)) {
798 amrex::Error(
"sbm_fixture_initial_state values must be finite and nonnegative");
805 for (
int i = 0; i <= max_level; ++i) {
819 pp.query_enum_case_insensitive(
"land_surface_model",
lsm_type);
823 pp.query_enum_case_insensitive(
"urban_model",
urban_type);
825 for (
int lev = 0; lev <= max_level; ++lev) {
827 amrex::Error(
"urban_lev_active should be 0 or 1");
838 for (
int lev = 0; lev <= max_level; ++lev) {
840 amrex::Print() <<
"Level " << lev <<
" is land" << std::endl;
841 }
else if (
is_land[lev] == 0) {
842 amrex::Print() <<
"Level " << lev <<
" is water" << std::endl;
844 amrex::Error(
"is_land should be 0 or 1");
850 pp.query_enum_case_insensitive(
"radiation_model",
rad_type);
853 #ifndef ERF_USE_RRTMGP
854 if (
rad_type == RadiationType::RRTMGP)
856 amrex::Error(
"ERF was not compiled with RRTMGP enabled!");
861 std::string terrain_type_temp =
"";
862 pp.queryAdd(
"terrain_type", terrain_type_temp);
863 if (terrain_type_temp ==
"Moving") {
864 amrex::Warning(
"erf.terrain_type = Moving is deprecated; please replace Moving by MovingFittedMesh");
866 }
else if (terrain_type_temp ==
"Static") {
867 amrex::Warning(
"erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
877 std::string buildings_type_temp =
"";
878 pp.queryAdd(
"buildings_type", buildings_type_temp);
879 if (buildings_type_temp ==
"ImmersedForcing") {
886 std::string init_type_temp_string;
888 int found =
pp.queryAdd(
"init_type",init_type_temp_string);
890 if ( (init_type_temp_string ==
"Real") || (init_type_temp_string ==
"real") ) {
891 amrex::Error(
"erf.init_type = Real is deprecated; please replace Real by WRFInput");
892 }
else if ( (init_type_temp_string ==
"Ideal") || (init_type_temp_string ==
"ideal") ) {
893 amrex::Error(
"erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
895 pp.query_enum_case_insensitive(
"init_type",
init_type);
901 amrex::Error(
"Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
905 if (
init_type == InitType::MoistBaseState) {
907 amrex::Error(
"Makes no sense to have moist base state with no moisture model");
913 amrex::Error(
"Can't have moisture_type = None with init_type = WRFInput");
917 std::string nc_bdy_file_temp_string;
918 bool has_bdy =
pp.queryAdd(
"nc_bdy_file", nc_bdy_file_temp_string);
922 pp.queryAdd(
"use_real_bcs", use_real_bcs_temp);
929 amrex::Print() <<
"init_type must now be set. The options are " << std::endl;
930 amrex::Print() <<
" Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
931 amrex::Print() <<
" ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
932 amrex::Error(
"Please add a string for init_type to your inputs file or command line");
936 if (
init_type == InitType::Input_Sounding) {
946 amrex::Error(
"erf.flat_terrain requires terrain_type = StaticFittedMesh");
954 amrex::Abort(
"SAM is not correct with variable dz -- choose another moisture model");
958 const bool have_stretching_ratio =
pp.contains(
"grid_stretching_ratio");
962 "The grid stretching ratio must be greater than 1");
967 const bool solve_stretching_ratio = !have_stretching_ratio &&
pp.contains(
"initial_dz");
975 pp.queryAdd(
"zsurface",
zsurf);
977 amrex::Print() <<
"Nominal zsurface height != 0, may result in unexpected behavior"
980 pp.get(
"initial_dz",
dz0);
983 int n_zlevels =
pp.countval(
"terrain_z_levels");
1006 if (
pp.contains(
"use_wrf_height_grid")) {
1007 amrex::Abort(
"erf.use_wrf_height_grid has been renamed. "
1008 "Set erf.avg_grid_faces_to_nodes instead; it carries "
1009 "the same meaning (average the input z-face heights "
1010 "onto the nodes rather than reconstructing them).");
1022 amrex::Print() <<
"Must rebalance when not averaging the input height grid. Setting rebalance_wrf_input to true \n";
1031 amrex::Print() <<
"Setting use_gravity to true due to init_type = WRFInput / Metgrid " << std::endl;
1037 pp.queryAdd(
"c_p",
c_p);
1045 const bool fixed_density_given =
1052 bool any_anelastic =
false;
1053 bool any_compress =
false;
1054 for (
int i = 0; i <= max_level; ++i) {
1057 amrex::Print() <<
"WARNING: erf.fixed_density = 0 is ignored at level " << i
1058 <<
" because erf.anelastic = 1 there; the anelastic equations"
1059 <<
" always hold the density fixed in time." << std::endl;
1064 any_anelastic =
true;
1066 any_compress =
true;
1071 amrex::Error(
"erf.moisture_model = SuperDroplets is not supported with "
1072 "erf.anelastic = 1: the Super-Droplet path currently uses "
1073 "the compressible equation of state. Use compressible "
1074 "dynamics or a supported Eulerian moisture model.");
1080 if (any_anelastic) {
1095 for (
int i = 0; i <= max_level; i++) {
1099 for (
int i = 0; i <= max_level; i++) {
1104 if (
pp.contains(
"anelastic_type") && !any_anelastic) {
1105 amrex::Print() <<
"Ignoring erf.anelastic_type because no level is anelastic" << std::endl;
1106 for (
int i = 0; i <= max_level; i++) {
anelastic_type[i] = AnelasticType::RK2; }
1114 for (
int i = 0; i <= max_level; i++) {
1118 for (
int i = 0; i <= max_level; i++) {
1130 int nvals_old =
pp.countval(
"no_substepping");
1131 if (nvals_old > 0) {
1132 amrex::Error(
"The no_substepping flag is deprecated -- set substepping_type instead");
1141 amrex::Error(
"erf.wall_dist_type must be poisson or terrain_height");
1145 #ifdef AMREX_USE_FLOAT
1149 for (
int lev = 0; lev <= max_level; lev++) {
1176 "forest_biophysics_heat requires forest_biophysics = true");
1180 "forest_biophysics_heat requires a positive forest_leaf_theta_fixed");
1183 "forest_leaf_theta_fixed requires forest_biophysics_heat = true");
1206 amrex::Print() <<
"erf.if_snap_partial_cells: using the point-implicit drag (erf.if_implicit_drag = true)\n";
1218 amrex::Abort(
"erf.if_stability_wind_floor must be >= 0 [m/s] (0 leaves the wind as it is)");
1221 amrex::Abort(
"erf.if_psi_cap_factor must be in (0, 1] (1 caps psi at ln(z/z0))");
1226 (if_psi_cap_factor < one || if_stability_wind_floor >
zero))
1228 amrex::Print() <<
"Immersed wall law: erf.if_psi_cap_factor = " <<
if_psi_cap_factor
1230 <<
" m/s (WRF-style bounds; the defaults 1 and 0 turn them off)\n";
1237 amrex::Error(
"Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
1241 amrex::Abort(
"erf.if_Olen = 0 is not an Obukhov length: give a nonzero length [m] (a large |L| is near neutral)");
1261 for (
int lev = 0; lev <= max_level; ++lev) {
1264 pp,
"perturbation_type",
pert_type[lev], lev, max_level);
1267 amrex::Vector<amrex::Real> abl_pressure_grad_in = {
zero,
zero,
zero};
1268 pp.queryarr(
"abl_pressure_grad",abl_pressure_grad_in);
1269 for(
int i = 0; i < AMREX_SPACEDIM; ++i)
abl_pressure_grad[i] = abl_pressure_grad_in[i];
1271 amrex::Vector<amrex::Real> abl_geo_forcing_in = {
zero,
zero,
zero};
1272 if(
pp.queryarr(
"abl_geo_forcing",abl_geo_forcing_in)) {
1273 amrex::Print() <<
"Specified abl_geo_forcing: (";
1274 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
1278 amrex::Print() <<
")" << std::endl;
1302 amrex::Abort(
"erf.nudging_from_observations does not support erf.terrain_type = EB; "
1303 "use a terrain-fitted mesh or immersed forcing");
1306 int nudging_u_z1_set =
pp.queryAdd(
"nudging_u_z1",
nudging_u_z1);
1307 int nudging_u_z2_set =
pp.queryAdd(
"nudging_u_z2",
nudging_u_z2);
1314 "nudging_u_z1 must be less than or equal to nudging_u_z2");
1316 "nudging_t_z1 must be less than or equal to nudging_t_z2");
1318 "nudging_q_z1 must be less than or equal to nudging_q_z2");
1328 amrex::Print() <<
"WARNING: erf.nudging_u = false has no effect when erf.large_scale_forcing "
1329 "= true; momentum nudging is then controlled solely by large_scale_forcing.\n";
1331 if (nudging_u_z1_set || nudging_u_z2_set) {
1332 amrex::Print() <<
"WARNING: erf.nudging_u_z1/erf.nudging_u_z2 are ignored when "
1333 "erf.large_scale_forcing = true; momentum nudging is then applied "
1334 "at all heights.\n";
1340 "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
1347 "Numerical diffusion coefficient must be between 0 & one");
1350 amrex::Print() <<
"6th-order numerical diffusion turned on with coefficient = "
1362 for (
int lev = 0; lev <= max_level; lev++) {
1363 turbChoice[lev].init_params(lev,max_level,pp_prefix);
1369 bool smag2d_requested =
false;
1370 bool smag2d_somewhere =
false;
1371 for (
int lev = 0; lev <= max_level; lev++) {
1372 smag2d_requested = smag2d_requested ||
turbChoice[lev].smag2d_limits_requested;
1373 smag2d_somewhere = smag2d_somewhere ||
turbChoice[lev].smag2d;
1375 if (smag2d_requested && !smag2d_somewhere) {
1376 amrex::Error(
"erf.smag2d_slope_limiter and erf.smag2d_kh_cap apply only to "
1377 "erf.les_type = Smagorinsky2D, which no level uses");
1379 for (
int lev = 0; lev <= max_level; lev++) {
1380 const bool fitted = (
terrain_type == TerrainType::StaticFittedMesh ||
1382 if (
turbChoice[lev].smag2d_slope_limiter && !fitted) {
1383 amrex::Error(
"erf.smag2d_slope_limiter requires erf.terrain_type = StaticFittedMesh "
1384 "or MovingFittedMesh");
1387 amrex::Error(
"erf.smag2d_kh_cap is not supported with erf.terrain_type = EB");
1403 amrex::Print() <<
"WARNING: erf.land_surface_model = NOAHMP with erf.radiation_model = "
1404 << amrex::getEnumNameString(
rad_type)
1405 <<
": only RRTMGP and TwoStream supply the downwelling shortwave, "
1406 "downwelling longwave and solar zenith angle Noah-MP needs. Noah-MP "
1407 "will run with no radiative forcing (zero SWDOWN, GLW and COSZEN).\n";
1411 for (
int lev = 0; lev <= max_level; lev++) {
1419 for (
int lev = 0; lev <= max_level; lev++) {
1420 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1424 amrex::Print() <<
"YSU PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1427 amrex::Error(
"YSU cannot use ERF coriolis frequency if not using coriolis");
1432 for (
int lev = 0; lev <= max_level; lev++) {
1433 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1437 amrex::Print() <<
"MRF PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1440 amrex::Error(
"MRF cannot use ERF coriolis frequency if not using coriolis");
1462 if (bdy_moist_nudge_type < 0 || bdy_moist_nudge_type > 3) {
1463 amrex::Error(
"erf.bdy_moist_nudge_type must be one of 0, 1, 2, or 3");
1466 amrex::Error(
"erf.bdy_moist_nudge_type = 3 requires erf.use_wrf_bdy_qc_qi = true");
1470 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires an active moisture model");
1473 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires WRFInput real boundary conditions");
1477 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires active qv and qc component indices");
1483 for (
const int comp : optional_moisture_comps) {
1484 if (comp != -1 && (comp < RhoQ1_comp || comp >
RhoQ11_comp)) {
1485 amrex::Error(
"erf.use_wrf_bdy_qc_qi found an invalid active moisture component index");
1493 for (
int lev = 0; lev <= max_level; ++lev) {
1504 int n_impfac =
pp.countval(
"vert_implicit_fac");
1506 if (n_impfac == 1) {
1508 pp.get(
"vert_implicit_fac", fac_in);
1509 for (
int lev = 0; lev <= max_level; lev++) {
1510 for (
int i=0; i<3; ++i) {
1514 }
else if (n_impfac == 3) {
1515 for (
int lev = 0; lev <= max_level; lev++) {
1521 const bool user_set_imp_thermal =
pp.contains(
"implicit_thermal_diffusion");
1522 const bool user_set_imp_moisture =
pp.contains(
"implicit_moisture_diffusion");
1523 const bool user_set_imp_ke =
pp.contains(
"implicit_ke_diffusion");
1524 const bool user_set_imp_momentum =
pp.contains(
"implicit_momentum_diffusion");
1545 for (
int lev = 0; lev <= max_level; lev++) {
1547 amrex::Print() <<
"implicit_before_substep cannot be false without substepping; setting to true." <<
"\n";
1556 if (!host_owns_scalars &&
1560 amrex::Print() <<
"Ignoring erf.implicit_{thermal,moisture,ke}_diffusion = true; "
1561 <<
"SHOC owns vertical scalar diffusion." <<
"\n";
1564 amrex::Print() <<
"Ignoring erf.implicit_momentum_diffusion = true; "
1565 <<
"SHOC owns vertical momentum diffusion." <<
"\n";
1574 if (!host_owns_scalars && !host_owns_momentum) {
1575 amrex::Print() <<
"Turning off vertical implicit solve for all components since SHOC owns diffusion." <<
"\n";
1577 amrex::Print() <<
"SHOC hands vertical diffusion of"
1578 << (host_owns_scalars ?
" scalars" :
"")
1579 << (host_owns_momentum ?
" momentum" :
"")
1580 <<
" to the host; keeping the vertical implicit solve on (theta = "
1589 bool do_vert_implicit =
true;
1590 pp.queryAdd(
"vert_implicit", do_vert_implicit);
1591 if (!do_vert_implicit) {
1592 for (
int lev = 0; lev <= max_level; lev++) {
1593 amrex::Print() <<
"Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
1606 for (
int lev = 0; lev <= max_level; lev++) {
1609 amrex::Print() <<
"Turning off native vertical implicit solve flag because anelastic at level " << lev
1610 <<
" with RK2 scheme." << std::endl;
1616 amrex::Print() <<
"Forcing implicit factor 1 in first stage of MidPoint to ensure second-order accuracy." << std::endl;
1620 amrex::Print() <<
"Turning off the second-stage vertical implicit solve at level " << lev
1621 <<
" because anelastic with MidPoint solves in the first stage only."
1633 for (
int lev = 0; lev <= max_level; lev++) {
1634 if (do_vert_implicit) {
1635 amrex::Print() <<
"Implicit diffusion is not supported with EB; turning off at level " << lev <<
"\n";
1646 for (
int lev = 0; lev <= max_level; lev++) {
1648 amrex::Error(
"erf.terrain_type = EB cannot be used with erf.les_type = Deardorff "
1649 "or erf.rans_type = kEqn: the EB diffusion path has no TKE sources");
1659 amrex::Print() <<
"Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
1660 for (
int lev = 0; lev <= max_level; lev++) {
1672 if (any_anelastic && any_compress) {
1708 amrex::Error(
"erf.mean_vars_reset_mode must be either 'plotfile' or 'time'");
1712 amrex::Error(
"erf.mean_vars_reset_time must be non-negative when "
1713 "erf.mean_vars_reset_mode = 'time'");
1722 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
1726 amrex::Error(
"ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
1727 "data files is either missing or set to less than zero");
1738 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
1742 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
1746 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_length' or it is specified to be less than zero");
1750 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
1764 amrex::Error(
"ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
1765 " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
1766 " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
1767 " location of the eye in the initial condition");
1773 amrex::ParmParse pp_ens(
"ensemble");
1776 amrex::Abort(
"You are using an ensemble run. There needs to be at least 2 ensemble members. "
1777 "erf.n_ensemble must be >=2.");
1781 amrex::Abort(
"coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
1782 "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
1783 "which contains the filename in the inputs.");
1787 amrex::Error(
"You are using initialization for ensemble simulations using the inputs option "
1788 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1789 "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
1790 "to be added to the background state and has to be greater than 0.0");
1794 amrex::Error(
"You are using initialization with spatially correlated perturbations using the inputs option "
1795 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1796 "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
1797 "and has to be greater than 0.0");
1808 void check_params (
int max_level,
const amrex::Vector<amrex::Geometry>& geom_vect, amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type)
1812 for (
int lev = 0; lev <= max_level; lev++) {
1814 amrex::Warning(
"\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
1821 for (
int lev = 0; lev <= max_level; lev++) {
1823 amrex::Error(
"buoyancy_type must be 1, 2, 3 or 4");
1828 amrex::Error(
"Can't turn off lagged_delta_rt when terrain not moving");
1835 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
1836 " erf.sampling_distance_by_D in the inputs which specifies the upstream"
1837 " distance as a factor of the turbine diameter at which the incoming free stream"
1838 " velocity will be computed at.");
1842 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
1843 " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
1844 " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
1845 " will have turb_disk_angle value of 90 deg.");
1848 amrex::Error(
"You are using windfarms with latitude-logitude option to position the turbines."
1849 " For this you should provide the inputs erf.windfarm_x_shift and"
1850 " erf.windfarm_y_shift which are the values by which the bounding box of the"
1851 " windfarm is shifted from the x and the y axes.");
1856 amrex::Error(
"Constant mass flux (in x) should be used with periodic boundaries");
1860 amrex::Error(
"Constant mass flux (in y) should be used with periodic boundaries");
1864 for (
int lev = 0; lev <= max_level; lev++) {
1865 if ((geom_vect[lev].CellSize(0) >
amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) >
amrex::Real(2000.)))
1868 amrex::Warning(
"Should use 2-D Smagorinsky for mesoscale resolution");
1869 }
else if (
turbChoice[lev].les_type == LESType::Deardorff) {
1870 amrex::Warning(
"Should not use Deardorff LES for mesoscale resolution");
1877 for (
int lev = 1; lev <= max_level; lev++) {
1878 l_use_kturb = (l_use_kturb ||
turbChoice[lev].use_kturb);
1882 for (
int lev = 0; lev <= max_level; lev++) {
1886 if (l_implicit_diff && !l_use_diff) {
1887 amrex:: Print() <<
"No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
1898 if (
mesh_type != MeshType::VariableDz) {
1899 amrex::Abort(
"erf.implicit_terrain_metric = true requires a terrain-fitted mesh with "
1900 "non-flat terrain (erf.terrain_type = StaticFittedMesh or MovingFittedMesh); "
1901 "on a flat or a purely stretched mesh there are no terrain-metric terms");
1908 for (
int lev = 0; lev <= max_level; lev++) {
1909 for (
int i = 0; i < 3; ++i) {
1911 amrex::Abort(
"erf.implicit_terrain_metric = true needs the vertical implicit solve "
1912 "in every Runge-Kutta stage at every level, but erf.vert_implicit_fac "
1913 "is not positive in stage " + std::to_string(i+1) +
" at level " +
1914 std::to_string(lev) +
". Set erf.vert_implicit_fac = 1 1 1; the "
1915 "option cannot be used where the implicit solve is turned off "
1916 "(erf.vert_implicit = false, every erf.implicit_*_diffusion = false, "
1917 "no molecular or turbulent diffusion, or anelastic, which solves in "
1918 "its first stage only or not at all)");
1925 amrex::Print() <<
"WARNING: erf.implicit_terrain_metric = true with "
1926 <<
"erf.implicit_momentum_diffusion = false: the momentum terrain-metric "
1927 <<
"terms stay explicit; only the scalars are treated implicitly" << std::endl;
1929 }
else if (
mesh_type == MeshType::VariableDz) {
1934 bool explicit_stage_with_kh =
false;
1935 for (
int lev = 0; lev <= max_level; lev++) {
1937 for (
int i = 0; i < 3; ++i) {
1941 if (explicit_stage_with_kh) {
1942 amrex::Print() <<
"NOTE: terrain-fitted mesh with an LES closure (horizontal eddy "
1943 <<
"viscosity K_h) and an explicit vertical-diffusion stage "
1944 <<
"(erf.vert_implicit_fac has a zero): the terrain-metric term "
1945 <<
"K_h h^2 d2/dz2 stays explicit there and limits the time step on "
1946 <<
"steep slopes. To relax it, use erf.vert_implicit_fac = 1 1 1 with "
1947 <<
"erf.implicit_terrain_metric = true, or erf.smag2d_slope_limiter = true "
1948 <<
"for Smagorinsky2D; erf.diffusive_dt_check reports the limit."
1954 for (
int lev = 0; lev <= max_level; lev++) {
1955 if (
turbChoice[lev].enable_mrf_countergradient) {
1960 "enable_mrf_countergradient requires vert_implicit_fac > 0");
1963 "enable_mrf_countergradient requires implicit_thermal_diffusion = true");
1967 "enable_mrf_countergradient with moisture requires implicit_moisture_diffusion = true");
1972 for (
int lev = 0; lev <= max_level; lev++) {
1982 void display (
int max_level, std::string pp_prefix)
1984 amrex::Print() <<
"SOLVER CHOICE: " << std::endl;
1985 for (
int lev = 0; lev <= max_level; lev++) {
1986 amrex::Print() <<
"At level " << lev <<
" : " << std::endl;
1988 amrex::Print() <<
" anelastic with no substepping, using the "
1989 << ((
anelastic_type[lev] == AnelasticType::MidPoint) ?
"MidPoint" :
"RK2")
1990 <<
" integrator" << std::endl;
1993 amrex::Print() <<
" compressible with no substepping" << std::endl;
1995 amrex::Print() <<
" compressible with implicit substepping" << std::endl;
1999 amrex::Print() <<
" and fixed density" << std::endl;
2003 for (
int lev = 0; lev <= max_level; lev++) {
2004 amrex::Print() <<
"vert_implicit_fac at level " << lev <<
" : "
2016 #ifdef ERF_IMPLICIT_W
2017 amrex::Print() <<
", including w";
2020 amrex::Print() <<
"; terrain metric implicit";
2022 amrex::Print() <<
")";
2025 amrex::Print() << std::endl;
2026 amrex::Print() <<
"use_coriolis : " <<
use_coriolis << std::endl;
2027 amrex::Print() <<
"use_gravity : " <<
use_gravity << std::endl;
2030 amrex::Print() <<
"Moisture Model: SAM" << std::endl;
2032 amrex::Print() <<
"Moisture Model: SAM No Ice" << std::endl;
2033 }
else if (
moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
2034 amrex::Print() <<
"Moisture Model: SAM No Precip No Ice" << std::endl;
2036 amrex::Print() <<
"Moisture Model: Morrison" << std::endl;
2038 amrex::Print() <<
"Moisture Model: Morrison_NoIce" << std::endl;
2040 amrex::Print() <<
"Moisture Model: WSM6" << std::endl;
2042 amrex::Print() <<
"Moisture Model: WDM6" << std::endl;
2044 amrex::Print() <<
"Moisture Model: Kessler" << std::endl;
2046 amrex::Print() <<
"Moisture Model: Kessler No Rain" << std::endl;
2048 amrex::Print() <<
"Moisture Model: Saturation Adjustment" << std::endl;
2050 amrex::Print() <<
"Moisture Model: SuperDroplets" << std::endl;
2051 }
else if (
moisture_type == MoistureType::MoistNoCondensation) {
2052 amrex::Print() <<
"Moisture Model: MoistNoCondensation" << std::endl;
2054 amrex::Print() <<
"Moisture Model: SBM mapped spectral advection (M3)" << std::endl;
2056 amrex::Print() <<
"Moisture Model: None" << std::endl;
2060 amrex::Print() <<
"Terrain Type: StaticFittedMesh" << std::endl;
2061 }
else if (
terrain_type == TerrainType::MovingFittedMesh) {
2062 amrex::Print() <<
"Terrain Type: MovingFittedMesh" << std::endl;
2064 amrex::Print() <<
"Terrain Type: EB" << std::endl;
2066 }
else if (
terrain_type == TerrainType::ImmersedForcing) {
2067 amrex::Print() <<
"Terrain Type: ImmersedForcing" << std::endl;
2069 amrex::Print() <<
"Terrain Type: None" << std::endl;
2072 amrex::Print() <<
"Flat fitted terrain: "
2076 amrex::Print() <<
"Buildings Type: ImmersedForcing" << std::endl;
2078 amrex::Print() <<
"Buildings Type: None" << std::endl;
2081 if (
mesh_type == MeshType::ConstantDz) {
2082 amrex::Print() <<
" Mesh Type: ConstantDz" << std::endl;
2083 }
else if (
mesh_type == MeshType::StretchedDz) {
2084 amrex::Print() <<
" Mesh Type: StretchedDz" << std::endl;
2085 }
else if (
mesh_type == MeshType::VariableDz) {
2086 amrex::Print() <<
" Mesh Type: VariableDz" << std::endl;
2088 amrex::Error(
"No mesh_type set!");
2091 amrex::Print() <<
"ABL Driver Type: " << std::endl;
2093 amrex::Print() <<
" None" << std::endl;
2095 amrex::Print() <<
" Pressure Gradient "
2099 amrex::Print() <<
" Geostrophic Wind "
2104 if (max_level > 0) {
2105 amrex::Print() <<
"Coupling Type: " << std::endl;
2107 amrex::Print() <<
" Two-way" << std::endl;
2109 amrex::Print() <<
" One-way" << std::endl;
2113 if (
rad_type == RadiationType::RRTMGP) {
2114 amrex::Print() <<
"Radiation Model: RRTMGP" << std::endl;
2115 }
else if (
rad_type == RadiationType::Simple) {
2116 amrex::Print() <<
"Radiation Model: Simple" << std::endl;
2117 }
else if (
rad_type == RadiationType::TwoStream) {
2118 amrex::Print() <<
"Radiation Model: TwoStream" << std::endl;
2120 amrex::Print() <<
"Radiation Model: None" << std::endl;
2123 amrex::Print() <<
"Gradp_type : " <<
gradp_type << std::endl;
2125 for (
int lev = 0; lev <= max_level; lev++) {
2126 amrex::Print() <<
"Buoyancy_type at level " << lev <<
" : " <<
buoyancy_type[lev] << std::endl;
2134 for (
int lev = 0; lev <= max_level; lev++) {
2145 amrex::ParmParse
pp(pp_prefix);
2148 double rot_time_period = 86400.0;
2149 pp.queryAdd(
"rotational_time_period", rot_time_period);
2157 pp.queryAdd(
"latitude", latitude_for_coriolis);
2159 sinphi = std::sin(latitude_for_coriolis);
2163 cosphi = std::cos(latitude_for_coriolis);
2171 amrex::Vector<amrex::Real> abl_geo_wind(3);
2172 pp.queryarr(
"abl_geo_wind",abl_geo_wind);
2181 amrex::Print() <<
"NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
2195 amrex::Vector<int>& vec_to_fill,
int default_int)
2197 amrex::ParmParse
pp(
"erf");
2198 int nvals =
pp.countval(string_to_read);
2200 amrex::Vector<int> temp; temp.resize(nvals);
2201 pp.queryarr(string_to_read,temp);
2203 if (vec_to_fill.size() < max_level+1) {
2204 vec_to_fill.resize(max_level+1);
2208 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
2209 }
else if (nvals == 1) {
2210 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
2212 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
2291 #ifdef AMREX_USE_FLOAT
2422 return pert_type[lev] == PerturbationType::Source ||
2423 pert_type[lev] == PerturbationType::Direct ||
2424 pert_type[lev] == PerturbationType::CPM ||
2425 pert_type[lev] == PerturbationType::CPM_W;
2435 return pert_type[lev] == PerturbationType::Direct ||
2436 pert_type[lev] == PerturbationType::CPM ||
2437 pert_type[lev] == PerturbationType::CPM_W;
2447 return pert_type[lev] == PerturbationType::Source;
2457 return pert_type[lev] == PerturbationType::CPM_W;
2507 if (type == PerturbationType::Source ||
2508 type == PerturbationType::Direct ||
2509 type == PerturbationType::CPM) {
2543 return (
rad_type == RadiationType::RRTMGP) || (
rad_type == RadiationType::Simple);
2557 return (
rad_type == RadiationType::RRTMGP) ||
2558 (
rad_type == RadiationType::TwoStream &&
lsm_type == LandSurfaceType::NOAHMP);
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:48
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:19
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:68
constexpr amrex::Real R_d
Definition: ERF_Constants.H:46
static const std::string BoundaryFaceName[]
Definition: ERF_DataStruct.H:205
TauType
Stress tensor component indices.
Definition: ERF_DataStruct.H:47
@ tau12
Definition: ERF_DataStruct.H:48
@ tau23
Definition: ERF_DataStruct.H:48
@ tau33
Definition: ERF_DataStruct.H:48
@ tau22
Definition: ERF_DataStruct.H:48
@ tau11
Definition: ERF_DataStruct.H:48
@ tau32
Definition: ERF_DataStruct.H:48
@ tau31
Definition: ERF_DataStruct.H:48
@ tau21
Definition: ERF_DataStruct.H:48
@ tau13
Definition: ERF_DataStruct.H:48
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:140
Rayleigh
Rayleigh damping profile component indices.
Definition: ERF_DataStruct.H:193
@ ubar
Definition: ERF_DataStruct.H:194
@ wbar
Definition: ERF_DataStruct.H:194
@ nvars
Definition: ERF_DataStruct.H:194
@ vbar
Definition: ERF_DataStruct.H:194
@ thetabar
Definition: ERF_DataStruct.H:194
Sponge
Sponge reference-state component indices.
Definition: ERF_DataStruct.H:201
@ nvars_sponge
Definition: ERF_DataStruct.H:202
@ vbar_sponge
Definition: ERF_DataStruct.H:202
@ ubar_sponge
Definition: ERF_DataStruct.H:202
MapFacType
Indices for map scale factors on mass and face grids.
Definition: ERF_DataStruct.H:35
@ v_x
Definition: ERF_DataStruct.H:37
@ num
Definition: ERF_DataStruct.H:37
@ u_y
Definition: ERF_DataStruct.H:38
@ v_y
Definition: ERF_DataStruct.H:38
@ m_y
Definition: ERF_DataStruct.H:38
@ u_x
Definition: ERF_DataStruct.H:37
@ m_x
Definition: ERF_DataStruct.H:37
Coord
Coordinate-axis selector.
Definition: ERF_DataStruct.H:185
AMREX_ENUM(PlotFileType, None, Amrex, Netcdf)
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:51
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:49
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:50
#define RhoQ11_comp
Definition: ERF_IndexDefines.H:58
#define RhoQ9_comp
Definition: ERF_IndexDefines.H:56
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:48
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:53
#define RhoQ8_comp
Definition: ERF_IndexDefines.H:55
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:52
#define RhoQ7_comp
Definition: ERF_IndexDefines.H:54
#define RhoQ10_comp
Definition: ERF_IndexDefines.H:57
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
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:105
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:81
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:105
Definition: ERF_NOAHMP.H:57
Definition: ERF_SLM.H:185
Definition: ERF_SatAdj.H:47
Definition: ERF_SimpleAD.H:8
Definition: ERF_WDM6.H:108
Definition: ERF_WSM6.H:121
@ None
Definition: ERF_LSM_Types.H:6
Definition: ERF_AdvStruct.H:19
void display(std::string &pp_prefix)
Print the configured advection choices.
Definition: ERF_AdvStruct.H:243
void init_params(std::string pp_prefix)
Read advection options from the input parameter database.
Definition: ERF_AdvStruct.H:25
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:22
MolecDiffType molec_diff_type
Selected molecular transport model.
Definition: ERF_DiffStruct.H:94
void init_params(std::string pp_prefix)
Read diffusion options from the input parameter database.
Definition: ERF_DiffStruct.H:28
void display()
Print the configured diffusion options.
Definition: ERF_DiffStruct.H:77
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:486
int comp[max_size]
Definition: ERF_DataStruct.H:488
int size
Definition: ERF_DataStruct.H:489
bool empty() const
Definition: ERF_DataStruct.H:495
void append(int c)
Append a component, ignoring the ones the scheme does not carry.
Definition: ERF_DataStruct.H:492
static constexpr int max_size
qv, qc, qi, qr, qs, qg
Definition: ERF_DataStruct.H:487
Whether this map decides a variable's availability, and if so whether the variable is available.
Definition: ERF_DataStruct.H:614
bool available
the active scheme carries the data behind it
Definition: ERF_DataStruct.H:616
bool governed
the name is a moisture output variable
Definition: ERF_DataStruct.H:615
The moisture data carried by the active microphysics scheme.
Definition: ERF_DataStruct.H:238
int nc
cloud liquid water number
Definition: ERF_DataStruct.H:259
int qs
snow
Definition: ERF_DataStruct.H:253
int cond_rate
condensation rate
Definition: ERF_DataStruct.H:282
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:576
int nn
CCN / total aerosol number.
Definition: ERF_DataStruct.H:269
int qr
rain
Definition: ERF_DataStruct.H:252
static constexpr int absent
not carried by the active scheme
Definition: ERF_DataStruct.H:241
int graup_accum
accumulated surface graupel
Definition: ERF_DataStruct.H:280
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:538
MoistureComponentIndices()=default
Construct an empty map, i.e. a dry run.
int qi
cloud ice
Definition: ERF_DataStruct.H:251
int rel_hum
relative humidity
Definition: ERF_DataStruct.H:281
static constexpr int computed_from_state
Definition: ERF_DataStruct.H:242
int ni
cloud ice number
Definition: ERF_DataStruct.H:260
int qv
water vapor
Definition: ERF_DataStruct.H:249
int rain_accum
accumulated surface rain
Definition: ERF_DataStruct.H:278
CompList nonprecipitating_comps() const
Components summed for non-precipitating water, "qn": vapor plus the suspended condensate....
Definition: ERF_DataStruct.H:514
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:554
int snow_accum
accumulated surface snow
Definition: ERF_DataStruct.H:279
CompList total_water_comps() const
Components summed for total water, "qt": every mass mixing ratio.
Definition: ERF_DataStruct.H:503
int nr
rain number
Definition: ERF_DataStruct.H:261
int qc
cloud liquid water
Definition: ERF_DataStruct.H:250
int ng
graupel number
Definition: ERF_DataStruct.H:263
CompList precipitating_comps() const
Components summed for precipitating water, "qp": the falling species.
Definition: ERF_DataStruct.H:523
int qg
graupel
Definition: ERF_DataStruct.H:254
bool has_moisture() const
Test whether the active scheme carries any moisture at all.
Definition: ERF_DataStruct.H:564
int ns
snow number
Definition: ERF_DataStruct.H:262
VarAvailability query_var(const std::string &name) const
Classify an output variable name against this index map.
Definition: ERF_DataStruct.H:630
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:675
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:338
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:304
int qmoist_index_for_var(const std::string &name) const
The qmoist slot behind a moist diagnostic output name.
Definition: ERF_DataStruct.H:601
Container holding radiation-related choices and parameters.
Definition: ERF_RadStruct.H:86
void init_params(bool two_stream_selected, std::string pp_prefix)
Definition: ERF_RadStruct.H:858
Definition: ERF_DataStruct.H:685
bool use_coupled_sst
Definition: ERF_DataStruct.H:2562
int sbm_moment_mode
Definition: ERF_DataStruct.H:2526
bool custom_geostrophic_profile
Whether a custom geostrophic wind profile is used.
Definition: ERF_DataStruct.H:2363
int n_ensemble
Number of ensemble members.
Definition: ERF_DataStruct.H:2643
WindFarmLocType windfarm_loc_type
Coordinate system for wind-farm turbine locations.
Definition: ERF_DataStruct.H:2534
bool implicit_before_substep
Whether implicit diffusion is applied before acoustic substepping.
Definition: ERF_DataStruct.H:2284
amrex::Real const_massflux_v
Target constant mass flux in the y direction.
Definition: ERF_DataStruct.H:2624
std::string hindcast_boundary_data_dir
Directory containing hindcast lateral boundary data.
Definition: ERF_DataStruct.H:2631
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:2334
amrex::Real ens_pert_correlated_radius
Spatial correlation radius for ensemble perturbations.
Definition: ERF_DataStruct.H:2644
amrex::Real forest_leaf_theta_fixed
Definition: ERF_DataStruct.H:2620
static InitType init_type
Initial-condition source selected for the run.
Definition: ERF_DataStruct.H:2218
amrex::Real coriolis_factor
Twice the planetary rotation rate used for Coriolis forcing.
Definition: ERF_DataStruct.H:2353
bool io_hurricane_eye_tracker
Whether hurricane-eye tracking output is enabled.
Definition: ERF_DataStruct.H:2639
static bool flat_terrain
Permit fixed-index planar averages after validating a flat fitted mesh.
Definition: ERF_DataStruct.H:2227
std::string abl_geo_wind_table
Path to a time-varying geostrophic wind table.
Definition: ERF_DataStruct.H:2567
amrex::Vector< int > fixed_density
Per-level flag selecting fixed-density treatment; always 1 at an anelastic level.
Definition: ERF_DataStruct.H:2261
amrex::Vector< TurbChoice > turbChoice
Turbulence options for each AMR level.
Definition: ERF_DataStruct.H:2252
amrex::Real const_massflux_layer_lo
Lower height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2626
amrex::Real hindcast_zhi_sponge_length
Length of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2636
amrex::Real gravity
Effective gravitational acceleration.
Definition: ERF_DataStruct.H:2343
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:1808
bool pbl_suppresses_microphysics_condensation() const noexcept
Query whether the active PBL scheme suppresses microphysics condensation.
Definition: ERF_DataStruct.H:2495
bool variable_coriolis
Whether spatially varying Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2570
bool implicit_moisture_diffusion
Whether implicit vertical moisture diffusion is included.
Definition: ERF_DataStruct.H:2281
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:2524
void display(int max_level, std::string pp_prefix)
Print the configured solver, physics, and transport options.
Definition: ERF_DataStruct.H:1982
amrex::Real poisson_abstol
Absolute tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2295
amrex::Real if_Cd_momentum
Immersed-forcing drag coefficient for momentum.
Definition: ERF_DataStruct.H:2317
bool nudging_t
Definition: ERF_DataStruct.H:2384
amrex::Real if_Olen_in
Input Obukhov length for immersed-forcing MOST [m].
Definition: ERF_DataStruct.H:2327
amrex::Vector< int > buoyancy_type
Per-level buoyancy formulation selector.
Definition: ERF_DataStruct.H:2263
bool forest_biophysics
Definition: ERF_DataStruct.H:2618
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Build constant-latitude Coriolis forcing parameters.
Definition: ERF_DataStruct.H:2143
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:2523
bool use_pert_pres_gradient
Whether momentum equations use perturbational pressure gradients.
Definition: ERF_DataStruct.H:2303
bool sbm_test_native_qc_write_fault
Definition: ERF_DataStruct.H:2528
amrex::Vector< int > project_initial_velocity
Per-level flag for projecting the initial velocity.
Definition: ERF_DataStruct.H:2262
int ave_plane
Averaging plane index used by diagnostics.
Definition: ERF_DataStruct.H:2572
amrex::Real const_massflux_u
Target constant mass flux in the x direction.
Definition: ERF_DataStruct.H:2623
bool nudging_q
Definition: ERF_DataStruct.H:2385
int ncorr
Number of projection correction iterations.
Definition: ERF_DataStruct.H:2289
amrex::Real sampling_distance_by_D
Turbine inflow sampling distance normalized by rotor diameter.
Definition: ERF_DataStruct.H:2581
amrex::Real windfarm_y_shift
Wind-farm y-coordinate shift.
Definition: ERF_DataStruct.H:2584
bool use_rotate_surface_flux
Whether MOST surface fluxes are rotated with terrain.
Definition: ERF_DataStruct.H:2392
bool moisture_tight_coupling
Whether moisture updates use tight coupling.
Definition: ERF_DataStruct.H:2577
EBChoice ebChoice
Embedded-boundary options.
Definition: ERF_DataStruct.H:2253
bool compute_mean_vars
Definition: ERF_DataStruct.H:2409
amrex::Real beta_s
Time off-centering coefficient for forward weighting.
Definition: ERF_DataStruct.H:2271
bool implicit_ke_diffusion
Whether implicit vertical TKE diffusion is included.
Definition: ERF_DataStruct.H:2282
bool interp_atmos_from_coarse
Definition: ERF_DataStruct.H:2612
bool any_perturbation() const
Query whether any level uses a turbulent perturbation mode.
Definition: ERF_DataStruct.H:2504
amrex::Real if_z0
Immersed-forcing roughness length [m].
Definition: ERF_DataStruct.H:2323
bool forest_substep
Whether canopy source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2314
bool use_wrf_bdy_density
Definition: ERF_DataStruct.H:2590
bool implicit_thermal_diffusion
Whether implicit vertical thermal diffusion is included.
Definition: ERF_DataStruct.H:2280
std::string mean_vars_reset_mode
Definition: ERF_DataStruct.H:2412
bool use_gravity
Whether gravitational forcing is enabled.
Definition: ERF_DataStruct.H:2306
amrex::Real num_diff_coeff
Numerical diffusion coefficient after input scaling.
Definition: ERF_DataStruct.H:2521
amrex::Real bdy_nudge_factor
Boundary sponge nudging factor.
Definition: ERF_DataStruct.H:2587
int sbm_cloud_rain_split
Definition: ERF_DataStruct.H:2527
amrex::Real rdOcp
Ratio of dry-air gas constant to c_p.
Definition: ERF_DataStruct.H:2345
bool use_wvel_perturbation(int lev) const
Query whether vertical-velocity CPM perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2455
bool hindcast_lateral_forcing
Whether hindcast lateral forcing is enabled.
Definition: ERF_DataStruct.H:2633
bool do_theta_advection
Whether custom vertical subsidence is applied to rho-theta.
Definition: ERF_DataStruct.H:2361
bool use_native_shoc
Whether any level uses the native SHOC PBL scheme.
Definition: ERF_DataStruct.H:2396
amrex::Real nudging_q_z2
Definition: ERF_DataStruct.H:2381
static bool use_real_bcs
Whether real-data lateral boundary conditions are used.
Definition: ERF_DataStruct.H:2233
bool spatial_moisture_forcing
Whether spatially varying moisture forcing is enabled.
Definition: ERF_DataStruct.H:2366
amrex::Vector< SubsteppingType > substepping_type
Acoustic substepping type for each AMR level.
Definition: ERF_DataStruct.H:2258
amrex::Real nudging_u_z2
Definition: ERF_DataStruct.H:2377
bool use_perturbation(int lev) const
Query whether any turbulent perturbation mode is enabled on a level.
Definition: ERF_DataStruct.H:2420
static SoundingType sounding_type
Interpretation used for input sounding profiles.
Definition: ERF_DataStruct.H:2221
int bdy_moist_nudge_type
Moist-variable nudging strategy in boundary regions.
Definition: ERF_DataStruct.H:2599
amrex::Real poisson_reltol
Relative tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2296
bool use_coriolis
Whether Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2307
amrex::Vector< PerturbationType > pert_type
Turbulent perturbation type for each AMR level.
Definition: ERF_DataStruct.H:2517
static MeshType mesh_type
Vertical mesh representation.
Definition: ERF_DataStruct.H:2236
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:2248
UrbanType urban_type
Definition: ERF_DataStruct.H:2536
SpongeChoice spongeChoice
Sponge-layer options.
Definition: ERF_DataStruct.H:2251
void init_params(int max_level, std::string pp_prefix)
Read solver-wide algorithmic options from the input parameter database.
Definition: ERF_DataStruct.H:692
bool time_avg_vel
Whether time-averaged velocity fields are output.
Definition: ERF_DataStruct.H:2406
bool use_direct_perturbation(int lev) const
Query whether direct turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2433
bool have_geo_wind_profile
Whether a geostrophic wind profile has been configured.
Definition: ERF_DataStruct.H:2568
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Applied ABL pressure-gradient forcing vector.
Definition: ERF_DataStruct.H:2565
RadChoice radChoice
Definition: ERF_DataStruct.H:2254
amrex::Vector< int > anelastic
Per-level flag selecting anelastic dynamics.
Definition: ERF_DataStruct.H:2259
bool four_stream_radiation
Whether the four-stream radiation approximation is enabled.
Definition: ERF_DataStruct.H:2310
int gradp_type
Terrain-fitted horizontal pressure-gradient formulation.
Definition: ERF_DataStruct.H:2301
DampingChoice dampingChoice
Damping-related options.
Definition: ERF_DataStruct.H:2250
amrex::Real if_damp_alpha
Immersed-forcing damping coefficient.
Definition: ERF_DataStruct.H:2332
bool rebalance_wrf_input
Whether to rebalance states from wrfinput and wrfbdy data.
Definition: ERF_DataStruct.H:2340
bool wrfinput_zlevels_from_file
Definition: ERF_DataStruct.H:2609
amrex::Vector< amrex::Real > sbm_edges
Definition: ERF_DataStruct.H:2530
amrex::Real turb_disk_angle
Turbine disk angle from the x axis [deg].
Definition: ERF_DataStruct.H:2582
amrex::Real hindcast_data_interval_in_hrs
Time interval between hindcast data files [hr].
Definition: ERF_DataStruct.H:2632
amrex::Real const_massflux_layer_hi
Upper height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2627
std::string wall_dist_type
Definition: ERF_DataStruct.H:2290
bool avg_grid_faces_to_nodes
Definition: ERF_DataStruct.H:2602
std::string windfarm_spec_table_extra
Additional wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2579
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:2331
amrex::Real lsf_timescale
Definition: ERF_DataStruct.H:2389
bool is_init_for_ensemble
Whether initialization is for an ensemble simulation.
Definition: ERF_DataStruct.H:2642
bool uses_shoc_family() const noexcept
Query whether any SHOC-family PBL scheme is active.
Definition: ERF_DataStruct.H:2464
bool test_mapfactor
Whether to use test map scale factors.
Definition: ERF_DataStruct.H:2299
amrex::Real nudging_u_z1
Definition: ERF_DataStruct.H:2376
bool if_snap_partial_cells
Definition: ERF_DataStruct.H:2329
amrex::Vector< amrex::Real > sbm_pivots
Definition: ERF_DataStruct.H:2531
std::string coarse_bckgnd_data_file
Coarse background data file used for ensemble initialization.
Definition: ERF_DataStruct.H:2646
bool do_forest_drag
Whether forest canopy drag is enabled.
Definition: ERF_DataStruct.H:2615
amrex::Real dz0
Initial vertical grid spacing for stretched-grid setup.
Definition: ERF_DataStruct.H:2350
amrex::Real windfarm_x_shift
Wind-farm x-coordinate shift.
Definition: ERF_DataStruct.H:2583
bool use_lagged_delta_rt
Whether to use lagged delta terms for moving terrain.
Definition: ERF_DataStruct.H:2337
amrex::Real ens_pert_amplitude
Amplitude of ensemble initialization perturbations.
Definition: ERF_DataStruct.H:2645
std::string windfarm_airfoil_tables
Wind-farm airfoil table paths.
Definition: ERF_DataStruct.H:2580
amrex::Vector< AnelasticType > anelastic_type
Per-level two-stage scheme used by the anelastic integrator.
Definition: ERF_DataStruct.H:2260
amrex::Real bdy_rho_nudge_factor
Definition: ERF_DataStruct.H:2596
amrex::Real nudging_q_z1
Definition: ERF_DataStruct.H:2380
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Per-level, per-stage implicit vertical diffusion factors.
Definition: ERF_DataStruct.H:2277
bool transport_scalar
Whether the passive scalar component is transported.
Definition: ERF_DataStruct.H:2403
bool hindcast_zhi_sponge_damping
Whether upper-boundary hindcast sponge damping is enabled.
Definition: ERF_DataStruct.H:2637
amrex::Real hurricane_eye_longitude
Initial hurricane-eye longitude.
Definition: ERF_DataStruct.H:2640
bool nudging_from_observations
Whether solution fields are nudged toward observations at stations.
Definition: ERF_DataStruct.H:2374
LandSurfaceType lsm_type
Land-surface model.
Definition: ERF_DataStruct.H:2535
int massflux_khi
Upper vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2629
bool large_scale_forcing
Definition: ERF_DataStruct.H:2387
bool implicit_terrain_metric
Whether the compact terrain-metric part of the vertical diffusion is solved implicitly.
Definition: ERF_DataStruct.H:2287
bool substepping_diag
Whether to emit extra CFL diagnostics for compressible substepping.
Definition: ERF_DataStruct.H:2267
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:2224
amrex::Real mean_vars_reset_time
Definition: ERF_DataStruct.H:2413
std::string windfarm_blade_table
Wind-farm blade table path.
Definition: ERF_DataStruct.H:2580
amrex::Vector< int > is_land
Per-level land/water selector.
Definition: ERF_DataStruct.H:2264
amrex::Real hindcast_lateral_sponge_strength
Strength of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2635
bool forest_biophysics_heat
Definition: ERF_DataStruct.H:2619
ShocTransportMode shoc_transport_mode
Definition: ERF_DataStruct.H:2399
amrex::Real hurricane_eye_latitude
Initial hurricane-eye latitude.
Definition: ERF_DataStruct.H:2640
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:2542
amrex::Real cosphi
Cosine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2354
amrex::Real if_Cd_scalar
Immersed-forcing drag coefficient for scalars.
Definition: ERF_DataStruct.H:2318
static BuildingsType buildings_type
Building representation.
Definition: ERF_DataStruct.H:2230
std::string windfarm_loc_table
Wind-farm location table path.
Definition: ERF_DataStruct.H:2579
std::string hindcast_surface_data_dir
Directory containing hindcast surface boundary data.
Definition: ERF_DataStruct.H:2631
ShocMomentumTransport shoc_momentum_transport
Definition: ERF_DataStruct.H:2400
bool custom_rhotheta_forcing
Whether custom rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2358
bool sbm_test_donor_cfl_fault
Definition: ERF_DataStruct.H:2529
amrex::Real zsurf
Nominal surface height for stretched-grid setup.
Definition: ERF_DataStruct.H:2349
amrex::Real if_init_surf_temp
Initial immersed-forcing surface temperature [K].
Definition: ERF_DataStruct.H:2325
amrex::Real nudging_t_z2
Definition: ERF_DataStruct.H:2379
int massflux_klo
Lower vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2628
std::string lsf_file
Definition: ERF_DataStruct.H:2388
std::string windfarm_spec_table
Wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2579
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Applied geostrophic-wind forcing vector.
Definition: ERF_DataStruct.H:2566
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:2194
ABLDriverType abl_driver_type
Atmospheric boundary-layer driver type.
Definition: ERF_DataStruct.H:2564
DiffChoice diffChoice
Diffusion-related options.
Definition: ERF_DataStruct.H:2249
amrex::Real if_surf_temp_flux
Immersed-forcing surface temperature flux [K m/s].
Definition: ERF_DataStruct.H:2324
bool spatial_rhotheta_forcing
Whether spatially varying rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2365
amrex::Vector< int > urban_enabled_lev
Definition: ERF_DataStruct.H:2537
WindFarmType windfarm_type
Wind-farm model.
Definition: ERF_DataStruct.H:2533
bool use_source_perturbation(int lev) const
Query whether source-term turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2445
bool custom_w_subsidence
Whether custom vertical subsidence is enabled.
Definition: ERF_DataStruct.H:2360
bool rad_feeds_lsm() const
True when the radiation model's outputs feed the land model (downwelling shortwave,...
Definition: ERF_DataStruct.H:2556
bool custom_moisture_forcing
Whether custom moisture forcing is enabled.
Definition: ERF_DataStruct.H:2359
amrex::Real if_surf_heating_rate
Immersed-forcing surface heating rate [K/hr].
Definition: ERF_DataStruct.H:2326
int sbm_nbins
Definition: ERF_DataStruct.H:2525
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:2575
RadiationType rad_type
Radiation model.
Definition: ERF_DataStruct.H:2538
amrex::Real grid_stretching_ratio
Vertical grid stretching ratio.
Definition: ERF_DataStruct.H:2348
bool hindcast_surface_bcs
Whether hindcast surface boundary conditions are enabled.
Definition: ERF_DataStruct.H:2634
bool host_owns_vertical_scalar_diffusion() const noexcept
Test whether the host owns scalar diffusion.
Definition: ERF_DataStruct.H:2484
bool immersed_forcing_substep
Whether immersed-forcing source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2313
bool if_use_most
Whether immersed-forcing MOST is enabled.
Definition: ERF_DataStruct.H:2328
amrex::Real const_massflux_tau
Relaxation time scale for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2625
amrex::Real hindcast_lateral_sponge_length
Length of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2635
bool use_eamxx_shoc
Whether any level uses the EAMxx SHOC PBL scheme.
Definition: ERF_DataStruct.H:2395
amrex::Real sinphi
Sine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2355
bool host_owns_vertical_momentum_diffusion() const noexcept
Test whether the host owns momentum diffusion.
Definition: ERF_DataStruct.H:2473
amrex::Real hindcast_zhi_sponge_strength
Strength of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2636
bool coriolis_3d
Whether the three-dimensional Coriolis terms are included.
Definition: ERF_DataStruct.H:2308
int force_stage1_single_substep
Flag forcing a single substep in the first RK stage.
Definition: ERF_DataStruct.H:2256
amrex::Real c_p
Specific heat at constant pressure for dry air [J/(kg-K)].
Definition: ERF_DataStruct.H:2344
bool if_implicit_drag
Definition: ERF_DataStruct.H:2321
bool implicit_momentum_diffusion
Whether implicit vertical momentum diffusion is included.
Definition: ERF_DataStruct.H:2283
bool do_mom_advection
Whether custom vertical subsidence is applied to momentum.
Definition: ERF_DataStruct.H:2362
bool if_stability_correction
Whether immersed-forcing stability corrections are enabled.
Definition: ERF_DataStruct.H:2330
amrex::Real nudging_t_z1
Definition: ERF_DataStruct.H:2378
amrex::Vector< amrex::Real > sbm_fixture_initial_state
Definition: ERF_DataStruct.H:2532
bool custom_forcing_prim_vars
Whether custom forcing operates on primitive variables.
Definition: ERF_DataStruct.H:2364
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:2333
bool nudging_u
Definition: ERF_DataStruct.H:2383
bool nudging_from_input_sounding
Whether solution fields are nudged toward input sounding data.
Definition: ERF_DataStruct.H:2370
static void set_mesh_type(MeshType new_mesh_type)
Override the globally selected mesh type.
Definition: ERF_DataStruct.H:2243
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:2520
bool use_wrf_bdy_qc_qi
Whether WRF cloud water and active cloud ice are ingested at real boundaries.
Definition: ERF_DataStruct.H:2593
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