ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_DataStruct.H
Go to the documentation of this file.
1 #ifndef ERF_DATA_STRUCT_H_
2 #define ERF_DATA_STRUCT_H_
3 
4 #include <string>
5 #include <iostream>
6 
7 #include <AMReX_ParmParse.H>
8 #include <AMReX_Print.H>
9 #include <AMReX_Gpu.H>
10 #include <AMReX_Geometry.H>
11 
12 #include <ERF_Constants.H>
13 #include <ERF_IndexDefines.H>
14 #include <ERF_AdvStruct.H>
15 #include <ERF_DampingStruct.H>
16 #include <ERF_DiffStruct.H>
17 #include <ERF_EBStruct.H>
18 #include <ERF_SpongeStruct.H>
19 #include <ERF_TurbStruct.H>
20 #include <ERF_TurbPertStruct.H>
21 
22 enum MapFacType {
23 // This version assumes isotropic
24  m_x, u_x, v_x, num,
25  m_y = 0, u_y = 1, v_y = 2
26 // This version allows for non-isotropic
27 // m_x, u_x, v_x,
28 // m_y, u_y, v_y, num
29 };
30 
31 enum TauType {
33 };
34 
35 AMREX_ENUM(InitType,
36  None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, ConstantDensity, ConstantDensityLinearTheta,
37  Isentropic, MoistBaseState, HindCast
38 );
39 
40 AMREX_ENUM(SoundingType,
41  ConstantDensity, Ideal, Isentropic, DryIsentropic
42 );
43 
44 AMREX_ENUM(ABLDriverType,
45  None, PressureGradient, GeostrophicWind
46 );
47 
48 AMREX_ENUM(CouplingType,
49  OneWay, TwoWay
50 );
51 
52 AMREX_ENUM(SubsteppingType,
53  None, Implicit
54 );
55 
56 AMREX_ENUM(MeshType,
57  ConstantDz, StretchedDz, VariableDz
58 );
59 
60 AMREX_ENUM(TerrainType,
61  None, StaticFittedMesh, MovingFittedMesh, EB, ImmersedForcing
62 );
63 
64 AMREX_ENUM(BuildingsType,
65  None, ImmersedForcing
66 );
67 
68 AMREX_ENUM(MoistureModelType,
69  Eulerian, Lagrangian, Undefined
70 );
71 
72 AMREX_ENUM(MoistureType,
73  SAM, SAM_NoIce, SAM_NoPrecip_NoIce, Kessler, Kessler_NoRain, SatAdj, Morrison, Morrison_NoIce, WSM6, SuperDroplets, MoistNoCondensation, None
74 );
75 
76 AMREX_ENUM(WindFarmType,
77  Fitch, EWP, SimpleAD, GeneralAD, None
78 );
79 
80 AMREX_ENUM(WindFarmLocType,
81  lat_lon, x_y, None
82 );
83 
84 AMREX_ENUM(LandSurfaceType,
85  SLM, MM5, NOAHMP, OceanSurf, None
86 );
87 
88 AMREX_ENUM(RadiationType,
89  None, RRTMGP
90 );
91 
92 enum struct Coord {
93  x, y, z
94 };
95 
96 // These are used as integers so must be enum not enum struct
97 enum Rayleigh {
99 };
100 
101 // These are used as integers so must be enum not enum struct
102 enum Sponge {
104 };
105 
107  int qv = -1; // Water vapor
108  int qc = -1; // Cloud liquid water
109  int qi = -1; // Cloud ice
110  int qr = -1; // Rain
111  int qs = -1; // Snow
112  int qg = -1; // Graupel
113  int nc = -1; // number concentration for cloud liquid water
114  int ni = -1; // number concentration for cloud ice
115  int nr = -1; // number concentration for rain
116  int ns = -1; // number concentration for snow
117  int ng = -1; // number concentration for graupel
118 
119  // Constructor for easy initialization
120  MoistureComponentIndices (int qv_comp, int qc_comp,
121  int qi_comp=-1,
122  int qr_comp=-1,
123  int qs_comp=-1,
124  int qg_comp=-1,
125  int nc_comp=-1,
126  int ni_comp=-1,
127  int nr_comp=-1,
128  int ns_comp=-1,
129  int ng_comp=-1)
130  : qv(qv_comp), qc(qc_comp), qi(qi_comp), qr(qr_comp), qs(qs_comp), qg(qg_comp),
131  nc(nc_comp), ni(ni_comp), nr(nr_comp), ns(ns_comp), ng(ng_comp) {}
132 
133  // Default constructor
135 };
136 
137 /**
138  * Container holding many of the algorithmic options and parameters
139  */
140 
141 struct SolverChoice {
142  public:
143  void init_params (int max_level, std::string pp_prefix)
144  {
145  amrex::ParmParse pp(pp_prefix);
146 
147  bool bogus_bool;
148  if (pp.query("use_terrain",bogus_bool) > 0) {
149  amrex::Error("The input use_terrain is deprecated. Set terrain_type instead.");
150  }
151 
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.");
154  }
155 
156  // Do we set map scale factors to myhalf instead of 1 for testing?
157  pp.query("test_mapfactor", test_mapfactor);
158 
159  // Which horizontal pressure gradient formulation to use with terrain fitted coords?
160  // 0: dp/dx with dp/dz correction (default)
161  // 1: gradient of vertically interpolated p, see Klemp 2011
162  pp.query("gradp_type", gradp_type);
164 
165  // For the lateral pressure gradient to be used in the momentum equation, should we
166  // take the x- and y-derivatives of the perturbational pressure or the full pressure?
167  pp.query("use_pert_pres_gradient", use_pert_pres_gradient);
168 
169  // What type of moisture model to use?
170  moisture_type = MoistureType::None; // Default
171  if (pp.query("moisture_type",moisture_type) > 0) {
172  amrex::Error("The input moisture_type is deprecated. Set moisture_model instead.");
173  }
174 
175  pp.query_enum_case_insensitive("moisture_model",moisture_type);
176  if (moisture_type == MoistureType::Morrison) {
178  RhoQ1_comp, // water vapor
179  RhoQ2_comp, // cloud water
180  RhoQ3_comp, // cloud ice
181  RhoQ4_comp, // rain
182  RhoQ5_comp, // snow
183  RhoQ6_comp, // graupel
184  RhoQ7_comp, // number concentration of cloud water
185  RhoQ8_comp, // number concentration of cloud ice
186  RhoQ9_comp, // number concentration of rain
187  RhoQ10_comp, // number concentration of snow
188  RhoQ11_comp // number concentration of graupel
189  );
190  } else if ( (moisture_type == MoistureType::WSM6) ||
191  (moisture_type == MoistureType::SAM) ) {
193  RhoQ1_comp, // water vapor
194  RhoQ2_comp, // cloud water
195  RhoQ3_comp, // cloud ice
196  RhoQ4_comp, // rain
197  RhoQ5_comp, // snow
198  RhoQ6_comp // graupel
199  );
200  } else if ( (moisture_type == MoistureType::Morrison_NoIce) ||
201  (moisture_type == MoistureType::SAM_NoIce) ) {
203  RhoQ1_comp, // water vapor
204  RhoQ2_comp, // cloud water
205  -1, // cloud ice
206  RhoQ4_comp // rain
207  );
208  } else if ( (moisture_type == MoistureType::SAM_NoPrecip_NoIce) ||
209  (moisture_type == MoistureType::Kessler_NoRain) ||
210  (moisture_type == MoistureType::SatAdj) ||
211  (moisture_type == MoistureType::MoistNoCondensation) ) {
213  RhoQ1_comp, // water vapor
214  RhoQ2_comp // cloud water
215  );
216  } else if (moisture_type == MoistureType::Kessler) {
218  RhoQ1_comp, // water vapor
219  RhoQ2_comp, // cloud water
220  -1, // cloud ice
221  RhoQ3_comp // rain
222  );
223  } else if (moisture_type == MoistureType::SuperDroplets) {
225  RhoQ1_comp, // water vapor
226  RhoQ2_comp, // cloud water
227  -1, // cloud ice
228  RhoQ3_comp // rain
229  );
230  }
231 
232  // Set a default for dry
233  buoyancy_type.resize(max_level+1);
234  for (int i = 0; i <= max_level; ++i) {
235  buoyancy_type[i] = 1; // uses Rhoprime
236  }
237 
238  // Set a default for moist
239  if (moisture_type != MoistureType::None) {
240  if ( !(moisture_type == MoistureType::Kessler_NoRain ||
241  moisture_type == MoistureType::SAM ||
242  moisture_type == MoistureType::SAM_NoIce ||
243  moisture_type == MoistureType::SAM_NoPrecip_NoIce ||
244  moisture_type == MoistureType::Morrison ||
245  moisture_type == MoistureType::Morrison_NoIce ||
246  moisture_type == MoistureType::WSM6 ||
247  moisture_type == MoistureType::SatAdj) )
248  {
249  for (int i = 0; i <= max_level; ++i) {
250  buoyancy_type[i] = 2; // uses Tprime
251  }
252  }
253 
254  pp.query("moisture_tight_coupling",moisture_tight_coupling);
255  }
256 
257  // Which expression (1,2/3 or 4) to use for buoyancy
258  int default_buoyancy_type = buoyancy_type[0];
259  read_int_string(max_level, "buoyancy_type", buoyancy_type, default_buoyancy_type);
260 
261  // What type of land surface model to use
262  lsm_type = LandSurfaceType::None; // Default
263  pp.query_enum_case_insensitive("land_surface_model",lsm_type);
264 
265  read_int_string(max_level, "is_land", is_land, 1);
266  for (int lev = 0; lev <= max_level; ++lev) {
267  if (is_land[lev] == 1) {
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;
271  } else {
272  amrex::Error("is_land should be 0 or 1");
273  }
274  }
275 
276  // What type of radiation model to use
277  rad_type = RadiationType::None; // Default
278  pp.query_enum_case_insensitive("radiation_model", rad_type);
279 
280  // Verify that radiation model cannot be RRTMGP if ERF was not compiled with RRTMGP
281 #ifndef ERF_USE_RRTMGP
282  if (rad_type == RadiationType::RRTMGP)
283  {
284  amrex::Error("ERF was not compiled with RRTMGP enabled!");
285  }
286 #endif
287 
288  // Is the terrain none, static or moving?
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");
293  terrain_type = TerrainType::MovingFittedMesh;
294  } else if (terrain_type_temp == "Static") {
295  amrex::Warning("erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
296  terrain_type = TerrainType::StaticFittedMesh;
297  } else {
298  pp.query_enum_case_insensitive("terrain_type",terrain_type);
299  }
300 
301  // Get buildings type
302  std::string buildings_type_temp = "";
303  pp.query("buildings_type", buildings_type_temp);
304  if (buildings_type_temp == "ImmersedForcing") {
305  buildings_type = BuildingsType::ImmersedForcing;
306  }
307 
308  //
309  // Read the init_type here to make sure we correctly set the mesh and terrain types
310  //
311  std::string init_type_temp_string;
312 
313  int found = pp.query("init_type",init_type_temp_string);
314 
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");
319  } else {
320  pp.query_enum_case_insensitive("init_type",init_type);
321  use_real_bcs = ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) );
322  }
323 
324  if ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) {
325  if (terrain_type != TerrainType::StaticFittedMesh) {
326  amrex::Error("Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
327  }
328  }
329 
330  if (init_type == InitType::MoistBaseState) {
331  if (moisture_type == MoistureType::None) {
332  amrex::Error("Makes no sense to have moist base state with no moisture model");
333  }
334  }
335 
336  if (init_type == InitType::WRFInput) {
337  if (moisture_type == MoistureType::None) {
338  amrex::Error("Can't have moisture_type = None with init_type = WRFInput");
339  }
340 
341  // NetCDF wrfbdy lateral boundary file
342  std::string nc_bdy_file_temp_string;
343  bool has_bdy = pp.query("nc_bdy_file", nc_bdy_file_temp_string);
344  if (!has_bdy) use_real_bcs = false;
345 
346  bool use_real_bcs_temp = use_real_bcs;
347  pp.query("use_real_bcs", use_real_bcs_temp);
348  if (use_real_bcs && !use_real_bcs_temp) {
349  use_real_bcs = false;
350  }
351  }
352 
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");
358  }
359 
360  // How to interpret input_sounding
361  if (init_type == InitType::Input_Sounding) {
362  pp.query_enum_case_insensitive("sounding_type",sounding_type);
363  }
364 
365  if (terrain_type == TerrainType::StaticFittedMesh ||
366  terrain_type == TerrainType::MovingFittedMesh) {
367  mesh_type = MeshType::VariableDz;
368  }
369 
370  if ( (moisture_type == MoistureType::SAM ||
371  moisture_type == MoistureType::SAM_NoIce ||
372  moisture_type == MoistureType::SAM_NoPrecip_NoIce ) &&
373  (mesh_type == MeshType::VariableDz) )
374  {
375  amrex::Abort("SAM is not correct with variable dz -- choose another moisture model");
376  }
377 
378  pp.query("grid_stretching_ratio", grid_stretching_ratio);
379  if (grid_stretching_ratio != 0) {
381  "The grid stretching ratio must be greater than 1");
382  }
383  if (grid_stretching_ratio >= 1) {
384  if (terrain_type == TerrainType::None) {
385  terrain_type = TerrainType::StaticFittedMesh;
386  }
387  if (mesh_type == MeshType::ConstantDz) {
388  mesh_type = MeshType::StretchedDz;
389  }
390  pp.query("zsurface", zsurf);
391  if (zsurf != zero) {
392  amrex::Print() << "Nominal zsurface height != 0, may result in unexpected behavior"
393  << std::endl;
394  }
395  pp.get("initial_dz", dz0);
396  }
397 
398  int n_zlevels = pp.countval("terrain_z_levels");
399  if (n_zlevels > 0)
400  {
401  if (terrain_type == TerrainType::None) {
402  terrain_type = TerrainType::StaticFittedMesh;
403  }
404  if (mesh_type == MeshType::ConstantDz) {
405  mesh_type = MeshType::StretchedDz;
406  }
407  }
408 
409  // Use lagged_delta_rt in the fast integrator?
410  pp.query("use_lagged_delta_rt", use_lagged_delta_rt);
411 
412  // Rebalance wrf state?
413  pp.query("rebalance_wrf_input", rebalance_wrf_input);
414 
415  // These default to true but are used for unit testing
416  pp.query("use_gravity", use_gravity);
418 
419  pp.query("c_p", c_p);
420  rdOcp = R_d / c_p;
421 
422  // *******************************************************************************
423  // Read anelastic etc and over-ride if necessary
424  // *******************************************************************************
425 
426  read_int_string(max_level, "anelastic", anelastic, 0);
427  read_int_string(max_level, "fixed_density", fixed_density, 0);
428  read_int_string(max_level, "project_initial_velocity", project_initial_velocity, 0);
429 
430  for (int i = 0; i <= max_level; ++i) {
431  if (anelastic[i] == 1) {
433  fixed_density[i] = 1; // We default to true but are allowed to override below
434  buoyancy_type[i] = 3; // (This isn't actually used when anelastic is set)
435  }
436  }
437 
438 
439  // *******************************************************************************
440  // Read substepping_type and allow for different values at each level
441  // *******************************************************************************
442  substepping_type.resize(max_level+1);
443 
444  for (int i = 0; i <= max_level; i++) {
445  substepping_type[i] = SubsteppingType::Implicit;
446  }
447 
448  for (int i = 0; i <= max_level; i++) {
450  pp, "substepping_type", substepping_type[i], i, max_level);
451  }
452 
453  pp.query("substepping_diag", substepping_diag);
454 
455  pp.query("beta_s", beta_s);
456 
457 
458 
459  // *******************************************************************************
460  // Error check on deprecated input
461  // *******************************************************************************
462  int nvals_old = pp.countval("no_substepping");
463  if (nvals_old > 0) {
464  amrex::Error("The no_substepping flag is deprecated -- set substepping_type instead");
465  }
466 
467  // *******************************************************************************
468 
469  pp.query("ncorr", ncorr);
470  pp.query("poisson_abstol", poisson_abstol);
471  pp.query("poisson_reltol", poisson_reltol);
472 #ifdef AMREX_USE_FLOAT
473  poisson_abstol = amrex::max(poisson_abstol,amrex::Real(1e-6));
474  poisson_reltol = amrex::max(poisson_reltol,amrex::Real(1e-6));
475 #endif
476  for (int lev = 0; lev <= max_level; lev++) {
477  if (anelastic[lev] != 0)
478  {
479  substepping_type[lev] = SubsteppingType::None;
480  }
481  }
482 
483  pp.query("force_stage1_single_substep", force_stage1_single_substep);
484 
485  // Include Coriolis forcing?
486  pp.query("use_coriolis", use_coriolis);
487  pp.query("variable_coriolis", variable_coriolis);
488 
489  // Include four stream radiation approximation
490  pp.query("four_stream_radiation", four_stream_radiation);
491 
492  // flags for whether to apply other source terms in substep only
493  pp.query("immersed_forcing_substep", immersed_forcing_substep); // apply immersed forcing source terms in substep only
494  pp.query("forest_substep", forest_substep); // apply canopy-related source terms in substep only
495 
496  // immersed forcing parameters
497  pp.query("if_Cd_scalar", if_Cd_scalar);
498  pp.query("if_Cd_momentum", if_Cd_momentum);
499  pp.query("if_z0", if_z0);
500  pp.query("if_surf_temp_flux", if_surf_temp_flux);
501  pp.query("if_init_surf_temp", if_init_surf_temp);
502 
503  pp.query("if_surf_heating_rate", if_surf_heating_rate);
504 
505  // Modify rate to be in units of K / s rather than K / hr
506  if_surf_heating_rate /= amrex::Real(3600.0); // [K/s]
507 
508  pp.query("if_Olen", if_Olen_in);
509  pp.query("if_use_most",if_use_most);
510 
511  if ((if_init_surf_temp > zero && if_surf_temp_flux != amrex::Real(1e-8)) ||
512  (if_init_surf_temp > zero && if_Olen_in != amrex::Real(1e-8)) ||
513  (if_Olen_in != amrex::Real(1e-8) && if_surf_temp_flux != amrex::Real(1e-8)))
514  {
515  amrex::Error("Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
516  }
517 
518  if (if_use_most && buildings_type == BuildingsType::ImmersedForcing)
519  {
520  amrex::Error("MOST wall-model with immersed forcing for buildings is not currently supported");
521  }
522 
523  if (if_surf_temp_flux != amrex::Real(1e-8) && buildings_type == BuildingsType::ImmersedForcing)
524  {
525  amrex::Error("Specifying surf_temp_flux with immersed forcing for buildings is not currently supported");
526  }
527 
528  if (if_Olen_in != amrex::Real(1e-8) && buildings_type == BuildingsType::ImmersedForcing)
529  {
530  amrex::Error("Specifying Olen with immersed forcing for buildings is not currently supported");
531  }
532 
533  // Flag to do MOST rotations with terrain
534  pp.query("use_rotate_surface_flux",use_rotate_surface_flux);
536  AMREX_ASSERT_WITH_MESSAGE(terrain_type != TerrainType::None,"MOST stress rotations are only valid with terrain!");
537  }
538 
539  // Which external forcings?
540  abl_driver_type = ABLDriverType::None; // Default: no ABL driver for simulating classical fluid dynamics problems
541  pp.query_enum_case_insensitive("abl_driver_type",abl_driver_type);
542  pp.query("const_massflux_u", const_massflux_u);
543  pp.query("const_massflux_v", const_massflux_v);
544  pp.query("const_massflux_tau", const_massflux_tau);
545  pp.query("const_massflux_layer_lo", const_massflux_layer_lo);
546  pp.query("const_massflux_layer_hi", const_massflux_layer_hi);
547 
548  // Which type of inflow turbulent generation
549  pert_type.resize(max_level+1);
550  for (int lev = 0; lev <= max_level; ++lev) {
551  pert_type[lev] = PerturbationType::None; // Default
553  pp, "perturbation_type", pert_type[lev], lev, max_level);
554  }
555 
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];
559 
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) {
564  abl_geo_forcing[i] = abl_geo_forcing_in[i];
565  amrex::Print() << abl_geo_forcing[i] << " ";
566  }
567  amrex::Print() << ")" << std::endl;
568  }
569 
570  if (use_coriolis)
571  {
573  }
574 
575  pp.query("add_custom_rhotheta_forcing", custom_rhotheta_forcing);
576  pp.query("add_custom_moisture_forcing", custom_moisture_forcing);
577  pp.query("add_custom_w_subsidence", custom_w_subsidence);
578  pp.query("add_do_theta_advection", do_theta_advection); // If true, apply custom subsidence to (rho*theta) when add_custom_w_subsidence is used
579  pp.query("add_do_mom_advection", do_mom_advection); // If true, apply custom subsidence to momentum when add_custom_w_subsidence is used
580  pp.query("add_custom_geostrophic_profile", custom_geostrophic_profile);
581  pp.query("custom_forcing_uses_primitive_vars", custom_forcing_prim_vars);
582  pp.query("spatial_rhotheta_forcing", spatial_rhotheta_forcing);
583  pp.query("spatial_moisture_forcing", spatial_moisture_forcing);
584 
585  pp.query("nudging_from_input_sounding", nudging_from_input_sounding);
586 
588  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(!(!abl_geo_wind_table.empty() && custom_geostrophic_profile),
589  "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
590 
591  pp.query("Ave_Plane", ave_plane);
592 
593  // Use numerical diffusion?
594  pp.query("num_diff_coeff",num_diff_coeff);
596  "Numerical diffusion coefficient must be between 0 & one");
598  if (use_num_diff) {
599  amrex::Print() << "6th-order numerical diffusion turned on with coefficient = "
600  << num_diff_coeff << std::endl;
601  num_diff_coeff *= amrex::Math::powi<-6>(two);
602  }
603 
604  advChoice.init_params(pp_prefix);
605  diffChoice.init_params(pp_prefix);
606  dampingChoice.init_params(pp_prefix);
607  spongeChoice.init_params(pp_prefix);
608  ebChoice.init_params(pp_prefix);
609 
610  turbChoice.resize(max_level+1);
611  for (int lev = 0; lev <= max_level; lev++) {
612  turbChoice[lev].init_params(lev,max_level,pp_prefix);
613  }
614 
615  vert_implicit_fac.resize(max_level+1);
616  for (int lev = 0; lev <= max_level; lev++) {
617  vert_implicit_fac[lev].resize(3);
618  vert_implicit_fac[lev][0] = one;
619  vert_implicit_fac[lev][1] = one;
620  vert_implicit_fac[lev][2] = zero;
621  }
622 
623  // YSU PBL: use consistent coriolis frequency
624  for (int lev = 0; lev <= max_level; lev++) {
625  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
626  if (use_coriolis) {
627  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
628  if (lev == 0) {
629  amrex::Print() << "YSU PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
630  }
631  } else {
632  amrex::Error("YSU cannot use ERF coriolis frequency if not using coriolis");
633  }
634  }
635  }
636  // MRF
637  for (int lev = 0; lev <= max_level; lev++) {
638  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
639  if (use_coriolis) {
640  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
641  if (lev == 0) {
642  amrex::Print() << "MRF PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
643  }
644  } else {
645  amrex::Error("MRF cannot use ERF coriolis frequency if not using coriolis");
646  }
647  }
648  }
649 
650  // What's the strength of the bdy nudging?
651  pp.query("bdy_nudge_factor",bdy_nudge_factor);
652 
653  // Which approach to nudging the moist variables in the boundary region?
654  pp.query("bdy_moist_nudge_type",bdy_moist_nudge_type);
655 
656  // Are me transporting the scalar component?
657  pp.query("transport_scalar",transport_scalar);
658 
659  for (int lev = 0; lev <= max_level; ++lev) {
660  if (turbChoice[lev].uses_eamxx_shoc()) {
661  use_eamxx_shoc = true;
662  }
663  if (turbChoice[lev].uses_native_shoc()) {
664  use_native_shoc = true;
665  }
666  }
667 
668  // Implicit vertical diffusion (not available with SHOC family)
669  if (uses_shoc_family()) {
670  amrex::Print() << "Turning off native vertical implicit solve at all levels with SHOC family PBL scheme." << std::endl;
671  for (int lev = 0; lev <= max_level; lev++) {
672  vert_implicit_fac[lev][0] = zero;
673  vert_implicit_fac[lev][1] = zero;
674  vert_implicit_fac[lev][2] = zero;
675  }
676  } else {
677  // This controls the time-centering of the vertical differences in the diffusive term
678  bool do_vert_implicit = true;
679  pp.query("vert_implicit", do_vert_implicit);
680 
681  if (!do_vert_implicit) {
682  for (int lev = 0; lev <= max_level; lev++) {
683  amrex::Print() << "Turning off native vertical implicit solve from vert_implicit flag at level " << lev << std::endl;
684  vert_implicit_fac[lev][0] = zero;
685  vert_implicit_fac[lev][1] = zero;
686  vert_implicit_fac[lev][2] = zero;
687  }
688  } else {
689 
690  for (int lev = 0; lev <= max_level; lev++) {
691  if (anelastic[lev]) {
692  amrex::Print() << "Turning off native vertical implicit solve flag because anelastic at level " << lev << std::endl;
693  vert_implicit_fac[lev][0] = zero;
694  vert_implicit_fac[lev][1] = zero;
695  vert_implicit_fac[lev][2] = zero;
696  }
697  }
698 
699  // This may be one value for all RK stages or a different value in each stage
700  int n_impfac = pp.countval("vert_implicit_fac");
701  AMREX_ALWAYS_ASSERT(n_impfac == 0 || n_impfac == 1 || n_impfac==3);
702  if (n_impfac > 0 && do_vert_implicit) {
703  amrex::Print() << "Overriding defaults with specified implicit factor(s)" << std::endl;
704  }
705 
706  if (n_impfac == 1) {
707  amrex::Real fac_in;
708  pp.get("vert_implicit_fac", fac_in);
709  for (int lev = 0; lev <= max_level; lev++) {
710  for (int i=0; i<3; ++i) {
711  vert_implicit_fac[lev][i] = fac_in;
712  }
713  }
714  } else if (n_impfac == 3) {
715  for (int lev = 0; lev <= max_level; lev++) {
716  pp.getarr("vert_implicit_fac", vert_implicit_fac[lev]);
717  }
718  }
719 
720  // If true (default), include implicit contributions to vertical
721  // thermal diffusion
722  pp.query("implicit_thermal_diffusion", implicit_thermal_diffusion);
723 
724  // If true (default), include implicit contributions to vertical
725  // moisture diffusion
726  pp.query("implicit_moisture_diffusion", implicit_moisture_diffusion);
727 
728  // If true (default), include implicit contributions to vertical
729  // KE diffusion
730  pp.query("implicit_ke_diffusion", implicit_ke_diffusion);
731 
732  // If true (default), include implicit contributions in tau13, tau23,
733  // (and if ERF_IMPLICIT_W is set, tau33) to correct u, v, (and w).
734  pp.query("implicit_momentum_diffusion", implicit_momentum_diffusion);
735 
736  // This controls when the vertical implicit solve for the diffusive terms will happen relative to
737  // the acoustic substepping (if it happens, i.e. if any of the implicit_fac > zero)
738  // The default is true (i.e. that it happens before the acoustic substepping).
739  pp.query("implicit_before_substep", implicit_before_substep);
740  for (int lev = 0; lev <= max_level; lev++) {
741  if ( (substepping_type[lev] == SubsteppingType::None) && !implicit_before_substep) {
742  amrex::Print() << "implicit_before_substep cannot be false without substepping; setting to true." << "\n";
744  }
745  }
746 
747  // Do not allow implicit vertical diff with EB
748 
749  if (terrain_type == TerrainType::EB) {
750  for (int lev = 0; lev <= max_level; lev++) {
751  if (do_vert_implicit) {
752  amrex::Print() << "Implicit diffusion is not supported with EB; turning off at level " << lev << "\n";
753  vert_implicit_fac[lev][0] = zero;
754  vert_implicit_fac[lev][1] = zero;
755  vert_implicit_fac[lev][2] = zero;
756  }
757  }
758  }
759 
764  amrex::Print() << "Thermal, moisture, KE, and momentum diffusion are all turned off; turning off vertical implicit solve." << std::endl;
765  for (int lev = 0; lev <= max_level; lev++) {
766  vert_implicit_fac[lev][0] = zero;
767  vert_implicit_fac[lev][1] = zero;
768  vert_implicit_fac[lev][2] = zero;
769  }
770  }
771  } // do_vert_implicit
772  } // uses_shoc_family
773 
774  // Which type of multilevel coupling
775  coupling_type = CouplingType::TwoWay; // Default
776  pp.query_enum_case_insensitive("coupling_type",coupling_type);
777 
778  // Test for hybrid (compressible + anelastic) -- in this case we must use one-way coupling
779  bool any_anelastic = false;
780  bool any_compress = false;
781  for (int lev = 0; lev <= max_level; lev++) {
782  if (anelastic[lev] == 0) {
783  any_compress = true;
784  } else {
785  any_anelastic = true;
786  }
787  }
788  if (any_anelastic && any_compress) {
789  coupling_type = CouplingType::OneWay;
790  }
791 
792  // Which type of windfarm model
793  windfarm_type = WindFarmType::None; // Default
794  pp.query_enum_case_insensitive("windfarm_type",windfarm_type);
795 
796  windfarm_loc_type = WindFarmLocType::None;
797  pp.query_enum_case_insensitive("windfarm_loc_type",windfarm_loc_type);
798 
799  pp.query("windfarm_loc_table", windfarm_loc_table);
800  pp.query("windfarm_spec_table", windfarm_spec_table);
801  pp.query("windfarm_blade_table", windfarm_blade_table);
802  pp.query("windfarm_airfoil_tables", windfarm_airfoil_tables);
803  pp.query("windfarm_spec_table_extra", windfarm_spec_table_extra);
804 
805  // Sampling distance upstream of the turbine to find the
806  // incoming free stream velocity as a factor of the diameter of the
807  // turbine. ie. the sampling distance will be this number multiplied
808  // by the diameter of the turbine
809  pp.query("sampling_distance_by_D", sampling_distance_by_D);
810  pp.query("turb_disk_angle_from_x", turb_disk_angle);
811 
812  pp.query("windfarm_x_shift",windfarm_x_shift);
813  pp.query("windfarm_y_shift",windfarm_y_shift);
814  // Test if time averaged data is to be output
815  pp.query("time_avg_vel",time_avg_vel);
816 
817  pp.query("hindcast_lateral_forcing", hindcast_lateral_forcing);
818 
820  pp.query("hindcast_boundary_data_dir", hindcast_boundary_data_dir);
821 
822  if(hindcast_boundary_data_dir.empty()) {
823  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
824  }
825  pp.query("hindcast_data_interval_in_hrs", hindcast_data_interval_in_hrs);
827  amrex::Error("ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
828  "data files is either missing or set to less than zero");
829  }
830  pp.query("hindcast_lateral_sponge_strength", hindcast_lateral_sponge_strength);
831  pp.query("hindcast_lateral_sponge_length", hindcast_lateral_sponge_length);
832 
833  pp.query("hindcast_zhi_sponge_length", hindcast_zhi_sponge_length);
834  pp.query("hindcast_zhi_sponge_strength", hindcast_zhi_sponge_strength);
835 
836  pp.query("hindcast_zhi_sponge_damping", hindcast_zhi_sponge_damping);
837 
839  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
840  }
841 
843  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
844  }
845 
847  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
848  }
849 
851  amrex::Error("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
852  }
853  }
854 
855  pp.query("hindcast_surface_bcs", hindcast_surface_bcs);
857  pp.query("hindcast_surface_data_dir", hindcast_surface_data_dir);
858  }
859 
860  pp.query("io_hurricane_eye_tracker", io_hurricane_eye_tracker);
862  pp.query("hurricane_eye_latitude", hurricane_eye_latitude);
863  pp.query("hurricane_eye_longitude", hurricane_eye_longitude);
865  amrex::Error("ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
866  " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
867  " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
868  " location of the eye in the initial condition");
869  }
870  }
871 
872  pp.query("is_init_for_ensemble", is_init_for_ensemble);
874  amrex::ParmParse pp_ens("ensemble");
875  pp_ens.query("n_members", n_ensemble);
876  pp_ens.query("coarse_bckgnd_data_file", coarse_bckgnd_data_file);
877  pp_ens.query("ens_pert_amplitude", ens_pert_amplitude);
878  pp_ens.query("ens_pert_correlated_radius", ens_pert_correlated_radius);
879  if (n_ensemble < 0) {
880  amrex::Abort("You are running an ensemble simulation, There needs to be an entry in the inputs "
881  "ensemble.n_ensemble which is the number of ensemble members, and should be greater than 0.");
882  }
883  if (coarse_bckgnd_data_file.empty()) {
884  amrex::Abort("coarse_bckgnd_data_file is empty! For ensmeble simulations, there needs to be a coarse background file which "
885  "contains the data which will be interpolated onto the fine mesh. There has to a entry ensemble.coarse_bckgnd_data_file "
886  "which contains the filename in the inputs.");
887  }
888  if(ens_pert_amplitude <= 0.0) {
889  amrex::Error("You are using initialization for ensemble simulations using the inputs option "
890  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
891  "ensemble.ens_pert_amplitude which is the value of the amplitude of the perturbation "
892  "to be added to the background state and has to be greater than 0.0");
893  }
894  if(ens_pert_correlated_radius <= 0.0) {
895  amrex::Error("You are using initialization with spatially correlated perturbations using the inputs option "
896  "ensemble.is_init_for_ensemble=true. In this case, there has to be an option "
897  "ensemble.ens_pert_correlated_radius which is the value of the the spatial correlation radius, "
898  "and has to be greater than 0.0");
899  }
900  }
901  }
902 
903  void check_params (int max_level, const amrex::Vector<amrex::Geometry>& geom_vect, amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type)
904  {
905 #if 0
906  // Warn for PBL models and moisture - these may not yet be compatible
907  for (int lev = 0; lev <= max_level; lev++) {
908  if ((moisture_type != MoistureType::None) && (turbChoice[lev].pbl_type != PBLType::None)) {
909  amrex::Warning("\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
910  }
911  }
912 #endif
913  //
914  // Buoyancy type check
915  //
916  for (int lev = 0; lev <= max_level; lev++) {
917  if (buoyancy_type[lev] != 1 && buoyancy_type[lev] != 2 && buoyancy_type[lev] != 3 && buoyancy_type[lev] != 4) {
918  amrex::Error("buoyancy_type must be 1, 2, 3 or 4");
919  }
920  }
921 
922  if (!use_lagged_delta_rt && !(terrain_type == TerrainType::MovingFittedMesh)) {
923  amrex::Error("Can't turn off lagged_delta_rt when terrain not moving");
924  }
925 
926  //
927  // Wind farm checks
928  //
929  if (windfarm_type==WindFarmType::SimpleAD and sampling_distance_by_D < zero) {
930  amrex::Error("To use simplified actuator disks, you need to provide a variable"
931  " erf.sampling_distance_by_D in the inputs which specifies the upstream"
932  " distance as a factor of the turbine diameter at which the incoming free stream"
933  " velocity will be computed at.");
934  }
935  if ( (windfarm_type==WindFarmType::SimpleAD ||
936  windfarm_type==WindFarmType::GeneralAD ) && turb_disk_angle < zero) {
937  amrex::Error("To use simplified actuator disks, you need to provide a variable"
938  " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
939  " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
940  " will have turb_disk_angle value of 90 deg.");
941  }
942  if (windfarm_loc_type == WindFarmLocType::lat_lon and (windfarm_x_shift < zero or windfarm_y_shift < zero)) {
943  amrex::Error("You are using windfarms with latitude-logitude option to position the turbines."
944  " For this you should provide the inputs erf.windfarm_x_shift and"
945  " erf.windfarm_y_shift which are the values by which the bounding box of the"
946  " windfarm is shifted from the x and the y axes.");
947  }
948 
949 
950  if ( (const_massflux_u != 0) && !(geom_vect[0].isPeriodic(0)) ) {
951  amrex::Error("Constant mass flux (in x) should be used with periodic boundaries");
952  }
953 
954  if ( (const_massflux_v != 0) && !(geom_vect[0].isPeriodic(1)) ) {
955  amrex::Error("Constant mass flux (in y) should be used with periodic boundaries");
956  }
957 
958  // Mesoscale diffusion -- test if LES appropriate with this dx,dy
959  for (int lev = 0; lev <= max_level; lev++) {
960  if ((geom_vect[lev].CellSize(0) > amrex::Real(2000.)) || (geom_vect[lev].CellSize(1) > amrex::Real(2000.)))
961  {
962  if ( (turbChoice[lev].les_type == LESType::Smagorinsky) && !turbChoice[lev].smag2d ) {
963  amrex::Warning("Should use 2-D Smagorinsky for mesoscale resolution");
964  } else if (turbChoice[lev].les_type == LESType::Deardorff) {
965  amrex::Warning("Should not use Deardorff LES for mesoscale resolution");
966  }
967  }
968  }
969 
970  // Turn off implicit solve if we have no diffusion
971  bool l_use_kturb = turbChoice[0].use_kturb;
972  for (int lev = 1; lev <= max_level; lev++) {
973  l_use_kturb = (l_use_kturb || turbChoice[lev].use_kturb);
974  }
975  bool l_use_diff = ( (diffChoice.molec_diff_type != MolecDiffType::None) || l_use_kturb );
976 
977  for (int lev = 0; lev <= max_level; lev++) {
978  bool l_implicit_diff = (vert_implicit_fac[lev][0] > zero ||
979  vert_implicit_fac[lev][1] > zero ||
980  vert_implicit_fac[lev][2] > zero);
981  if (l_implicit_diff && !l_use_diff) {
982  amrex:: Print() << "No molecular or turbulent diffusion, turning off implicit solve at level " << lev << std::endl;
983  vert_implicit_fac[lev][0] = zero;
984  vert_implicit_fac[lev][1] = zero;
985  vert_implicit_fac[lev][2] = zero;
986  }
987  }
988 
989  for (int lev = 0; lev <= max_level; lev++) {
990  turbChoice[lev].check_params(phys_bc_type);
991  }
992  }
993 
994  void display (int max_level, std::string pp_prefix)
995  {
996  amrex::Print() << "SOLVER CHOICE: " << std::endl;
997  for (int lev = 0; lev <= max_level; lev++) {
998  amrex::Print() << "At level " << lev << " : " << std::endl;
999  if (anelastic[lev]) {
1000  amrex::Print() << " anelastic with no substepping" << std::endl;
1001  } else {
1002  if (substepping_type[lev] == SubsteppingType::None) {
1003  amrex::Print() << " compressible with no substepping" << std::endl;
1004  } else if (substepping_type[lev] == SubsteppingType::Implicit) {
1005  amrex::Print() << " compressible with implicit substepping" << std::endl;
1006  }
1007  }
1008  if (fixed_density[lev]) {
1009  amrex::Print() << " and fixed density" << std::endl;
1010  }
1011  }
1012 
1013  for (int lev = 0; lev <= max_level; lev++) {
1014  amrex::Print() << "vert_implicit_fac at level : " << lev << " " << vert_implicit_fac[lev][0] << " "
1015  << vert_implicit_fac[lev][1] << " "
1016  << vert_implicit_fac[lev][2];
1017  if (vert_implicit_fac[lev][0] > zero ||
1018  vert_implicit_fac[lev][1] > zero ||
1019  vert_implicit_fac[lev][2] > zero)
1020  {
1021  amrex::Print() << " (theta = " << implicit_thermal_diffusion
1022  << ", moisture = " << implicit_moisture_diffusion
1023  << ", tke = " << implicit_ke_diffusion
1024  << ", momenta = " << implicit_momentum_diffusion;
1025 #ifdef ERF_IMPLICIT_W
1026  amrex::Print() << ", including w";
1027 #endif
1028  amrex::Print() << ")";
1029  }
1030  }
1031  amrex::Print() << std::endl;
1032  amrex::Print() << "use_coriolis : " << use_coriolis << std::endl;
1033  amrex::Print() << "use_gravity : " << use_gravity << std::endl;
1034 
1035  if (moisture_type == MoistureType::SAM) {
1036  amrex::Print() << "Moisture Model: SAM" << std::endl;
1037  } else if (moisture_type == MoistureType::SAM_NoIce) {
1038  amrex::Print() << "Moisture Model: SAM No Ice" << std::endl;
1039  } else if (moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
1040  amrex::Print() << "Moisture Model: SAM No Precip No Ice" << std::endl;
1041  } else if (moisture_type == MoistureType::Morrison) {
1042  amrex::Print() << "Moisture Model: Morrison" << std::endl;
1043  } else if (moisture_type == MoistureType::Morrison_NoIce) {
1044  amrex::Print() << "Moisture Model: Morrison_NoIce" << std::endl;
1045  } else if (moisture_type == MoistureType::WSM6) {
1046  amrex::Print() << "Moisture Model: WSM6" << std::endl;
1047  } else if (moisture_type == MoistureType::Kessler) {
1048  amrex::Print() << "Moisture Model: Kessler" << std::endl;
1049  } else if (moisture_type == MoistureType::Kessler_NoRain) {
1050  amrex::Print() << "Moisture Model: Kessler No Rain" << std::endl;
1051  } else if (moisture_type == MoistureType::SatAdj) {
1052  amrex::Print() << "Moisture Model: Saturation Adjustment" << std::endl;
1053  } else {
1054  amrex::Print() << "Moisture Model: None" << std::endl;
1055  }
1056 
1057  if (terrain_type == TerrainType::StaticFittedMesh) {
1058  amrex::Print() << "Terrain Type: StaticFittedMesh" << std::endl;
1059  } else if (terrain_type == TerrainType::MovingFittedMesh) {
1060  amrex::Print() << "Terrain Type: MovingFittedMesh" << std::endl;
1061  } else if (terrain_type == TerrainType::EB) {
1062  amrex::Print() << "Terrain Type: EB" << std::endl;
1063  ebChoice.display();
1064  } else if (terrain_type == TerrainType::ImmersedForcing) {
1065  amrex::Print() << "Terrain Type: ImmersedForcing" << std::endl;
1066  } else {
1067  amrex::Print() << "Terrain Type: None" << std::endl;
1068  }
1069 
1070  if (buildings_type == BuildingsType::ImmersedForcing) {
1071  amrex::Print() << "Buildings Type: ImmersedForcing" << std::endl;
1072  } else {
1073  amrex::Print() << "Buildings Type: None" << std::endl;
1074  }
1075 
1076  if (mesh_type == MeshType::ConstantDz) {
1077  amrex::Print() << " Mesh Type: ConstantDz" << std::endl;
1078  } else if (mesh_type == MeshType::StretchedDz) {
1079  amrex::Print() << " Mesh Type: StretchedDz" << std::endl;
1080  } else if (mesh_type == MeshType::VariableDz) {
1081  amrex::Print() << " Mesh Type: VariableDz" << std::endl;
1082  } else {
1083  amrex::Error("No mesh_type set!");
1084  }
1085 
1086  amrex::Print() << "ABL Driver Type: " << std::endl;
1087  if (abl_driver_type == ABLDriverType::None) {
1088  amrex::Print() << " None" << std::endl;
1089  } else if (abl_driver_type == ABLDriverType::PressureGradient) {
1090  amrex::Print() << " Pressure Gradient "
1091  << amrex::RealVect(abl_pressure_grad[0],abl_pressure_grad[1],abl_pressure_grad[2])
1092  << std::endl;
1093  } else if (abl_driver_type == ABLDriverType::GeostrophicWind) {
1094  amrex::Print() << " Geostrophic Wind "
1095  << amrex::RealVect(abl_geo_forcing[0],abl_geo_forcing[1],abl_geo_forcing[2])
1096  << std::endl;
1097  }
1098 
1099  if (max_level > 0) {
1100  amrex::Print() << "Coupling Type: " << std::endl;
1101  if (coupling_type == CouplingType::TwoWay) {
1102  amrex::Print() << " Two-way" << std::endl;
1103  } else if (coupling_type == CouplingType::OneWay) {
1104  amrex::Print() << " One-way" << std::endl;
1105  }
1106  }
1107 
1108  if (rad_type == RadiationType::RRTMGP) {
1109  amrex::Print() << "Radiation Model: RRTMGP" << std::endl;
1110  } else {
1111  amrex::Print() << "Radiation Model: None" << std::endl;
1112  }
1113 
1114  amrex::Print() << "Gradp_type : " << gradp_type << std::endl;
1115 
1116  for (int lev = 0; lev <= max_level; lev++) {
1117  amrex::Print() << "Buoyancy_type at level " << lev << " : " << buoyancy_type[lev] << std::endl;
1118  }
1119 
1120  advChoice.display(pp_prefix);
1121  diffChoice.display();
1124 
1125  for (int lev = 0; lev <= max_level; lev++) {
1126  turbChoice[lev].display(lev);
1127  }
1128  }
1129 
1130  void build_coriolis_forcings_const_lat (std::string pp_prefix)
1131  {
1132  amrex::ParmParse pp(pp_prefix);
1133 
1134  // Read the rotational time period (in seconds)
1135  amrex::Real rot_time_period = amrex::Real(86400.0);
1136  pp.query("rotational_time_period", rot_time_period);
1137 
1138  coriolis_factor = two * two * PI / rot_time_period;
1139 
1140  pp.query("coriolis_3d", coriolis_3d);
1141 
1142  // Convert to radians
1143  amrex::Real latitude_for_coriolis = amrex::Real(90.0);
1144  pp.query("latitude", latitude_for_coriolis);
1145  latitude_for_coriolis *= (PI/amrex::Real(180.));
1146  sinphi = std::sin(latitude_for_coriolis);
1147 
1148  // Note: cosphi defaults to 0
1149  if (coriolis_3d) {
1150  cosphi = std::cos(latitude_for_coriolis);
1151  }
1152 
1153  amrex::Print() << "Coriolis frequency, f = " << coriolis_factor * sinphi << " 1/s" << std::endl;
1154 
1155  if (abl_driver_type == ABLDriverType::GeostrophicWind) {
1156  // Read in the geostrophic wind -- we only use this to construct
1157  // the forcing term so no need to keep it
1158  amrex::Vector<amrex::Real> abl_geo_wind(3);
1159  pp.queryarr("abl_geo_wind",abl_geo_wind);
1160 
1161  if(!pp.query("abl_geo_wind_table",abl_geo_wind_table)) {
1162  abl_geo_forcing = {
1163  -coriolis_factor * (abl_geo_wind[1]*sinphi - abl_geo_wind[2]*cosphi),
1164  coriolis_factor * abl_geo_wind[0]*sinphi,
1165  -coriolis_factor * abl_geo_wind[0]*cosphi
1166  };
1167  } else {
1168  amrex::Print() << "NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
1169  }
1170  }
1171  }
1172 
1173  void read_int_string (int max_level, const char* string_to_read,
1174  amrex::Vector<int>& vec_to_fill, int default_int)
1175  {
1176  amrex::ParmParse pp("erf");
1177  int nvals = pp.countval(string_to_read);
1178  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
1179  amrex::Vector<int> temp; temp.resize(nvals);
1180  pp.queryarr(string_to_read,temp);
1181 
1182  if (vec_to_fill.size() < max_level+1) {
1183  vec_to_fill.resize(max_level+1);
1184  }
1185 
1186  if (nvals == 0) {
1187  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
1188  } else if (nvals == 1) {
1189  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
1190  } else {
1191  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
1192  }
1193  }
1194 
1195  inline static
1196  InitType init_type = InitType::None;
1197 
1198  inline static
1199  SoundingType sounding_type = SoundingType::Ideal;
1200 
1201  inline static
1202  TerrainType terrain_type = TerrainType::None;
1203 
1204  inline static
1205  BuildingsType buildings_type = BuildingsType::None;
1206 
1207  inline static
1208  bool use_real_bcs = false;
1209 
1210  inline static
1211  MeshType mesh_type = MeshType::ConstantDz;
1212 
1213  static
1214  void set_mesh_type (MeshType new_mesh_type)
1215  {
1216  mesh_type = new_mesh_type;
1217  }
1218 
1223  amrex::Vector<TurbChoice> turbChoice;
1225 
1227 
1228  amrex::Vector<SubsteppingType> substepping_type;
1229  amrex::Vector<int> anelastic;
1230  amrex::Vector<int> fixed_density;
1231  amrex::Vector<int> project_initial_velocity;
1232  amrex::Vector<int> buoyancy_type;
1233  amrex::Vector<int> is_land;
1234 
1235  // do some extra CFL diagnostics for compressible with substepping
1236  bool substepping_diag = false;
1237 
1238  // time off-centering coefficient, > 0 for forward weighting (i.e., bias
1239  // towards the future time step)
1241 
1242  // This controls the time-centering of the *vertical* differences in the diffusive term for
1243  // theta, u, v (and w if ERF_IMPLICIT_W is set)
1244  // 0: fully explicit
1245  // 1: fully implicit
1246  amrex::Vector<amrex::Vector<amrex::Real>> vert_implicit_fac; // one value per RK stage
1247 
1248  // if any vert_implicit_fac > 0, then the following apply:
1254 
1255  int ncorr = 1;
1256 #ifdef AMREX_USE_FLOAT
1259 #else
1262 #endif
1263 
1264  bool test_mapfactor = false;
1265 
1266  int gradp_type = 0;
1267 
1269 
1270  // Specify what additional physics/forcing modules we use
1271  bool use_gravity = false;
1272  bool use_coriolis = false;
1273  bool coriolis_3d = true;
1274 
1276 
1277  // Specify whether to apply other various source terms on substep only
1279  bool forest_substep = false;
1280 
1281  // immersed forcing parameters
1284  // immersed forcing MOST parameters.
1290  bool if_use_most = false;
1291 
1292  // This defaults to true but can be set to false for moving terrain cases only
1293  bool use_lagged_delta_rt = true;
1294 
1295  // Flag to rebalance state from wrf input
1296  bool rebalance_wrf_input = true;
1297 
1298  // Constants
1300  amrex::Real c_p = Cp_d; // specific heat at constant pressure for dry air [J/(kg-K)]
1302 
1303  // Staggered z levels for vertical grid stretching
1307 
1308  // Coriolis forcing
1312 
1313  // User-specified forcings in problem definition
1316  bool custom_w_subsidence = false;
1317  bool do_theta_advection = true; // Apply custom vertical subsidence to (rho*theta) equation when using custom w subsidence
1318  bool do_mom_advection = true; // Apply custom vertical subsidence to momentum equations when using custom w subsidence
1323 
1324  // Do we use source terms to nudge the solution towards
1325  // the time-varying data provided in input sounding files?
1327 
1328  // MOST stress rotations
1330 
1331  // Should we use SHOC?
1332  bool use_eamxx_shoc = false;
1333  bool use_native_shoc = false;
1334 
1335  // Transport the passive scalar?
1336  bool transport_scalar = true;
1337 
1338  // User wishes to output time averaged velocity fields
1339  bool time_avg_vel = false;
1340 
1341  bool use_perturbation (int lev) const
1342  {
1343  return pert_type[lev] == PerturbationType::Source ||
1344  pert_type[lev] == PerturbationType::Direct ||
1345  pert_type[lev] == PerturbationType::CPM;
1346  }
1347 
1348  bool use_direct_perturbation (int lev) const
1349  {
1350  return pert_type[lev] == PerturbationType::Direct ||
1351  pert_type[lev] == PerturbationType::CPM;
1352  }
1353 
1354  bool use_source_perturbation (int lev) const
1355  {
1356  return pert_type[lev] == PerturbationType::Source;
1357  }
1358 
1359  bool uses_shoc_family () const noexcept
1360  {
1361  return use_eamxx_shoc || use_native_shoc;
1362  }
1363 
1365  {
1366  return uses_shoc_family();
1367  }
1368 
1369  bool any_perturbation () const
1370  {
1371  for (const auto& type : pert_type) {
1372  if (type == PerturbationType::Source ||
1373  type == PerturbationType::Direct ||
1374  type == PerturbationType::CPM) {
1375  return true;
1376  }
1377  }
1378  return false;
1379  }
1380 
1381  // Type of perturbation
1382  amrex::Vector<PerturbationType> pert_type;
1383 
1384  // Numerical diffusion
1385  bool use_num_diff{false};
1387 
1388  CouplingType coupling_type;
1389  MoistureType moisture_type;
1390  WindFarmType windfarm_type;
1391  WindFarmLocType windfarm_loc_type;
1392  LandSurfaceType lsm_type;
1393  RadiationType rad_type;
1394 
1395  ABLDriverType abl_driver_type;
1396  amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> abl_pressure_grad;
1397  amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> abl_geo_forcing;
1398  std::string abl_geo_wind_table;
1400 
1401  bool variable_coriolis{false};
1402 
1403  int ave_plane {2};
1404 
1405  // Microphysics params
1407 
1409 
1416 
1417  // Nudging factor for bdy sponging : F1 = 1/(nudge_factor * dt)
1419 
1420  // Which approach to nudging the moist variables in the boundary region?
1422 
1423  // Use forest canopy model?
1424  bool do_forest_drag {false};
1425 
1426  // Enforce constant mass flux?
1432  int massflux_klo {0}; // these are updated in ERF.cpp
1433  int massflux_khi {0};
1434 
1438  bool hindcast_surface_bcs = false;
1442 
1445 
1446  bool is_init_for_ensemble = false;
1447  int n_ensemble = -1;
1451 };
1452 #endif
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:44
constexpr amrex::Real two
Definition: ERF_Constants.H:10
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:26
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
constexpr amrex::Real PI
Definition: ERF_Constants.H:37
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:53
constexpr amrex::Real R_d
Definition: ERF_Constants.H:42
TauType
Definition: ERF_DataStruct.H:31
@ tau12
Definition: ERF_DataStruct.H:32
@ tau23
Definition: ERF_DataStruct.H:32
@ tau33
Definition: ERF_DataStruct.H:32
@ tau22
Definition: ERF_DataStruct.H:32
@ tau11
Definition: ERF_DataStruct.H:32
@ tau32
Definition: ERF_DataStruct.H:32
@ tau31
Definition: ERF_DataStruct.H:32
@ tau21
Definition: ERF_DataStruct.H:32
@ tau13
Definition: ERF_DataStruct.H:32
AMREX_ENUM(InitType, None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, ConstantDensity, ConstantDensityLinearTheta, Isentropic, MoistBaseState, HindCast)
Rayleigh
Definition: ERF_DataStruct.H:97
@ ubar
Definition: ERF_DataStruct.H:98
@ wbar
Definition: ERF_DataStruct.H:98
@ nvars
Definition: ERF_DataStruct.H:98
@ vbar
Definition: ERF_DataStruct.H:98
@ thetabar
Definition: ERF_DataStruct.H:98
Sponge
Definition: ERF_DataStruct.H:102
@ nvars_sponge
Definition: ERF_DataStruct.H:103
@ vbar_sponge
Definition: ERF_DataStruct.H:103
@ ubar_sponge
Definition: ERF_DataStruct.H:103
MapFacType
Definition: ERF_DataStruct.H:22
@ v_x
Definition: ERF_DataStruct.H:24
@ num
Definition: ERF_DataStruct.H:24
@ u_y
Definition: ERF_DataStruct.H:25
@ v_y
Definition: ERF_DataStruct.H:25
@ m_y
Definition: ERF_DataStruct.H:25
@ u_x
Definition: ERF_DataStruct.H:24
@ m_x
Definition: ERF_DataStruct.H:24
Coord
Definition: ERF_DataStruct.H:92
#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
ParmParse pp("prob")
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
amrex::Real Real
Definition: ERF_ShocInterface.H:19
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")
Definition: ERF_EWP.H:9
Definition: ERF_Fitch.H:9
Definition: ERF_GeneralAD.H:8
Definition: ERF_Kessler.H:39
Definition: ERF_MM5.H:26
Definition: ERF_MoistNoCondensation.H:13
Definition: ERF_Morrison.H:58
Definition: ERF_NOAHMP.H:85
Definition: ERF_OceanSurf.H:19
Definition: ERF_SAM.H:54
Definition: ERF_SLM.H:26
Definition: ERF_SatAdj.H:45
Definition: ERF_SimpleAD.H:8
Definition: ERF_WSM6.H:37
Definition: ERF_AdvStruct.H:19
void display(std::string &pp_prefix)
Definition: ERF_AdvStruct.H:235
void init_params(std::string pp_prefix)
Definition: ERF_AdvStruct.H:21
Definition: ERF_DampingStruct.H:19
void init_params(std::string pp_prefix)
Definition: ERF_DampingStruct.H:21
void display()
Definition: ERF_DampingStruct.H:61
Definition: ERF_DiffStruct.H:19
void init_params(std::string pp_prefix)
Definition: ERF_DiffStruct.H:21
void display()
Definition: ERF_DiffStruct.H:67
MolecDiffType molec_diff_type
Definition: ERF_DiffStruct.H:84
Definition: ERF_EBStruct.H:27
void init_params(std::string pp_prefix)
Definition: ERF_EBStruct.H:29
void display()
Definition: ERF_EBStruct.H:47
Definition: ERF_DataStruct.H:106
int nc
Definition: ERF_DataStruct.H:113
int qs
Definition: ERF_DataStruct.H:111
int qr
Definition: ERF_DataStruct.H:110
MoistureComponentIndices()=default
int qi
Definition: ERF_DataStruct.H:109
int ni
Definition: ERF_DataStruct.H:114
MoistureComponentIndices(int qv_comp, int qc_comp, int qi_comp=-1, int qr_comp=-1, int qs_comp=-1, int qg_comp=-1, int nc_comp=-1, int ni_comp=-1, int nr_comp=-1, int ns_comp=-1, int ng_comp=-1)
Definition: ERF_DataStruct.H:120
int qv
Definition: ERF_DataStruct.H:107
int nr
Definition: ERF_DataStruct.H:115
int qc
Definition: ERF_DataStruct.H:108
int ng
Definition: ERF_DataStruct.H:117
int qg
Definition: ERF_DataStruct.H:112
int ns
Definition: ERF_DataStruct.H:116
Definition: ERF_DataStruct.H:141
bool rebalance_wrf_input
Definition: ERF_DataStruct.H:1296
amrex::Real hurricane_eye_latitude
Definition: ERF_DataStruct.H:1444
bool do_mom_advection
Definition: ERF_DataStruct.H:1318
amrex::Real if_init_surf_temp
Definition: ERF_DataStruct.H:1287
amrex::Real dz0
Definition: ERF_DataStruct.H:1306
amrex::Real const_massflux_layer_lo
Definition: ERF_DataStruct.H:1430
bool use_lagged_delta_rt
Definition: ERF_DataStruct.H:1293
amrex::Real coriolis_factor
Definition: ERF_DataStruct.H:1309
static MeshType mesh_type
Definition: ERF_DataStruct.H:1211
amrex::Real if_surf_temp_flux
Definition: ERF_DataStruct.H:1286
amrex::Real windfarm_x_shift
Definition: ERF_DataStruct.H:1414
void check_params(int max_level, const amrex::Vector< amrex::Geometry > &geom_vect, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > phys_bc_type)
Definition: ERF_DataStruct.H:903
bool pbl_suppresses_microphysics_condensation() const noexcept
Definition: ERF_DataStruct.H:1364
void display(int max_level, std::string pp_prefix)
Definition: ERF_DataStruct.H:994
amrex::Real hindcast_lateral_sponge_strength
Definition: ERF_DataStruct.H:1439
amrex::Real poisson_reltol
Definition: ERF_DataStruct.H:1261
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Definition: ERF_DataStruct.H:1130
bool if_use_most
Definition: ERF_DataStruct.H:1290
DampingChoice dampingChoice
Definition: ERF_DataStruct.H:1221
bool use_eamxx_shoc
Definition: ERF_DataStruct.H:1332
int n_ensemble
Definition: ERF_DataStruct.H:1447
amrex::Real rdOcp
Definition: ERF_DataStruct.H:1301
bool spatial_moisture_forcing
Definition: ERF_DataStruct.H:1322
RadiationType rad_type
Definition: ERF_DataStruct.H:1393
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:1173
amrex::Vector< int > project_initial_velocity
Definition: ERF_DataStruct.H:1231
std::string windfarm_spec_table
Definition: ERF_DataStruct.H:1410
amrex::Real hindcast_zhi_sponge_length
Definition: ERF_DataStruct.H:1440
DiffChoice diffChoice
Definition: ERF_DataStruct.H:1220
amrex::Real const_massflux_v
Definition: ERF_DataStruct.H:1428
amrex::Real if_z0
Definition: ERF_DataStruct.H:1285
bool use_gravity
Definition: ERF_DataStruct.H:1271
int ncorr
Definition: ERF_DataStruct.H:1255
amrex::Vector< PerturbationType > pert_type
Definition: ERF_DataStruct.H:1382
int force_stage1_single_substep
Definition: ERF_DataStruct.H:1226
bool hindcast_zhi_sponge_damping
Definition: ERF_DataStruct.H:1441
std::string windfarm_spec_table_extra
Definition: ERF_DataStruct.H:1410
amrex::Real cosphi
Definition: ERF_DataStruct.H:1310
LandSurfaceType lsm_type
Definition: ERF_DataStruct.H:1392
amrex::Real c_p
Definition: ERF_DataStruct.H:1300
amrex::Vector< int > buoyancy_type
Definition: ERF_DataStruct.H:1232
std::string windfarm_loc_table
Definition: ERF_DataStruct.H:1410
amrex::Real ens_pert_amplitude
Definition: ERF_DataStruct.H:1449
bool do_theta_advection
Definition: ERF_DataStruct.H:1317
amrex::Real gravity
Definition: ERF_DataStruct.H:1299
bool any_perturbation() const
Definition: ERF_DataStruct.H:1369
amrex::Vector< int > is_land
Definition: ERF_DataStruct.H:1233
bool implicit_ke_diffusion
Definition: ERF_DataStruct.H:1251
amrex::Real bdy_nudge_factor
Definition: ERF_DataStruct.H:1418
amrex::Real beta_s
Definition: ERF_DataStruct.H:1240
bool custom_rhotheta_forcing
Definition: ERF_DataStruct.H:1314
amrex::Real hindcast_lateral_sponge_length
Definition: ERF_DataStruct.H:1439
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Definition: ERF_DataStruct.H:1397
WindFarmLocType windfarm_loc_type
Definition: ERF_DataStruct.H:1391
bool hindcast_lateral_forcing
Definition: ERF_DataStruct.H:1437
int massflux_klo
Definition: ERF_DataStruct.H:1432
bool moisture_tight_coupling
Definition: ERF_DataStruct.H:1408
bool custom_w_subsidence
Definition: ERF_DataStruct.H:1316
bool nudging_from_input_sounding
Definition: ERF_DataStruct.H:1326
bool custom_geostrophic_profile
Definition: ERF_DataStruct.H:1319
amrex::Real if_Cd_scalar
Definition: ERF_DataStruct.H:1282
bool immersed_forcing_substep
Definition: ERF_DataStruct.H:1278
amrex::Real grid_stretching_ratio
Definition: ERF_DataStruct.H:1304
amrex::Real sinphi
Definition: ERF_DataStruct.H:1311
bool have_geo_wind_profile
Definition: ERF_DataStruct.H:1399
bool use_perturbation(int lev) const
Definition: ERF_DataStruct.H:1341
amrex::Real hurricane_eye_longitude
Definition: ERF_DataStruct.H:1444
amrex::Real const_massflux_u
Definition: ERF_DataStruct.H:1427
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Definition: ERF_DataStruct.H:1396
bool implicit_moisture_diffusion
Definition: ERF_DataStruct.H:1250
std::string hindcast_surface_data_dir
Definition: ERF_DataStruct.H:1435
void init_params(int max_level, std::string pp_prefix)
Definition: ERF_DataStruct.H:143
bool io_hurricane_eye_tracker
Definition: ERF_DataStruct.H:1443
bool use_direct_perturbation(int lev) const
Definition: ERF_DataStruct.H:1348
amrex::Vector< SubsteppingType > substepping_type
Definition: ERF_DataStruct.H:1228
bool coriolis_3d
Definition: ERF_DataStruct.H:1273
amrex::Real if_Olen_in
Definition: ERF_DataStruct.H:1289
bool uses_shoc_family() const noexcept
Definition: ERF_DataStruct.H:1359
bool use_num_diff
Definition: ERF_DataStruct.H:1385
amrex::Real sampling_distance_by_D
Definition: ERF_DataStruct.H:1412
bool implicit_thermal_diffusion
Definition: ERF_DataStruct.H:1249
amrex::Real hindcast_zhi_sponge_strength
Definition: ERF_DataStruct.H:1440
bool test_mapfactor
Definition: ERF_DataStruct.H:1264
bool use_coriolis
Definition: ERF_DataStruct.H:1272
static SoundingType sounding_type
Definition: ERF_DataStruct.H:1199
bool four_stream_radiation
Definition: ERF_DataStruct.H:1275
std::string coarse_bckgnd_data_file
Definition: ERF_DataStruct.H:1450
bool custom_moisture_forcing
Definition: ERF_DataStruct.H:1315
amrex::Real num_diff_coeff
Definition: ERF_DataStruct.H:1386
std::string windfarm_blade_table
Definition: ERF_DataStruct.H:1411
amrex::Real zsurf
Definition: ERF_DataStruct.H:1305
amrex::Real if_surf_heating_rate
Definition: ERF_DataStruct.H:1288
bool use_native_shoc
Definition: ERF_DataStruct.H:1333
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:1223
bool variable_coriolis
Definition: ERF_DataStruct.H:1401
amrex::Vector< int > anelastic
Definition: ERF_DataStruct.H:1229
amrex::Real if_Cd_momentum
Definition: ERF_DataStruct.H:1283
AdvChoice advChoice
Definition: ERF_DataStruct.H:1219
bool use_pert_pres_gradient
Definition: ERF_DataStruct.H:1268
MoistureType moisture_type
Definition: ERF_DataStruct.H:1389
bool custom_forcing_prim_vars
Definition: ERF_DataStruct.H:1320
std::string abl_geo_wind_table
Definition: ERF_DataStruct.H:1398
static BuildingsType buildings_type
Definition: ERF_DataStruct.H:1205
static TerrainType terrain_type
Definition: ERF_DataStruct.H:1202
amrex::Real hindcast_data_interval_in_hrs
Definition: ERF_DataStruct.H:1436
ABLDriverType abl_driver_type
Definition: ERF_DataStruct.H:1395
amrex::Vector< int > fixed_density
Definition: ERF_DataStruct.H:1230
SpongeChoice spongeChoice
Definition: ERF_DataStruct.H:1222
WindFarmType windfarm_type
Definition: ERF_DataStruct.H:1390
static InitType init_type
Definition: ERF_DataStruct.H:1196
bool substepping_diag
Definition: ERF_DataStruct.H:1236
bool implicit_momentum_diffusion
Definition: ERF_DataStruct.H:1252
amrex::Real ens_pert_correlated_radius
Definition: ERF_DataStruct.H:1448
amrex::Real const_massflux_layer_hi
Definition: ERF_DataStruct.H:1431
int bdy_moist_nudge_type
Definition: ERF_DataStruct.H:1421
bool use_source_perturbation(int lev) const
Definition: ERF_DataStruct.H:1354
bool implicit_before_substep
Definition: ERF_DataStruct.H:1253
static bool use_real_bcs
Definition: ERF_DataStruct.H:1208
amrex::Real poisson_abstol
Definition: ERF_DataStruct.H:1260
MoistureComponentIndices moisture_indices
Definition: ERF_DataStruct.H:1406
amrex::Real turb_disk_angle
Definition: ERF_DataStruct.H:1413
bool hindcast_surface_bcs
Definition: ERF_DataStruct.H:1438
amrex::Real windfarm_y_shift
Definition: ERF_DataStruct.H:1415
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Definition: ERF_DataStruct.H:1246
bool use_rotate_surface_flux
Definition: ERF_DataStruct.H:1329
bool do_forest_drag
Definition: ERF_DataStruct.H:1424
amrex::Real const_massflux_tau
Definition: ERF_DataStruct.H:1429
int massflux_khi
Definition: ERF_DataStruct.H:1433
bool time_avg_vel
Definition: ERF_DataStruct.H:1339
bool spatial_rhotheta_forcing
Definition: ERF_DataStruct.H:1321
bool forest_substep
Definition: ERF_DataStruct.H:1279
EBChoice ebChoice
Definition: ERF_DataStruct.H:1224
CouplingType coupling_type
Definition: ERF_DataStruct.H:1388
std::string windfarm_airfoil_tables
Definition: ERF_DataStruct.H:1411
bool transport_scalar
Definition: ERF_DataStruct.H:1336
int gradp_type
Definition: ERF_DataStruct.H:1266
static void set_mesh_type(MeshType new_mesh_type)
Definition: ERF_DataStruct.H:1214
bool is_init_for_ensemble
Definition: ERF_DataStruct.H:1446
int ave_plane
Definition: ERF_DataStruct.H:1403
std::string hindcast_boundary_data_dir
Definition: ERF_DataStruct.H:1435
Definition: ERF_SpongeStruct.H:19
void display()
Definition: ERF_SpongeStruct.H:75
void init_params(std::string pp_prefix)
Definition: ERF_SpongeStruct.H:21