1 #ifndef ERF_DATA_STRUCT_H_
2 #define ERF_DATA_STRUCT_H_
7 #include <AMReX_ParmParse.H>
8 #include <AMReX_Print.H>
10 #include <AMReX_Geometry.H>
47 None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, ConstantDensity, ConstantDensityLinearTheta,
48 Isentropic, MoistBaseState, HindCast
55 ConstantDensity, Ideal, Isentropic, DryIsentropic
62 None, PressureGradient, GeostrophicWind
95 ConstantDz, StretchedDz, VariableDz
102 None, StaticFittedMesh, MovingFittedMesh, EB, ImmersedForcing
109 None, ImmersedForcing
116 Eulerian, Lagrangian, Undefined
123 SAM, SAM_NoIce, SAM_NoPrecip_NoIce,
Kessler, Kessler_NoRain,
SatAdj,
Morrison, Morrison_NoIce,
WSM6,
WDM6, SuperDroplets,
MoistNoCondensation, None
133 const MoistureType moisture_type,
134 const bool any_anelastic) noexcept
136 return any_anelastic && moisture_type == MoistureType::SuperDroplets;
164 None, RRTMGP, Simple, TwoStream
300 :
qv(qv_comp),
qc(qc_comp),
qi(qi_comp),
qr(qr_comp),
qs(qs_comp),
qg(qg_comp),
301 nc(nc_comp),
ni(ni_comp),
nr(nr_comp),
ns(ns_comp),
ng(ng_comp),
327 switch (moisture_type) {
329 case MoistureType::None:
333 case MoistureType::MoistNoCondensation:
334 case MoistureType::SAM_NoPrecip_NoIce:
335 case MoistureType::Kessler_NoRain:
342 case MoistureType::SatAdj:
350 case MoistureType::Kessler:
358 case MoistureType::SAM_NoIce:
367 case MoistureType::SAM:
368 case MoistureType::WSM6:
382 case MoistureType::Morrison:
401 case MoistureType::Morrison_NoIce:
414 case MoistureType::WDM6:
432 case MoistureType::SuperDroplets:
450 amrex::Abort(
"Unknown MoistureType in MoistureComponentIndices::from_moisture_model");
472 [[nodiscard]]
bool empty ()
const {
return (
size == 0); }
516 return ( (comp >= 0) &&
517 ( (comp ==
qv) || (comp ==
qc) || (comp ==
qi) ||
518 (comp ==
qr) || (comp ==
qs) || (comp ==
qg) ||
519 (comp ==
nc) || (comp ==
ni) || (comp ==
nr) ||
520 (comp ==
ns) || (comp ==
ng) || (comp ==
nn) ) );
554 if (
name ==
"qv") {
return qv; }
555 if (
name ==
"qc") {
return qc; }
556 if (
name ==
"qi") {
return qi; }
557 if (
name ==
"qrain") {
return qr; }
558 if (
name ==
"qsnow") {
return qs; }
559 if (
name ==
"qgraup") {
return qg; }
560 if (
name ==
"nc") {
return nc; }
561 if (
name ==
"ni") {
return ni; }
562 if (
name ==
"nr") {
return nr; }
563 if (
name ==
"ns") {
return ns; }
564 if (
name ==
"ng") {
return ng; }
565 if (
name ==
"nn") {
return nn; }
610 if ( (
name ==
"qv") || (
name ==
"qc") || (
name ==
"qi") ||
611 (
name ==
"qrain") || (
name ==
"qsnow") || (
name ==
"qgraup") ||
618 if ( (
name ==
"rain_accum") || (
name ==
"snow_accum") ||
619 (
name ==
"graup_accum") || (
name ==
"rel_humidity") ||
620 (
name ==
"condensation_rate") ) {
630 if ( (
name ==
"qn") || (
name ==
"moist_density") ) {
631 return {
true, (
qv >= 0) && (
qc >= 0)};
635 if ( (
name ==
"qsat") || (
name ==
"precipitable") ) {
639 return {
false,
false};
671 amrex::ParmParse
pp(pp_prefix);
674 if (
pp.query(
"use_terrain",bogus_bool) > 0) {
675 amrex::Error(
"The input use_terrain is deprecated. Set terrain_type instead.");
678 if (
pp.query(
"use_moist_background",bogus_bool) > 0) {
679 amrex::Error(
"The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
698 amrex::Error(
"The input moisture_type is deprecated. Set moisture_model instead.");
712 for (
int i = 0; i <= max_level; ++i) {
726 pp.query_enum_case_insensitive(
"land_surface_model",
lsm_type);
735 for (
int lev = 0; lev <= max_level; ++lev) {
737 amrex::Print() <<
"Level " << lev <<
" is land" << std::endl;
738 }
else if (
is_land[lev] == 0) {
739 amrex::Print() <<
"Level " << lev <<
" is water" << std::endl;
741 amrex::Error(
"is_land should be 0 or 1");
747 pp.query_enum_case_insensitive(
"radiation_model",
rad_type);
750 #ifndef ERF_USE_RRTMGP
751 if (
rad_type == RadiationType::RRTMGP)
753 amrex::Error(
"ERF was not compiled with RRTMGP enabled!");
758 std::string terrain_type_temp =
"";
759 pp.queryAdd(
"terrain_type", terrain_type_temp);
760 if (terrain_type_temp ==
"Moving") {
761 amrex::Warning(
"erf.terrain_type = Moving is deprecated; please replace Moving by MovingFittedMesh");
763 }
else if (terrain_type_temp ==
"Static") {
764 amrex::Warning(
"erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
771 std::string buildings_type_temp =
"";
772 pp.queryAdd(
"buildings_type", buildings_type_temp);
773 if (buildings_type_temp ==
"ImmersedForcing") {
780 std::string init_type_temp_string;
782 int found =
pp.queryAdd(
"init_type",init_type_temp_string);
784 if ( (init_type_temp_string ==
"Real") || (init_type_temp_string ==
"real") ) {
785 amrex::Error(
"erf.init_type = Real is deprecated; please replace Real by WRFInput");
786 }
else if ( (init_type_temp_string ==
"Ideal") || (init_type_temp_string ==
"ideal") ) {
787 amrex::Error(
"erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
789 pp.query_enum_case_insensitive(
"init_type",
init_type);
795 amrex::Error(
"Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
799 if (
init_type == InitType::MoistBaseState) {
801 amrex::Error(
"Makes no sense to have moist base state with no moisture model");
807 amrex::Error(
"Can't have moisture_type = None with init_type = WRFInput");
811 std::string nc_bdy_file_temp_string;
812 bool has_bdy =
pp.queryAdd(
"nc_bdy_file", nc_bdy_file_temp_string);
816 pp.queryAdd(
"use_real_bcs", use_real_bcs_temp);
822 if (found == 0 ||
init_type == InitType::None) {
823 amrex::Print() <<
"init_type must now be set. The options are " << std::endl;
824 amrex::Print() <<
" Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
825 amrex::Print() <<
" ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
826 amrex::Error(
"Please add a string for init_type to your inputs file or command line");
830 if (
init_type == InitType::Input_Sounding) {
844 amrex::Abort(
"SAM is not correct with variable dz -- choose another moisture model");
850 "The grid stretching ratio must be greater than 1");
859 pp.queryAdd(
"zsurface",
zsurf);
861 amrex::Print() <<
"Nominal zsurface height != 0, may result in unexpected behavior"
864 pp.get(
"initial_dz",
dz0);
867 int n_zlevels =
pp.countval(
"terrain_z_levels");
886 if (
pp.contains(
"use_wrf_height_grid")) {
887 amrex::Abort(
"erf.use_wrf_height_grid has been renamed. "
888 "Set erf.avg_grid_faces_to_nodes instead; it carries "
889 "the same meaning (average the input z-face heights "
890 "onto the nodes rather than reconstructing them).");
902 amrex::Print() <<
"Must rebalance when not averaging the input height grid. Setting rebalance_wrf_input to true \n";
911 amrex::Print() <<
"Setting use_gravity to true due to init_type = WRFInput / Metgrid " << std::endl;
917 pp.queryAdd(
"c_p",
c_p);
928 bool any_anelastic =
false;
929 bool any_compress =
false;
930 for (
int i = 0; i <= max_level; ++i) {
935 any_anelastic =
true;
942 amrex::Error(
"erf.moisture_model = SuperDroplets is not supported with "
943 "erf.anelastic = 1: the Super-Droplet path currently uses "
944 "the compressible equation of state. Use compressible "
945 "dynamics or a supported Eulerian moisture model.");
966 for (
int i = 0; i <= max_level; i++) {
970 for (
int i = 0; i <= max_level; i++) {
975 if (
pp.contains(
"anelastic_type") && !any_anelastic) {
976 amrex::Print() <<
"Ignoring erf.anelastic_type because no level is anelastic" << std::endl;
977 for (
int i = 0; i <= max_level; i++) {
anelastic_type[i] = AnelasticType::RK2; }
985 for (
int i = 0; i <= max_level; i++) {
989 for (
int i = 0; i <= max_level; i++) {
1001 int nvals_old =
pp.countval(
"no_substepping");
1002 if (nvals_old > 0) {
1003 amrex::Error(
"The no_substepping flag is deprecated -- set substepping_type instead");
1012 amrex::Error(
"erf.wall_dist_type must be poisson or terrain_height");
1016 #ifdef AMREX_USE_FLOAT
1020 for (
int lev = 0; lev <= max_level; lev++) {
1047 "forest_biophysics_heat requires forest_biophysics = true");
1051 "forest_biophysics_heat requires a positive forest_leaf_theta_fixed");
1054 "forest_leaf_theta_fixed requires forest_biophysics_heat = true");
1077 amrex::Print() <<
"erf.if_snap_partial_cells: using the point-implicit drag (erf.if_implicit_drag = true)\n";
1088 amrex::Error(
"Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
1108 for (
int lev = 0; lev <= max_level; ++lev) {
1109 pert_type[lev] = PerturbationType::None;
1111 pp,
"perturbation_type",
pert_type[lev], lev, max_level);
1114 amrex::Vector<amrex::Real> abl_pressure_grad_in = {
zero,
zero,
zero};
1115 pp.queryarr(
"abl_pressure_grad",abl_pressure_grad_in);
1116 for(
int i = 0; i < AMREX_SPACEDIM; ++i)
abl_pressure_grad[i] = abl_pressure_grad_in[i];
1118 amrex::Vector<amrex::Real> abl_geo_forcing_in = {
zero,
zero,
zero};
1119 if(
pp.queryarr(
"abl_geo_forcing",abl_geo_forcing_in)) {
1120 amrex::Print() <<
"Specified abl_geo_forcing: (";
1121 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
1125 amrex::Print() <<
")" << std::endl;
1145 int nudging_u_z1_set =
pp.queryAdd(
"nudging_u_z1",
nudging_u_z1);
1146 int nudging_u_z2_set =
pp.queryAdd(
"nudging_u_z2",
nudging_u_z2);
1153 "nudging_u_z1 must be less than or equal to nudging_u_z2");
1155 "nudging_t_z1 must be less than or equal to nudging_t_z2");
1157 "nudging_q_z1 must be less than or equal to nudging_q_z2");
1167 amrex::Print() <<
"WARNING: erf.nudging_u = false has no effect when erf.large_scale_forcing "
1168 "= true; momentum nudging is then controlled solely by large_scale_forcing.\n";
1170 if (nudging_u_z1_set || nudging_u_z2_set) {
1171 amrex::Print() <<
"WARNING: erf.nudging_u_z1/erf.nudging_u_z2 are ignored when "
1172 "erf.large_scale_forcing = true; momentum nudging is then applied "
1173 "at all heights.\n";
1179 "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
1186 "Numerical diffusion coefficient must be between 0 & one");
1189 amrex::Print() <<
"6th-order numerical diffusion turned on with coefficient = "
1201 for (
int lev = 0; lev <= max_level; lev++) {
1202 turbChoice[lev].init_params(lev,max_level,pp_prefix);
1210 for (
int lev = 0; lev <= max_level; lev++) {
1218 for (
int lev = 0; lev <= max_level; lev++) {
1219 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1223 amrex::Print() <<
"YSU PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1226 amrex::Error(
"YSU cannot use ERF coriolis frequency if not using coriolis");
1231 for (
int lev = 0; lev <= max_level; lev++) {
1232 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
1236 amrex::Print() <<
"MRF PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
1239 amrex::Error(
"MRF cannot use ERF coriolis frequency if not using coriolis");
1261 if (bdy_moist_nudge_type < 0 || bdy_moist_nudge_type > 3) {
1262 amrex::Error(
"erf.bdy_moist_nudge_type must be one of 0, 1, 2, or 3");
1265 amrex::Error(
"erf.bdy_moist_nudge_type = 3 requires erf.use_wrf_bdy_qc_qi = true");
1269 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires an active moisture model");
1272 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires WRFInput real boundary conditions");
1276 amrex::Error(
"erf.use_wrf_bdy_qc_qi requires active qv and qc component indices");
1282 for (
const int comp : optional_moisture_comps) {
1283 if (comp != -1 && (comp < RhoQ1_comp || comp >
RhoQ11_comp)) {
1284 amrex::Error(
"erf.use_wrf_bdy_qc_qi found an invalid active moisture component index");
1292 for (
int lev = 0; lev <= max_level; ++lev) {
1303 int n_impfac =
pp.countval(
"vert_implicit_fac");
1305 if (n_impfac == 1) {
1307 pp.get(
"vert_implicit_fac", fac_in);
1308 for (
int lev = 0; lev <= max_level; lev++) {
1309 for (
int i=0; i<3; ++i) {
1313 }
else if (n_impfac == 3) {
1314 for (
int lev = 0; lev <= max_level; lev++) {
1320 const bool user_set_imp_thermal =
pp.contains(
"implicit_thermal_diffusion");
1321 const bool user_set_imp_moisture =
pp.contains(
"implicit_moisture_diffusion");
1322 const bool user_set_imp_ke =
pp.contains(
"implicit_ke_diffusion");
1323 const bool user_set_imp_momentum =
pp.contains(
"implicit_momentum_diffusion");
1339 for (
int lev = 0; lev <= max_level; lev++) {
1341 amrex::Print() <<
"implicit_before_substep cannot be false without substepping; setting to true." <<
"\n";
1350 if (!host_owns_scalars &&
1354 amrex::Print() <<
"Ignoring erf.implicit_{thermal,moisture,ke}_diffusion = true; "
1355 <<
"SHOC owns vertical scalar diffusion." <<
"\n";
1358 amrex::Print() <<
"Ignoring erf.implicit_momentum_diffusion = true; "
1359 <<
"SHOC owns vertical momentum diffusion." <<
"\n";
1368 if (!host_owns_scalars && !host_owns_momentum) {
1369 amrex::Print() <<
"Turning off vertical implicit solve for all components since SHOC owns diffusion." <<
"\n";
1371 amrex::Print() <<
"SHOC hands vertical diffusion of"
1372 << (host_owns_scalars ?
" scalars" :
"")
1373 << (host_owns_momentum ?
" momentum" :
"")
1374 <<
" to the host; keeping the vertical implicit solve on (theta = "
1383 bool do_vert_implicit =
true;
1384 pp.queryAdd(
"vert_implicit", do_vert_implicit);
1385 if (!do_vert_implicit) {
1386 for (
int lev = 0; lev <= max_level; lev++) {
1387 amrex::Print() <<
"Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
1400 for (
int lev = 0; lev <= max_level; lev++) {
1403 amrex::Print() <<
"Turning off native vertical implicit solve flag because anelastic at level " << lev
1404 <<
" with RK2 scheme." << std::endl;
1410 amrex::Print() <<
"Forcing implicit factor 1 in first stage of MidPoint to ensure second-order accuracy." << std::endl;
1414 amrex::Print() <<
"Turning off the second-stage vertical implicit solve at level " << lev
1415 <<
" because anelastic with MidPoint solves in the first stage only."
1427 for (
int lev = 0; lev <= max_level; lev++) {
1428 if (do_vert_implicit) {
1429 amrex::Print() <<
"Implicit diffusion is not supported with EB; turning off at level " << lev <<
"\n";
1440 for (
int lev = 0; lev <= max_level; lev++) {
1442 amrex::Error(
"erf.terrain_type = EB cannot be used with erf.les_type = Deardorff "
1443 "or erf.rans_type = kEqn: the EB diffusion path has no TKE sources");
1453 amrex::Print() <<
"Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
1454 for (
int lev = 0; lev <= max_level; lev++) {
1466 if (any_anelastic && any_compress) {
1502 amrex::Error(
"erf.mean_vars_reset_mode must be either 'plotfile' or 'time'");
1506 amrex::Error(
"erf.mean_vars_reset_time must be non-negative when "
1507 "erf.mean_vars_reset_mode = 'time'");
1516 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
1520 amrex::Error(
"ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
1521 "data files is either missing or set to less than zero");
1532 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
1536 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
1540 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_length' or it is specified to be less than zero");
1544 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
1558 amrex::Error(
"ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
1559 " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
1560 " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
1561 " location of the eye in the initial condition");
1567 amrex::ParmParse pp_ens(
"ensemble");
1570 amrex::Abort(
"You are using an ensemble run. There needs to be at least 2 ensemble members. "
1571 "erf.n_ensemble must be >=2.");
1575 amrex::Abort(
"coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
1576 "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
1577 "which contains the filename in the inputs.");
1581 amrex::Error(
"You are using initialization for ensemble simulations using the inputs option "
1582 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1583 "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
1584 "to be added to the background state and has to be greater than 0.0");
1588 amrex::Error(
"You are using initialization with spatially correlated perturbations using the inputs option "
1589 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
1590 "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
1591 "and has to be greater than 0.0");
1602 void check_params (
int max_level,
const amrex::Vector<amrex::Geometry>& geom_vect, amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type)
1606 for (
int lev = 0; lev <= max_level; lev++) {
1608 amrex::Warning(
"\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
1615 for (
int lev = 0; lev <= max_level; lev++) {
1617 amrex::Error(
"buoyancy_type must be 1, 2, 3 or 4");
1622 amrex::Error(
"Can't turn off lagged_delta_rt when terrain not moving");
1629 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
1630 " erf.sampling_distance_by_D in the inputs which specifies the upstream"
1631 " distance as a factor of the turbine diameter at which the incoming free stream"
1632 " velocity will be computed at.");
1636 amrex::Error(
"To use simplified actuator disks, you need to provide a variable"
1637 " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
1638 " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
1639 " will have turb_disk_angle value of 90 deg.");
1642 amrex::Error(
"You are using windfarms with latitude-logitude option to position the turbines."
1643 " For this you should provide the inputs erf.windfarm_x_shift and"
1644 " erf.windfarm_y_shift which are the values by which the bounding box of the"
1645 " windfarm is shifted from the x and the y axes.");
1650 amrex::Error(
"Constant mass flux (in x) should be used with periodic boundaries");
1654 amrex::Error(
"Constant mass flux (in y) should be used with periodic boundaries");
1658 for (
int lev = 0; lev <= max_level; lev++) {
1659 if ((geom_vect[lev].CellSize(0) >
amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) >
amrex::Real(2000.)))
1662 amrex::Warning(
"Should use 2-D Smagorinsky for mesoscale resolution");
1663 }
else if (
turbChoice[lev].les_type == LESType::Deardorff) {
1664 amrex::Warning(
"Should not use Deardorff LES for mesoscale resolution");
1671 for (
int lev = 1; lev <= max_level; lev++) {
1672 l_use_kturb = (l_use_kturb ||
turbChoice[lev].use_kturb);
1676 for (
int lev = 0; lev <= max_level; lev++) {
1680 if (l_implicit_diff && !l_use_diff) {
1681 amrex:: Print() <<
"No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
1689 for (
int lev = 0; lev <= max_level; lev++) {
1690 if (
turbChoice[lev].enable_mrf_countergradient) {
1695 "enable_mrf_countergradient requires vert_implicit_fac > 0");
1698 "enable_mrf_countergradient requires implicit_thermal_diffusion = true");
1702 "enable_mrf_countergradient with moisture requires implicit_moisture_diffusion = true");
1707 for (
int lev = 0; lev <= max_level; lev++) {
1717 void display (
int max_level, std::string pp_prefix)
1719 amrex::Print() <<
"SOLVER CHOICE: " << std::endl;
1720 for (
int lev = 0; lev <= max_level; lev++) {
1721 amrex::Print() <<
"At level " << lev <<
" : " << std::endl;
1723 amrex::Print() <<
" anelastic with no substepping, using the "
1724 << ((
anelastic_type[lev] == AnelasticType::MidPoint) ?
"MidPoint" :
"RK2")
1725 <<
" integrator" << std::endl;
1728 amrex::Print() <<
" compressible with no substepping" << std::endl;
1730 amrex::Print() <<
" compressible with implicit substepping" << std::endl;
1734 amrex::Print() <<
" and fixed density" << std::endl;
1738 for (
int lev = 0; lev <= max_level; lev++) {
1739 amrex::Print() <<
"vert_implicit_fac at level " << lev <<
" : "
1751 #ifdef ERF_IMPLICIT_W
1752 amrex::Print() <<
", including w";
1754 amrex::Print() <<
")";
1757 amrex::Print() << std::endl;
1758 amrex::Print() <<
"use_coriolis : " <<
use_coriolis << std::endl;
1759 amrex::Print() <<
"use_gravity : " <<
use_gravity << std::endl;
1762 amrex::Print() <<
"Moisture Model: SAM" << std::endl;
1764 amrex::Print() <<
"Moisture Model: SAM No Ice" << std::endl;
1765 }
else if (
moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
1766 amrex::Print() <<
"Moisture Model: SAM No Precip No Ice" << std::endl;
1768 amrex::Print() <<
"Moisture Model: Morrison" << std::endl;
1770 amrex::Print() <<
"Moisture Model: Morrison_NoIce" << std::endl;
1772 amrex::Print() <<
"Moisture Model: WSM6" << std::endl;
1774 amrex::Print() <<
"Moisture Model: WDM6" << std::endl;
1776 amrex::Print() <<
"Moisture Model: Kessler" << std::endl;
1778 amrex::Print() <<
"Moisture Model: Kessler No Rain" << std::endl;
1780 amrex::Print() <<
"Moisture Model: Saturation Adjustment" << std::endl;
1782 amrex::Print() <<
"Moisture Model: SuperDroplets" << std::endl;
1783 }
else if (
moisture_type == MoistureType::MoistNoCondensation) {
1784 amrex::Print() <<
"Moisture Model: MoistNoCondensation" << std::endl;
1786 amrex::Print() <<
"Moisture Model: None" << std::endl;
1790 amrex::Print() <<
"Terrain Type: StaticFittedMesh" << std::endl;
1791 }
else if (
terrain_type == TerrainType::MovingFittedMesh) {
1792 amrex::Print() <<
"Terrain Type: MovingFittedMesh" << std::endl;
1794 amrex::Print() <<
"Terrain Type: EB" << std::endl;
1796 }
else if (
terrain_type == TerrainType::ImmersedForcing) {
1797 amrex::Print() <<
"Terrain Type: ImmersedForcing" << std::endl;
1799 amrex::Print() <<
"Terrain Type: None" << std::endl;
1803 amrex::Print() <<
"Buildings Type: ImmersedForcing" << std::endl;
1805 amrex::Print() <<
"Buildings Type: None" << std::endl;
1808 if (
mesh_type == MeshType::ConstantDz) {
1809 amrex::Print() <<
" Mesh Type: ConstantDz" << std::endl;
1810 }
else if (
mesh_type == MeshType::StretchedDz) {
1811 amrex::Print() <<
" Mesh Type: StretchedDz" << std::endl;
1812 }
else if (
mesh_type == MeshType::VariableDz) {
1813 amrex::Print() <<
" Mesh Type: VariableDz" << std::endl;
1815 amrex::Error(
"No mesh_type set!");
1818 amrex::Print() <<
"ABL Driver Type: " << std::endl;
1820 amrex::Print() <<
" None" << std::endl;
1822 amrex::Print() <<
" Pressure Gradient "
1826 amrex::Print() <<
" Geostrophic Wind "
1831 if (max_level > 0) {
1832 amrex::Print() <<
"Coupling Type: " << std::endl;
1834 amrex::Print() <<
" Two-way" << std::endl;
1836 amrex::Print() <<
" One-way" << std::endl;
1840 if (
rad_type == RadiationType::RRTMGP) {
1841 amrex::Print() <<
"Radiation Model: RRTMGP" << std::endl;
1842 }
else if (
rad_type == RadiationType::Simple) {
1843 amrex::Print() <<
"Radiation Model: Simple" << std::endl;
1844 }
else if (
rad_type == RadiationType::TwoStream) {
1845 amrex::Print() <<
"Radiation Model: TwoStream" << std::endl;
1847 amrex::Print() <<
"Radiation Model: None" << std::endl;
1850 amrex::Print() <<
"Gradp_type : " <<
gradp_type << std::endl;
1852 for (
int lev = 0; lev <= max_level; lev++) {
1853 amrex::Print() <<
"Buoyancy_type at level " << lev <<
" : " <<
buoyancy_type[lev] << std::endl;
1861 for (
int lev = 0; lev <= max_level; lev++) {
1872 amrex::ParmParse
pp(pp_prefix);
1875 double rot_time_period = 86400.0;
1876 pp.queryAdd(
"rotational_time_period", rot_time_period);
1884 pp.queryAdd(
"latitude", latitude_for_coriolis);
1886 sinphi = std::sin(latitude_for_coriolis);
1890 cosphi = std::cos(latitude_for_coriolis);
1898 amrex::Vector<amrex::Real> abl_geo_wind(3);
1899 pp.queryarr(
"abl_geo_wind",abl_geo_wind);
1908 amrex::Print() <<
"NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
1921 amrex::Vector<int>& vec_to_fill,
int default_int)
1923 amrex::ParmParse
pp(
"erf");
1924 int nvals =
pp.countval(string_to_read);
1926 amrex::Vector<int> temp; temp.resize(nvals);
1927 pp.queryarr(string_to_read,temp);
1929 if (vec_to_fill.size() < max_level+1) {
1930 vec_to_fill.resize(max_level+1);
1934 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
1935 }
else if (nvals == 1) {
1936 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
1938 for (
int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
2010 #ifdef AMREX_USE_FLOAT
2135 return pert_type[lev] == PerturbationType::Source ||
2136 pert_type[lev] == PerturbationType::Direct ||
2137 pert_type[lev] == PerturbationType::CPM ||
2138 pert_type[lev] == PerturbationType::CPM_W;
2148 return pert_type[lev] == PerturbationType::Direct ||
2149 pert_type[lev] == PerturbationType::CPM ||
2150 pert_type[lev] == PerturbationType::CPM_W;
2160 return pert_type[lev] == PerturbationType::Source;
2170 return pert_type[lev] == PerturbationType::CPM_W;
2220 if (type == PerturbationType::Source ||
2221 type == PerturbationType::Direct ||
2222 type == PerturbationType::CPM) {
2246 return (
rad_type == RadiationType::RRTMGP) || (
rad_type == RadiationType::Simple);
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:36
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:17
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:56
constexpr amrex::Real R_d
Definition: ERF_Constants.H:34
static const std::string BoundaryFaceName[]
Definition: ERF_DataStruct.H:190
TauType
Stress tensor component indices.
Definition: ERF_DataStruct.H:39
@ tau12
Definition: ERF_DataStruct.H:40
@ tau23
Definition: ERF_DataStruct.H:40
@ tau33
Definition: ERF_DataStruct.H:40
@ tau22
Definition: ERF_DataStruct.H:40
@ tau11
Definition: ERF_DataStruct.H:40
@ tau32
Definition: ERF_DataStruct.H:40
@ tau31
Definition: ERF_DataStruct.H:40
@ tau21
Definition: ERF_DataStruct.H:40
@ tau13
Definition: ERF_DataStruct.H:40
bool anelastic_superdroplets_configuration_invalid(const MoistureType moisture_type, const bool any_anelastic) noexcept
Whether an anelastic SuperDroplets configuration is unsupported.
Definition: ERF_DataStruct.H:132
AMREX_ENUM(InitType, None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, ConstantDensity, ConstantDensityLinearTheta, Isentropic, MoistBaseState, HindCast)
Initial-condition source used to populate the ERF state.
Rayleigh
Rayleigh damping profile component indices.
Definition: ERF_DataStruct.H:178
@ ubar
Definition: ERF_DataStruct.H:179
@ wbar
Definition: ERF_DataStruct.H:179
@ nvars
Definition: ERF_DataStruct.H:179
@ vbar
Definition: ERF_DataStruct.H:179
@ thetabar
Definition: ERF_DataStruct.H:179
Sponge
Sponge reference-state component indices.
Definition: ERF_DataStruct.H:186
@ nvars_sponge
Definition: ERF_DataStruct.H:187
@ vbar_sponge
Definition: ERF_DataStruct.H:187
@ ubar_sponge
Definition: ERF_DataStruct.H:187
MapFacType
Indices for map scale factors on mass and face grids.
Definition: ERF_DataStruct.H:27
@ v_x
Definition: ERF_DataStruct.H:29
@ num
Definition: ERF_DataStruct.H:29
@ u_y
Definition: ERF_DataStruct.H:30
@ v_y
Definition: ERF_DataStruct.H:30
@ m_y
Definition: ERF_DataStruct.H:30
@ u_x
Definition: ERF_DataStruct.H:29
@ m_x
Definition: ERF_DataStruct.H:29
Coord
Coordinate-axis selector.
Definition: ERF_DataStruct.H:170
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:48
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:46
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:47
#define RhoQ11_comp
Definition: ERF_IndexDefines.H:55
#define RhoQ9_comp
Definition: ERF_IndexDefines.H:53
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:50
#define RhoQ8_comp
Definition: ERF_IndexDefines.H:52
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:49
#define RhoQ7_comp
Definition: ERF_IndexDefines.H:51
#define RhoQ10_comp
Definition: ERF_IndexDefines.H:54
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:31
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:30
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:29
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:39
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:101
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_SatAdj.H:47
Definition: ERF_SimpleAD.H:8
Definition: ERF_WDM6.H:108
Definition: ERF_WSM6.H:121
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:463
int comp[max_size]
Definition: ERF_DataStruct.H:465
int size
Definition: ERF_DataStruct.H:466
bool empty() const
Definition: ERF_DataStruct.H:472
void append(int c)
Append a component, ignoring the ones the scheme does not carry.
Definition: ERF_DataStruct.H:469
static constexpr int max_size
qv, qc, qi, qr, qs, qg
Definition: ERF_DataStruct.H:464
Whether this map decides a variable's availability, and if so whether the variable is available.
Definition: ERF_DataStruct.H:591
bool available
the active scheme carries the data behind it
Definition: ERF_DataStruct.H:593
bool governed
the name is a moisture output variable
Definition: ERF_DataStruct.H:592
The moisture data carried by the active microphysics scheme.
Definition: ERF_DataStruct.H:223
int nc
cloud liquid water number
Definition: ERF_DataStruct.H:244
int qs
snow
Definition: ERF_DataStruct.H:238
int cond_rate
condensation rate
Definition: ERF_DataStruct.H:267
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:553
int nn
CCN / total aerosol number.
Definition: ERF_DataStruct.H:254
int qr
rain
Definition: ERF_DataStruct.H:237
static constexpr int absent
not carried by the active scheme
Definition: ERF_DataStruct.H:226
int graup_accum
accumulated surface graupel
Definition: ERF_DataStruct.H:265
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:515
MoistureComponentIndices()=default
Construct an empty map, i.e. a dry run.
int qi
cloud ice
Definition: ERF_DataStruct.H:236
int rel_hum
relative humidity
Definition: ERF_DataStruct.H:266
static constexpr int computed_from_state
Definition: ERF_DataStruct.H:227
int ni
cloud ice number
Definition: ERF_DataStruct.H:245
int qv
water vapor
Definition: ERF_DataStruct.H:234
int rain_accum
accumulated surface rain
Definition: ERF_DataStruct.H:263
CompList nonprecipitating_comps() const
Components summed for non-precipitating water, "qn": vapor plus the suspended condensate....
Definition: ERF_DataStruct.H:491
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:531
int snow_accum
accumulated surface snow
Definition: ERF_DataStruct.H:264
CompList total_water_comps() const
Components summed for total water, "qt": every mass mixing ratio.
Definition: ERF_DataStruct.H:480
int nr
rain number
Definition: ERF_DataStruct.H:246
int qc
cloud liquid water
Definition: ERF_DataStruct.H:235
int ng
graupel number
Definition: ERF_DataStruct.H:248
CompList precipitating_comps() const
Components summed for precipitating water, "qp": the falling species.
Definition: ERF_DataStruct.H:500
int qg
graupel
Definition: ERF_DataStruct.H:239
bool has_moisture() const
Test whether the active scheme carries any moisture at all.
Definition: ERF_DataStruct.H:541
int ns
snow number
Definition: ERF_DataStruct.H:247
VarAvailability query_var(const std::string &name) const
Classify an output variable name against this index map.
Definition: ERF_DataStruct.H:607
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:652
static MoistureComponentIndices from_moisture_model(const MoistureType moisture_type)
Build the complete index map – conserved-state components and qmoist diagnostic slots – for a moistur...
Definition: ERF_DataStruct.H:323
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:289
int qmoist_index_for_var(const std::string &name) const
The qmoist slot behind a moist diagnostic output name.
Definition: ERF_DataStruct.H:578
Container holding radiation-related choices and parameters.
Definition: ERF_RadStruct.H:70
void init_params(bool two_stream_selected, int max_level, std::string pp_prefix)
Definition: ERF_RadStruct.H:727
Definition: ERF_DataStruct.H:662
bool use_coupled_sst
Definition: ERF_DataStruct.H:2250
bool custom_geostrophic_profile
Whether a custom geostrophic wind profile is used.
Definition: ERF_DataStruct.H:2080
int n_ensemble
Number of ensemble members.
Definition: ERF_DataStruct.H:2324
WindFarmLocType windfarm_loc_type
Coordinate system for wind-farm turbine locations.
Definition: ERF_DataStruct.H:2239
bool implicit_before_substep
Whether implicit diffusion is applied before acoustic substepping.
Definition: ERF_DataStruct.H:2006
amrex::Real const_massflux_v
Target constant mass flux in the y direction.
Definition: ERF_DataStruct.H:2305
std::string hindcast_boundary_data_dir
Directory containing hindcast lateral boundary data.
Definition: ERF_DataStruct.H:2312
amrex::Real ens_pert_correlated_radius
Spatial correlation radius for ensemble perturbations.
Definition: ERF_DataStruct.H:2325
amrex::Real forest_leaf_theta_fixed
Definition: ERF_DataStruct.H:2301
static InitType init_type
Initial-condition source selected for the run.
Definition: ERF_DataStruct.H:1943
amrex::Real coriolis_factor
Twice the planetary rotation rate used for Coriolis forcing.
Definition: ERF_DataStruct.H:2070
bool io_hurricane_eye_tracker
Whether hurricane-eye tracking output is enabled.
Definition: ERF_DataStruct.H:2320
std::string abl_geo_wind_table
Path to a time-varying geostrophic wind table.
Definition: ERF_DataStruct.H:2255
amrex::Vector< int > fixed_density
Per-level flag selecting fixed-density treatment.
Definition: ERF_DataStruct.H:1983
amrex::Vector< TurbChoice > turbChoice
Turbulence options for each AMR level.
Definition: ERF_DataStruct.H:1974
amrex::Real const_massflux_layer_lo
Lower height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2307
amrex::Real hindcast_zhi_sponge_length
Length of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2317
amrex::Real gravity
Effective gravitational acceleration.
Definition: ERF_DataStruct.H:2060
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:1602
bool pbl_suppresses_microphysics_condensation() const noexcept
Query whether the active PBL scheme suppresses microphysics condensation.
Definition: ERF_DataStruct.H:2208
bool variable_coriolis
Whether spatially varying Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2258
bool implicit_moisture_diffusion
Whether implicit vertical moisture diffusion is included.
Definition: ERF_DataStruct.H:2003
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:2237
void display(int max_level, std::string pp_prefix)
Print the configured solver, physics, and transport options.
Definition: ERF_DataStruct.H:1717
amrex::Real poisson_abstol
Absolute tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2014
amrex::Real if_Cd_momentum
Immersed-forcing drag coefficient for momentum.
Definition: ERF_DataStruct.H:2036
bool nudging_t
Definition: ERF_DataStruct.H:2097
amrex::Real if_Olen_in
Input Obukhov length for immersed-forcing MOST [m].
Definition: ERF_DataStruct.H:2046
amrex::Vector< int > buoyancy_type
Per-level buoyancy formulation selector.
Definition: ERF_DataStruct.H:1985
bool forest_biophysics
Definition: ERF_DataStruct.H:2299
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Build constant-latitude Coriolis forcing parameters.
Definition: ERF_DataStruct.H:1870
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:2236
bool use_pert_pres_gradient
Whether momentum equations use perturbational pressure gradients.
Definition: ERF_DataStruct.H:2022
amrex::Vector< int > project_initial_velocity
Per-level flag for projecting the initial velocity.
Definition: ERF_DataStruct.H:1984
int ave_plane
Averaging plane index used by diagnostics.
Definition: ERF_DataStruct.H:2260
amrex::Real const_massflux_u
Target constant mass flux in the x direction.
Definition: ERF_DataStruct.H:2304
void read_int_string(int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
Read one integer value or one value per AMR level.
Definition: ERF_DataStruct.H:1920
bool nudging_q
Definition: ERF_DataStruct.H:2098
int ncorr
Number of projection correction iterations.
Definition: ERF_DataStruct.H:2008
amrex::Real sampling_distance_by_D
Turbine inflow sampling distance normalized by rotor diameter.
Definition: ERF_DataStruct.H:2269
amrex::Real windfarm_y_shift
Wind-farm y-coordinate shift.
Definition: ERF_DataStruct.H:2272
bool use_rotate_surface_flux
Whether MOST surface fluxes are rotated with terrain.
Definition: ERF_DataStruct.H:2105
bool moisture_tight_coupling
Whether moisture updates use tight coupling.
Definition: ERF_DataStruct.H:2265
EBChoice ebChoice
Embedded-boundary options.
Definition: ERF_DataStruct.H:1975
bool compute_mean_vars
Definition: ERF_DataStruct.H:2122
amrex::Real beta_s
Time off-centering coefficient for forward weighting.
Definition: ERF_DataStruct.H:1993
bool implicit_ke_diffusion
Whether implicit vertical TKE diffusion is included.
Definition: ERF_DataStruct.H:2004
bool interp_atmos_from_coarse
Definition: ERF_DataStruct.H:2293
bool any_perturbation() const
Query whether any level uses a turbulent perturbation mode.
Definition: ERF_DataStruct.H:2217
amrex::Real if_z0
Immersed-forcing roughness length [m].
Definition: ERF_DataStruct.H:2042
bool forest_substep
Whether canopy source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2033
bool use_wrf_bdy_density
Definition: ERF_DataStruct.H:2278
bool implicit_thermal_diffusion
Whether implicit vertical thermal diffusion is included.
Definition: ERF_DataStruct.H:2002
std::string mean_vars_reset_mode
Definition: ERF_DataStruct.H:2125
bool use_gravity
Whether gravitational forcing is enabled.
Definition: ERF_DataStruct.H:2025
amrex::Real num_diff_coeff
Numerical diffusion coefficient after input scaling.
Definition: ERF_DataStruct.H:2234
amrex::Real bdy_nudge_factor
Boundary sponge nudging factor.
Definition: ERF_DataStruct.H:2275
amrex::Real rdOcp
Ratio of dry-air gas constant to c_p.
Definition: ERF_DataStruct.H:2062
bool use_wvel_perturbation(int lev) const
Query whether vertical-velocity CPM perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2168
bool hindcast_lateral_forcing
Whether hindcast lateral forcing is enabled.
Definition: ERF_DataStruct.H:2314
bool do_theta_advection
Whether custom vertical subsidence is applied to rho-theta.
Definition: ERF_DataStruct.H:2078
bool use_native_shoc
Whether any level uses the native SHOC PBL scheme.
Definition: ERF_DataStruct.H:2109
amrex::Real nudging_q_z2
Definition: ERF_DataStruct.H:2094
static bool use_real_bcs
Whether real-data lateral boundary conditions are used.
Definition: ERF_DataStruct.H:1955
bool spatial_moisture_forcing
Whether spatially varying moisture forcing is enabled.
Definition: ERF_DataStruct.H:2083
amrex::Vector< SubsteppingType > substepping_type
Acoustic substepping type for each AMR level.
Definition: ERF_DataStruct.H:1980
amrex::Real nudging_u_z2
Definition: ERF_DataStruct.H:2090
bool use_perturbation(int lev) const
Query whether any turbulent perturbation mode is enabled on a level.
Definition: ERF_DataStruct.H:2133
static SoundingType sounding_type
Interpretation used for input sounding profiles.
Definition: ERF_DataStruct.H:1946
int bdy_moist_nudge_type
Moist-variable nudging strategy in boundary regions.
Definition: ERF_DataStruct.H:2287
amrex::Real poisson_reltol
Relative tolerance for the Poisson solve.
Definition: ERF_DataStruct.H:2015
bool use_coriolis
Whether Coriolis forcing is enabled.
Definition: ERF_DataStruct.H:2026
amrex::Vector< PerturbationType > pert_type
Turbulent perturbation type for each AMR level.
Definition: ERF_DataStruct.H:2230
static MeshType mesh_type
Vertical mesh representation.
Definition: ERF_DataStruct.H:1958
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:1970
SpongeChoice spongeChoice
Sponge-layer options.
Definition: ERF_DataStruct.H:1973
void init_params(int max_level, std::string pp_prefix)
Read solver-wide algorithmic options from the input parameter database.
Definition: ERF_DataStruct.H:669
bool time_avg_vel
Whether time-averaged velocity fields are output.
Definition: ERF_DataStruct.H:2119
bool use_direct_perturbation(int lev) const
Query whether direct turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2146
bool have_geo_wind_profile
Whether a geostrophic wind profile has been configured.
Definition: ERF_DataStruct.H:2256
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Applied ABL pressure-gradient forcing vector.
Definition: ERF_DataStruct.H:2253
RadChoice radChoice
Definition: ERF_DataStruct.H:1976
amrex::Vector< int > anelastic
Per-level flag selecting anelastic dynamics.
Definition: ERF_DataStruct.H:1981
bool four_stream_radiation
Whether the four-stream radiation approximation is enabled.
Definition: ERF_DataStruct.H:2029
int gradp_type
Terrain-fitted horizontal pressure-gradient formulation.
Definition: ERF_DataStruct.H:2020
DampingChoice dampingChoice
Damping-related options.
Definition: ERF_DataStruct.H:1972
amrex::Real if_damp_alpha
Immersed-forcing damping coefficient.
Definition: ERF_DataStruct.H:2051
bool rebalance_wrf_input
Whether to rebalance states from wrfinput and wrfbdy data.
Definition: ERF_DataStruct.H:2057
amrex::Real turb_disk_angle
Turbine disk angle from the x axis [deg].
Definition: ERF_DataStruct.H:2270
amrex::Real hindcast_data_interval_in_hrs
Time interval between hindcast data files [hr].
Definition: ERF_DataStruct.H:2313
amrex::Real const_massflux_layer_hi
Upper height of the constant-mass-flux forcing layer.
Definition: ERF_DataStruct.H:2308
std::string wall_dist_type
Definition: ERF_DataStruct.H:2009
bool avg_grid_faces_to_nodes
Definition: ERF_DataStruct.H:2290
std::string windfarm_spec_table_extra
Additional wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2267
amrex::Real if_ws_floor
Wind-speed floor for immersed-forcing MOST [m/s].
Definition: ERF_DataStruct.H:2050
amrex::Real lsf_timescale
Definition: ERF_DataStruct.H:2102
bool is_init_for_ensemble
Whether initialization is for an ensemble simulation.
Definition: ERF_DataStruct.H:2323
bool uses_shoc_family() const noexcept
Query whether any SHOC-family PBL scheme is active.
Definition: ERF_DataStruct.H:2177
bool test_mapfactor
Whether to use test map scale factors.
Definition: ERF_DataStruct.H:2018
amrex::Real nudging_u_z1
Definition: ERF_DataStruct.H:2089
bool if_snap_partial_cells
Definition: ERF_DataStruct.H:2048
std::string coarse_bckgnd_data_file
Coarse background data file used for ensemble initialization.
Definition: ERF_DataStruct.H:2327
bool do_forest_drag
Whether forest canopy drag is enabled.
Definition: ERF_DataStruct.H:2296
amrex::Real dz0
Initial vertical grid spacing for stretched-grid setup.
Definition: ERF_DataStruct.H:2067
amrex::Real windfarm_x_shift
Wind-farm x-coordinate shift.
Definition: ERF_DataStruct.H:2271
bool use_lagged_delta_rt
Whether to use lagged delta terms for moving terrain.
Definition: ERF_DataStruct.H:2054
amrex::Real ens_pert_amplitude
Amplitude of ensemble initialization perturbations.
Definition: ERF_DataStruct.H:2326
std::string windfarm_airfoil_tables
Wind-farm airfoil table paths.
Definition: ERF_DataStruct.H:2268
amrex::Vector< AnelasticType > anelastic_type
Per-level two-stage scheme used by the anelastic integrator.
Definition: ERF_DataStruct.H:1982
amrex::Real bdy_rho_nudge_factor
Definition: ERF_DataStruct.H:2284
amrex::Real nudging_q_z1
Definition: ERF_DataStruct.H:2093
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Per-level, per-stage implicit vertical diffusion factors.
Definition: ERF_DataStruct.H:1999
bool transport_scalar
Whether the passive scalar component is transported.
Definition: ERF_DataStruct.H:2116
bool hindcast_zhi_sponge_damping
Whether upper-boundary hindcast sponge damping is enabled.
Definition: ERF_DataStruct.H:2318
amrex::Real hurricane_eye_longitude
Initial hurricane-eye longitude.
Definition: ERF_DataStruct.H:2321
LandSurfaceType lsm_type
Land-surface model.
Definition: ERF_DataStruct.H:2240
int massflux_khi
Upper vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2310
bool large_scale_forcing
Definition: ERF_DataStruct.H:2100
bool substepping_diag
Whether to emit extra CFL diagnostics for compressible substepping.
Definition: ERF_DataStruct.H:1989
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:1949
amrex::Real mean_vars_reset_time
Definition: ERF_DataStruct.H:2126
std::string windfarm_blade_table
Wind-farm blade table path.
Definition: ERF_DataStruct.H:2268
amrex::Vector< int > is_land
Per-level land/water selector.
Definition: ERF_DataStruct.H:1986
amrex::Real hindcast_lateral_sponge_strength
Strength of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2316
bool forest_biophysics_heat
Definition: ERF_DataStruct.H:2300
ShocTransportMode shoc_transport_mode
Definition: ERF_DataStruct.H:2112
amrex::Real hurricane_eye_latitude
Initial hurricane-eye latitude.
Definition: ERF_DataStruct.H:2321
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:2245
amrex::Real cosphi
Cosine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2071
amrex::Real if_Cd_scalar
Immersed-forcing drag coefficient for scalars.
Definition: ERF_DataStruct.H:2037
static BuildingsType buildings_type
Building representation.
Definition: ERF_DataStruct.H:1952
std::string windfarm_loc_table
Wind-farm location table path.
Definition: ERF_DataStruct.H:2267
std::string hindcast_surface_data_dir
Directory containing hindcast surface boundary data.
Definition: ERF_DataStruct.H:2312
ShocMomentumTransport shoc_momentum_transport
Definition: ERF_DataStruct.H:2113
bool custom_rhotheta_forcing
Whether custom rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2075
amrex::Real zsurf
Nominal surface height for stretched-grid setup.
Definition: ERF_DataStruct.H:2066
amrex::Real if_init_surf_temp
Initial immersed-forcing surface temperature [K].
Definition: ERF_DataStruct.H:2044
amrex::Real nudging_t_z2
Definition: ERF_DataStruct.H:2092
int massflux_klo
Lower vertical index for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2309
std::string lsf_file
Definition: ERF_DataStruct.H:2101
std::string windfarm_spec_table
Wind-farm turbine specification table path.
Definition: ERF_DataStruct.H:2267
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Applied geostrophic-wind forcing vector.
Definition: ERF_DataStruct.H:2254
ABLDriverType abl_driver_type
Atmospheric boundary-layer driver type.
Definition: ERF_DataStruct.H:2252
DiffChoice diffChoice
Diffusion-related options.
Definition: ERF_DataStruct.H:1971
amrex::Real if_surf_temp_flux
Immersed-forcing surface temperature flux [K m/s].
Definition: ERF_DataStruct.H:2043
bool spatial_rhotheta_forcing
Whether spatially varying rho-theta forcing is enabled.
Definition: ERF_DataStruct.H:2082
WindFarmType windfarm_type
Wind-farm model.
Definition: ERF_DataStruct.H:2238
bool use_source_perturbation(int lev) const
Query whether source-term turbulent perturbations are enabled on a level.
Definition: ERF_DataStruct.H:2158
bool custom_w_subsidence
Whether custom vertical subsidence is enabled.
Definition: ERF_DataStruct.H:2077
bool custom_moisture_forcing
Whether custom moisture forcing is enabled.
Definition: ERF_DataStruct.H:2076
amrex::Real if_surf_heating_rate
Immersed-forcing surface heating rate [K/hr].
Definition: ERF_DataStruct.H:2045
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:2263
RadiationType rad_type
Radiation model.
Definition: ERF_DataStruct.H:2241
amrex::Real grid_stretching_ratio
Vertical grid stretching ratio.
Definition: ERF_DataStruct.H:2065
bool hindcast_surface_bcs
Whether hindcast surface boundary conditions are enabled.
Definition: ERF_DataStruct.H:2315
bool host_owns_vertical_scalar_diffusion() const noexcept
Test whether the host owns scalar diffusion.
Definition: ERF_DataStruct.H:2197
bool immersed_forcing_substep
Whether immersed-forcing source terms are applied only during substeps.
Definition: ERF_DataStruct.H:2032
bool if_use_most
Whether immersed-forcing MOST is enabled.
Definition: ERF_DataStruct.H:2047
amrex::Real const_massflux_tau
Relaxation time scale for constant-mass-flux forcing.
Definition: ERF_DataStruct.H:2306
amrex::Real hindcast_lateral_sponge_length
Length of the hindcast lateral sponge layer.
Definition: ERF_DataStruct.H:2316
bool use_eamxx_shoc
Whether any level uses the EAMxx SHOC PBL scheme.
Definition: ERF_DataStruct.H:2108
amrex::Real sinphi
Sine of the latitude used for Coriolis forcing.
Definition: ERF_DataStruct.H:2072
bool host_owns_vertical_momentum_diffusion() const noexcept
Test whether the host owns momentum diffusion.
Definition: ERF_DataStruct.H:2186
amrex::Real hindcast_zhi_sponge_strength
Strength of the upper hindcast sponge layer.
Definition: ERF_DataStruct.H:2317
bool coriolis_3d
Whether the three-dimensional Coriolis terms are included.
Definition: ERF_DataStruct.H:2027
int force_stage1_single_substep
Flag forcing a single substep in the first RK stage.
Definition: ERF_DataStruct.H:1978
amrex::Real c_p
Specific heat at constant pressure for dry air [J/(kg-K)].
Definition: ERF_DataStruct.H:2061
bool if_implicit_drag
Definition: ERF_DataStruct.H:2040
bool implicit_momentum_diffusion
Whether implicit vertical momentum diffusion is included.
Definition: ERF_DataStruct.H:2005
bool do_mom_advection
Whether custom vertical subsidence is applied to momentum.
Definition: ERF_DataStruct.H:2079
bool if_stability_correction
Whether immersed-forcing stability corrections are enabled.
Definition: ERF_DataStruct.H:2049
amrex::Real nudging_t_z1
Definition: ERF_DataStruct.H:2091
bool custom_forcing_prim_vars
Whether custom forcing operates on primitive variables.
Definition: ERF_DataStruct.H:2081
bool nudging_u
Definition: ERF_DataStruct.H:2096
bool nudging_from_input_sounding
Whether solution fields are nudged toward input sounding data.
Definition: ERF_DataStruct.H:2087
static void set_mesh_type(MeshType new_mesh_type)
Override the globally selected mesh type.
Definition: ERF_DataStruct.H:1965
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:2233
bool use_wrf_bdy_qc_qi
Whether WRF cloud water and active cloud ice are ingested at real boundaries.
Definition: ERF_DataStruct.H:2281
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