145 amrex::ParmParse
pp(pp_prefix);
148 if (
pp.query(
"use_terrain",bogus_bool) > 0) {
149 amrex::Error(
"The input use_terrain is deprecated. Set terrain_type instead.");
152 if (
pp.query(
"use_moist_background",bogus_bool) > 0) {
153 amrex::Error(
"The input use_moist_background is deprecated. Set init_type = MoistBaseState instead.");
172 amrex::Error(
"The input moisture_type is deprecated. Set moisture_model instead.");
200 }
else if ( (
moisture_type == MoistureType::Morrison_NoIce) ||
208 }
else if ( (
moisture_type == MoistureType::SAM_NoPrecip_NoIce) ||
234 for (
int i = 0; i <= max_level; ++i) {
249 for (
int i = 0; i <= max_level; ++i) {
263 pp.query_enum_case_insensitive(
"land_surface_model",
lsm_type);
266 for (
int lev = 0; lev <= max_level; ++lev) {
268 amrex::Print() <<
"Level " << lev <<
" is land" << std::endl;
269 }
else if (
is_land[lev] == 0) {
270 amrex::Print() <<
"Level " << lev <<
" is water" << std::endl;
272 amrex::Error(
"is_land should be 0 or 1");
278 pp.query_enum_case_insensitive(
"radiation_model",
rad_type);
281 #ifndef ERF_USE_RRTMGP
282 if (
rad_type == RadiationType::RRTMGP)
284 amrex::Error(
"ERF was not compiled with RRTMGP enabled!");
289 std::string terrain_type_temp =
"";
290 pp.query(
"terrain_type", terrain_type_temp);
291 if (terrain_type_temp ==
"Moving") {
292 amrex::Warning(
"erf.terrain_type = Moving is deprecated; please replace Moving by MovingFittedMesh");
294 }
else if (terrain_type_temp ==
"Static") {
295 amrex::Warning(
"erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
302 std::string buildings_type_temp =
"";
303 pp.query(
"buildings_type", buildings_type_temp);
304 if (buildings_type_temp ==
"ImmersedForcing") {
311 std::string init_type_temp_string;
313 int found =
pp.query(
"init_type",init_type_temp_string);
315 if ( (init_type_temp_string ==
"Real") || (init_type_temp_string ==
"real") ) {
316 amrex::Error(
"erf.init_type = Real is deprecated; please replace Real by WRFInput");
317 }
else if ( (init_type_temp_string ==
"Ideal") || (init_type_temp_string ==
"ideal") ) {
318 amrex::Error(
"erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
320 pp.query_enum_case_insensitive(
"init_type",
init_type);
326 amrex::Error(
"Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
330 if (
init_type == InitType::MoistBaseState) {
332 amrex::Error(
"Makes no sense to have moist base state with no moisture model");
338 amrex::Error(
"Can't have moisture_type = None with init_type = WRFInput");
342 std::string nc_bdy_file_temp_string;
343 bool has_bdy =
pp.query(
"nc_bdy_file", nc_bdy_file_temp_string);
347 pp.query(
"use_real_bcs", use_real_bcs_temp);
353 if (found == 0 ||
init_type == InitType::None) {
354 amrex::Print() <<
"init_type must now be set. The options are " << std::endl;
355 amrex::Print() <<
" Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, " << std::endl;
356 amrex::Print() <<
" ConstantDensity, Isentropic, MoistBaseState, or HindCast " << std::endl;
357 amrex::Error(
"Please add a string for init_type to your inputs file or command line");
361 if (
init_type == InitType::Input_Sounding) {
375 amrex::Abort(
"SAM is not correct with variable dz -- choose another moisture model");
381 "The grid stretching ratio must be greater than 1");
392 amrex::Print() <<
"Nominal zsurface height != 0, may result in unexpected behavior"
395 pp.get(
"initial_dz",
dz0);
398 int n_zlevels =
pp.countval(
"terrain_z_levels");
419 pp.query(
"c_p",
c_p);
430 for (
int i = 0; i <= max_level; ++i) {
444 for (
int i = 0; i <= max_level; i++) {
448 for (
int i = 0; i <= max_level; i++) {
462 int nvals_old =
pp.countval(
"no_substepping");
464 amrex::Error(
"The no_substepping flag is deprecated -- set substepping_type instead");
472 #ifdef AMREX_USE_FLOAT
476 for (
int lev = 0; lev <= max_level; lev++) {
515 amrex::Error(
"Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
520 amrex::Error(
"MOST wall-model with immersed forcing for buildings is not currently supported");
525 amrex::Error(
"Specifying surf_temp_flux with immersed forcing for buildings is not currently supported");
530 amrex::Error(
"Specifying Olen with immersed forcing for buildings is not currently supported");
550 for (
int lev = 0; lev <= max_level; ++lev) {
553 pp,
"perturbation_type",
pert_type[lev], lev, max_level);
556 amrex::Vector<amrex::Real> abl_pressure_grad_in = {
zero,
zero,
zero};
557 pp.queryarr(
"abl_pressure_grad",abl_pressure_grad_in);
558 for(
int i = 0; i < AMREX_SPACEDIM; ++i)
abl_pressure_grad[i] = abl_pressure_grad_in[i];
560 amrex::Vector<amrex::Real> abl_geo_forcing_in = {
zero,
zero,
zero};
561 if(
pp.queryarr(
"abl_geo_forcing",abl_geo_forcing_in)) {
562 amrex::Print() <<
"Specified abl_geo_forcing: (";
563 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
567 amrex::Print() <<
")" << std::endl;
589 "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
596 "Numerical diffusion coefficient must be between 0 & one");
599 amrex::Print() <<
"6th-order numerical diffusion turned on with coefficient = "
611 for (
int lev = 0; lev <= max_level; lev++) {
612 turbChoice[lev].init_params(lev,max_level,pp_prefix);
616 for (
int lev = 0; lev <= max_level; lev++) {
617 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
621 amrex::Print() <<
"YSU PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
624 amrex::Error(
"YSU cannot use ERF coriolis frequency if not using coriolis");
629 for (
int lev = 0; lev <= max_level; lev++) {
630 if (
turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
634 amrex::Print() <<
"MRF PBL using ERF coriolis frequency: " <<
turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
637 amrex::Error(
"MRF cannot use ERF coriolis frequency if not using coriolis");
654 bool do_vert_implicit =
false;
655 if (
pp.query(
"vert_implicit", do_vert_implicit) && do_vert_implicit) {
663 int n_impfac =
pp.countval(
"vert_implicit_fac");
665 if (n_impfac > 0 && do_vert_implicit) {
666 amrex::Print() <<
"Overriding defaults with specified implicit factor(s)" << std::endl;
671 pp.get(
"vert_implicit_fac", fac_in);
673 }
else if (n_impfac == 3) {
692 amrex::Print() <<
"Thermal and momentum diffusion are both turned off -- turning off vertical implicit solve" << std::endl;
709 bool any_anelastic =
false;
710 bool any_compress =
false;
711 for (
int lev = 0; lev <= max_level; lev++) {
715 any_anelastic =
true;
718 if (any_anelastic && any_compress) {
753 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
757 amrex::Error(
"ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
758 "data files is either missing or set to less than zero");
769 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
773 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
777 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
781 amrex::Error(
"ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
795 amrex::Error(
"ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
796 " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
797 " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
798 " location of the eye in the initial condition");
804 amrex::ParmParse pp_ens(
"ensemble");
810 amrex::Abort(
"You are running an ensemble simulation, There needs to be an entry in the inputs "
811 "ensemble.n_ensemble which is the number of ensemble members, and should be greater than 0.");
814 amrex::Abort(
"coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
815 "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
816 "which contains the filename in the inputs.");
819 amrex::Error(
"You are using initialization for ensemble simulations using the inputs option "
820 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
821 "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
822 "to be added to the background state and has to be greater than 0.0");
825 amrex::Error(
"You are using initialization with spatially correlated perturbations using the inputs option "
826 "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
827 "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
828 "and has to be greater than 0.0");
constexpr amrex::Real one
Definition: ERF_Constants.H:7
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:40
constexpr amrex::Real R_d
Definition: ERF_Constants.H:29
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:45
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:43
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:44
#define RhoQ11_comp
Definition: ERF_IndexDefines.H:52
#define RhoQ9_comp
Definition: ERF_IndexDefines.H:50
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:47
#define RhoQ8_comp
Definition: ERF_IndexDefines.H:49
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:46
#define RhoQ7_comp
Definition: ERF_IndexDefines.H:48
#define RhoQ10_comp
Definition: ERF_IndexDefines.H:51
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
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)
Definition: ERF_TurbStruct.H:48
AMREX_ASSERT_WITH_MESSAGE(wbar_cutoff_min > wbar_cutoff_max, "ERROR: wbar_cutoff_min < wbar_cutoff_max")
void init_params(std::string pp_prefix)
Definition: ERF_AdvStruct.H:21
void init_params(std::string pp_prefix)
Definition: ERF_DampingStruct.H:21
void init_params(std::string pp_prefix)
Definition: ERF_DiffStruct.H:21
void init_params(std::string pp_prefix)
Definition: ERF_EBStruct.H:29
Definition: ERF_DataStruct.H:106
bool rebalance_wrf_input
Definition: ERF_DataStruct.H:1217
amrex::Real hurricane_eye_latitude
Definition: ERF_DataStruct.H:1351
bool do_mom_advection
Definition: ERF_DataStruct.H:1239
amrex::Real if_init_surf_temp
Definition: ERF_DataStruct.H:1208
amrex::Real dz0
Definition: ERF_DataStruct.H:1227
amrex::Real const_massflux_layer_lo
Definition: ERF_DataStruct.H:1337
amrex::Real if_surf_temp_flux
Definition: ERF_DataStruct.H:1207
amrex::Real hindcast_lateral_sponge_strength
Definition: ERF_DataStruct.H:1346
amrex::Real poisson_reltol
Definition: ERF_DataStruct.H:1182
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Definition: ERF_DataStruct.H:1054
bool if_use_most
Definition: ERF_DataStruct.H:1211
int n_ensemble
Definition: ERF_DataStruct.H:1354
amrex::Real rdOcp
Definition: ERF_DataStruct.H:1222
bool spatial_moisture_forcing
Definition: ERF_DataStruct.H:1243
void read_int_string(int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
Definition: ERF_DataStruct.H:1096
amrex::Vector< int > project_initial_velocity
Definition: ERF_DataStruct.H:1154
std::string windfarm_spec_table
Definition: ERF_DataStruct.H:1320
amrex::Real hindcast_zhi_sponge_length
Definition: ERF_DataStruct.H:1347
amrex::Real if_z0
Definition: ERF_DataStruct.H:1206
int ncorr
Definition: ERF_DataStruct.H:1176
int force_stage1_single_substep
Definition: ERF_DataStruct.H:1149
bool hindcast_zhi_sponge_damping
Definition: ERF_DataStruct.H:1348
std::string windfarm_spec_table_extra
Definition: ERF_DataStruct.H:1320
LandSurfaceType lsm_type
Definition: ERF_DataStruct.H:1302
amrex::Real c_p
Definition: ERF_DataStruct.H:1221
std::string windfarm_loc_table
Definition: ERF_DataStruct.H:1320
amrex::Real ens_pert_amplitude
Definition: ERF_DataStruct.H:1356
bool do_theta_advection
Definition: ERF_DataStruct.H:1238
amrex::Real gravity
Definition: ERF_DataStruct.H:1220
amrex::Vector< int > is_land
Definition: ERF_DataStruct.H:1156
amrex::Real bdy_nudge_factor
Definition: ERF_DataStruct.H:1328
amrex::Real beta_s
Definition: ERF_DataStruct.H:1163
bool custom_rhotheta_forcing
Definition: ERF_DataStruct.H:1235
amrex::Real hindcast_lateral_sponge_length
Definition: ERF_DataStruct.H:1346
bool use_shoc
Definition: ERF_DataStruct.H:1253
bool hindcast_lateral_forcing
Definition: ERF_DataStruct.H:1344
bool moisture_tight_coupling
Definition: ERF_DataStruct.H:1318
bool custom_w_subsidence
Definition: ERF_DataStruct.H:1237
bool nudging_from_input_sounding
Definition: ERF_DataStruct.H:1247
bool custom_geostrophic_profile
Definition: ERF_DataStruct.H:1240
amrex::Real if_Cd_scalar
Definition: ERF_DataStruct.H:1203
bool immersed_forcing_substep
Definition: ERF_DataStruct.H:1199
amrex::Real grid_stretching_ratio
Definition: ERF_DataStruct.H:1225
bool have_geo_wind_profile
Definition: ERF_DataStruct.H:1309
amrex::Real hurricane_eye_longitude
Definition: ERF_DataStruct.H:1351
std::string hindcast_surface_data_dir
Definition: ERF_DataStruct.H:1342
bool io_hurricane_eye_tracker
Definition: ERF_DataStruct.H:1350
amrex::Real if_Olen_in
Definition: ERF_DataStruct.H:1210
bool use_num_diff
Definition: ERF_DataStruct.H:1295
amrex::Real hindcast_zhi_sponge_strength
Definition: ERF_DataStruct.H:1347
bool test_mapfactor
Definition: ERF_DataStruct.H:1185
static SoundingType sounding_type
Definition: ERF_DataStruct.H:1122
bool four_stream_radiation
Definition: ERF_DataStruct.H:1196
std::string coarse_bckgnd_data_file
Definition: ERF_DataStruct.H:1357
bool custom_moisture_forcing
Definition: ERF_DataStruct.H:1236
amrex::Real num_diff_coeff
Definition: ERF_DataStruct.H:1296
std::string windfarm_blade_table
Definition: ERF_DataStruct.H:1321
amrex::Real zsurf
Definition: ERF_DataStruct.H:1226
amrex::Real if_surf_heating_rate
Definition: ERF_DataStruct.H:1209
bool variable_coriolis
Definition: ERF_DataStruct.H:1311
amrex::Real if_Cd_momentum
Definition: ERF_DataStruct.H:1204
bool use_pert_pres_gradient
Definition: ERF_DataStruct.H:1189
bool custom_forcing_prim_vars
Definition: ERF_DataStruct.H:1241
amrex::Real hindcast_data_interval_in_hrs
Definition: ERF_DataStruct.H:1343
static InitType init_type
Definition: ERF_DataStruct.H:1119
bool substepping_diag
Definition: ERF_DataStruct.H:1159
amrex::Real ens_pert_correlated_radius
Definition: ERF_DataStruct.H:1355
amrex::Real const_massflux_layer_hi
Definition: ERF_DataStruct.H:1338
bool implicit_before_substep
Definition: ERF_DataStruct.H:1174
static bool use_real_bcs
Definition: ERF_DataStruct.H:1131
amrex::Real poisson_abstol
Definition: ERF_DataStruct.H:1181
MoistureComponentIndices moisture_indices
Definition: ERF_DataStruct.H:1316
bool hindcast_surface_bcs
Definition: ERF_DataStruct.H:1345
bool use_rotate_surface_flux
Definition: ERF_DataStruct.H:1250
amrex::Real const_massflux_tau
Definition: ERF_DataStruct.H:1336
bool time_avg_vel
Definition: ERF_DataStruct.H:1259
bool spatial_rhotheta_forcing
Definition: ERF_DataStruct.H:1242
bool forest_substep
Definition: ERF_DataStruct.H:1200
std::string windfarm_airfoil_tables
Definition: ERF_DataStruct.H:1321
bool transport_scalar
Definition: ERF_DataStruct.H:1256
bool is_init_for_ensemble
Definition: ERF_DataStruct.H:1353
int ave_plane
Definition: ERF_DataStruct.H:1313
std::string hindcast_boundary_data_dir
Definition: ERF_DataStruct.H:1342
void init_params(std::string pp_prefix)
Definition: ERF_SpongeStruct.H:21