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_DiffStruct.H>
16 #include <ERF_SpongeStruct.H>
17 #include <ERF_TurbStruct.H>
18 #include <ERF_TurbPertStruct.H>
19 
20 enum MapFacType {
21 // This version assumes isotropic
22  m_x, u_x, v_x, num,
23  m_y = 0, u_y = 1, v_y = 2
24 // This version allows for non-isotropic
25 // m_x, u_x, v_x,
26 // m_y, u_y, v_y, num
27 };
28 
29 enum TauType {
31 };
32 
33 AMREX_ENUM(InitType,
34  None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, HindCast
35 );
36 
37 AMREX_ENUM(SoundingType,
38  ConstantDensity, Ideal, Isentropic, DryIsentropic
39 );
40 
41 AMREX_ENUM(ABLDriverType,
42  None, PressureGradient, GeostrophicWind
43 );
44 
45 AMREX_ENUM(CouplingType,
46  OneWay, TwoWay
47 );
48 
49 AMREX_ENUM(SubsteppingType,
50  None, Explicit, Implicit
51 );
52 
53 AMREX_ENUM(MeshType,
54  ConstantDz, StretchedDz, VariableDz
55 );
56 
57 AMREX_ENUM(TerrainType,
58  None, StaticFittedMesh, MovingFittedMesh, EB, ImmersedForcing
59 );
60 
61 AMREX_ENUM(MoistureModelType,
62  Eulerian, Lagrangian, Undefined
63 );
64 
65 AMREX_ENUM(MoistureType,
66  SAM, SAM_NoIce, SAM_NoPrecip_NoIce, Kessler, Kessler_NoRain, SatAdj, Morrison, Morrison_NoIce, None
67 );
68 
69 AMREX_ENUM(WindFarmType,
70  Fitch, EWP, SimpleAD, GeneralAD, None
71 );
72 
73 AMREX_ENUM(WindFarmLocType,
74  lat_lon, x_y, None
75 );
76 
77 AMREX_ENUM(LandSurfaceType,
78  SLM, MM5, None, NOAHMP
79 );
80 
81 AMREX_ENUM(RadiationType,
82  None, RRTMGP
83 );
84 
85 enum struct Coord {
86  x, y, z
87 };
88 
89 // These are used as integers so must be enum not enum struct
90 enum Rayleigh {
92 };
93 
94 // These are used as integers so must be enum not enum struct
95 enum Sponge {
97 };
98 
100  int qv = -1; // Water vapor
101  int qc = -1; // Cloud liquid water
102  int qi = -1; // Cloud ice
103  int qr = -1; // Rain
104  int qs = -1; // Snow
105  int qg = -1; // Graupel
106 
107  // Constructor for easy initialization
108  MoistureComponentIndices (int qv_comp, int qc_comp,
109  int qi_comp=-1,
110  int qr_comp=-1,
111  int qs_comp=-1,
112  int qg_comp=-1)
113  : qv(qv_comp), qc(qc_comp), qi(qi_comp), qr(qr_comp), qs(qs_comp), qg(qg_comp) {}
114 
115  // Default constructor
117 };
118 
119 /**
120  * Container holding many of the algorithmic options and parameters
121  */
122 
123 struct SolverChoice {
124  public:
125  void init_params (int max_level, std::string pp_prefix)
126  {
127  amrex::ParmParse pp(pp_prefix);
128 
129  bool bogus;
130  if (pp.query("use_terrain",bogus) > 0) {
131  amrex::Abort("The input use_terrain is deprecated. Set terrain_type instead.");
132  }
133 
134  // Do we set map scale factors to 0.5 instead of 1 for testing?
135  pp.query("test_mapfactor", test_mapfactor);
136 
137  // Which horizontal pressure gradient formulation to use with terrain fitted coords?
138  // 0: dp/dx with dp/dz correction (default)
139  // 1: gradient of vertically interpolated p, see Klemp 2011
140  pp.query("gradp_type", gradp_type);
141  AMREX_ALWAYS_ASSERT(gradp_type == 0 || gradp_type == 1);
142 
143  // What type of moisture model to use?
144  moisture_type = MoistureType::None; // Default
145  if (pp.query("moisture_type",moisture_type) > 0) {
146  amrex::Abort("The input moisture_type is deprecated. Set moisture_model instead.");
147  }
148  pp.query_enum_case_insensitive("moisture_model",moisture_type);
149  if ( (moisture_type == MoistureType::Morrison) ||
150  (moisture_type == MoistureType::SAM) ) {
152  RhoQ1_comp, // water vapor
153  RhoQ2_comp, // cloud water
154  RhoQ3_comp, // cloud ice
155  RhoQ4_comp, // rain
156  RhoQ5_comp, // snow
157  RhoQ6_comp // graupel
158  );
159  } else if ( (moisture_type == MoistureType::Morrison_NoIce) ||
160  (moisture_type == MoistureType::SAM_NoIce) ) {
162  RhoQ1_comp, // water vapor
163  RhoQ2_comp, // cloud water
164  -1, // cloud ice
165  RhoQ4_comp // rain
166  );
167  } else if ( (moisture_type == MoistureType::SAM_NoPrecip_NoIce) ||
168  (moisture_type == MoistureType::Kessler_NoRain) ||
169  (moisture_type == MoistureType::SatAdj) ) {
171  RhoQ1_comp, // water vapor
172  RhoQ2_comp // cloud water
173  );
174  } else if (moisture_type == MoistureType::Kessler) {
176  RhoQ1_comp, // water vapor
177  RhoQ2_comp, // cloud water
178  -1, // cloud ice
179  RhoQ3_comp // rain
180  );
181  }
182 
183  // TODO: should we set default for dry??
184  // Set a different default for moist vs dry
185  if (moisture_type != MoistureType::None) {
186  if (moisture_type == MoistureType::Kessler_NoRain ||
187  moisture_type == MoistureType::SAM ||
188  moisture_type == MoistureType::SAM_NoIce ||
189  moisture_type == MoistureType::SAM_NoPrecip_NoIce ||
190  moisture_type == MoistureType::Morrison ||
191  moisture_type == MoistureType::Morrison_NoIce ||
192  moisture_type == MoistureType::SatAdj)
193  {
194  buoyancy_type = 1; // uses Rhoprime
195  } else {
196  buoyancy_type = 2; // uses Tprime
197  }
198 
199  pp.query("moisture_tight_coupling",moisture_tight_coupling);
200  }
201 
202  // Which expression (1,2/3 or 4) to use for buoyancy
203  pp.query("buoyancy_type", buoyancy_type);
204 
205  // What type of land surface model to use
206  lsm_type = LandSurfaceType::None; // Default
207  pp.query_enum_case_insensitive("land_surface_model",lsm_type);
208 
209  // What type of radiation model to use
210  rad_type = RadiationType::None; // Default
211  pp.query_enum_case_insensitive("radiation_model", rad_type);
212 
213  // Verify that radiation model cannot be RRTMGP if ERF was not compiled with RRTMGP
214 #ifndef ERF_USE_RRTMGP
215  if (rad_type == RadiationType::RRTMGP)
216  {
217  amrex::Abort("ERF was not compiled with RRTMGP enabled!");
218  }
219 #endif
220 
221  // Is the terrain none, static or moving?
222  std::string terrain_type_temp = "";
223  pp.query("terrain_type", terrain_type_temp);
224  if (terrain_type_temp == "Moving") {
225  amrex::Warning("erf.terrain_type = Moving is deprecated; please replace Moving by MovingFittedMesh");
226  terrain_type = TerrainType::MovingFittedMesh;
227  } else if (terrain_type_temp == "Static") {
228  amrex::Warning("erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
229  terrain_type = TerrainType::StaticFittedMesh;
230  } else {
231  pp.query_enum_case_insensitive("terrain_type",terrain_type);
232  }
233 
234  //
235  // Read the init_type here to make sure we correctly set the mesh and terrain types
236  //
237  std::string init_type_temp_string;
238  pp.query("init_type",init_type_temp_string);
239  if ( (init_type_temp_string == "Real") || (init_type_temp_string == "real") ) {
240  amrex::Abort("erf.init_type = Real is deprecated; please replace Real by WRFInput");
241  } else if ( (init_type_temp_string == "Ideal") || (init_type_temp_string == "ideal") ) {
242  amrex::Abort("erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
243  } else if (init_type_temp_string == "hindcast") {
244  init_type = InitType::HindCast;
245  }
246  else {
247  pp.query_enum_case_insensitive("init_type",init_type);
248  use_real_bcs = ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) );
249  }
250 
251  if ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) {
252  if (terrain_type != TerrainType::StaticFittedMesh) {
253  amrex::Abort("Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
254  }
255  }
256 
257  if (init_type == InitType::WRFInput) {
258  if (moisture_type == MoistureType::None) {
259  amrex::Abort("Can't have moisture_type = None with init_type = WRFInput");
260  }
261 
262  // NetCDF wrfbdy lateral boundary file
263  std::string nc_bdy_file_temp_string;
264  bool has_bdy = pp.query("nc_bdy_file", nc_bdy_file_temp_string);
265  if (!has_bdy) use_real_bcs = false;
266 
267  bool use_real_bcs_temp = use_real_bcs;
268  pp.query("use_real_bcs", use_real_bcs_temp);
269  if (use_real_bcs && !use_real_bcs_temp) {
270  use_real_bcs = false;
271  }
272  }
273 
274  if (use_real_bcs) {
275  pp.query("upwind_real_bcs",upwind_real_bcs);
276  }
277 
278  // Check for rebalancing with wrfinput
279  if (init_type == InitType::WRFInput) {
280  pp.query("rebalance_wrfinput",rebalance_wrfinput);
281  }
282 
283  // How to interpret input_sounding
284  if (init_type == InitType::Input_Sounding) {
285  pp.query_enum_case_insensitive("sounding_type",sounding_type);
286  }
287 
288  if (terrain_type == TerrainType::StaticFittedMesh ||
289  terrain_type == TerrainType::MovingFittedMesh) {
290  mesh_type = MeshType::VariableDz;
291  }
292 
293  pp.query("grid_stretching_ratio", grid_stretching_ratio);
294  if (grid_stretching_ratio != 0) {
295  AMREX_ASSERT_WITH_MESSAGE((grid_stretching_ratio >= 1.),
296  "The grid stretching ratio must be greater than 1");
297  }
298  if (grid_stretching_ratio >= 1) {
299  if (terrain_type == TerrainType::None) {
300  terrain_type = TerrainType::StaticFittedMesh;
301  }
302  if (mesh_type == MeshType::ConstantDz) {
303  mesh_type = MeshType::StretchedDz;
304  }
305  pp.query("zsurface", zsurf);
306  if (zsurf != 0.0) {
307  amrex::Print() << "Nominal zsurface height != 0, may result in unexpected behavior"
308  << std::endl;
309  }
310  pp.get("initial_dz", dz0);
311  }
312 
313  int n_zlevels = pp.countval("terrain_z_levels");
314  if (n_zlevels > 0)
315  {
316  if (terrain_type == TerrainType::None) {
317  terrain_type = TerrainType::StaticFittedMesh;
318  }
319  if (mesh_type == MeshType::ConstantDz) {
320  mesh_type = MeshType::StretchedDz;
321  }
322  }
323 
324  // Use lagged_delta_rt in the fast integrator?
325  pp.query("use_lagged_delta_rt", use_lagged_delta_rt);
326 
327  // These default to true but are used for unit testing
328  pp.query("use_gravity", use_gravity);
330 
331  pp.query("c_p", c_p);
332  rdOcp = R_d / c_p;
333 
334  read_int_string(max_level, "anelastic", anelastic, 0);
335 
336  if (!upwind_real_bcs && anelastic[0]) {
337  amrex::Print() << "Setting upwind_real_bcs to true because we are doing anelastic at level 0" << std::endl;
338  upwind_real_bcs = true;
339  }
340 
341  // *******************************************************************************
342  // Read substepping_type and allow for different values at each level
343  // *******************************************************************************
344  substepping_type.resize(max_level+1);
345 
346  for (int i = 0; i <= max_level; i++) {
347  substepping_type[i] = SubsteppingType::Implicit;
348  }
349 
350  int nvals = pp.countval("substepping_type");
351  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
352 
353  if (nvals == 1) {
354  pp.query_enum_case_insensitive("substepping_type",substepping_type[0]);
355  for (int i = 1; i <= max_level; i++) {
357  }
358  } else if (nvals > 1) { // in this case we have asserted nvals >= max_level+1
359  for (int i = 0; i <= max_level; i++) {
360  pp.query_enum_case_insensitive("substepping_type",substepping_type[i],i);
361  }
362  }
363 
364  // Note: this will be overwritten with -1 on levels that have substepping_type == Explicit
365  pp.query("beta_s", beta_s);
366 
367 # ifndef ERF_USE_SHOC
368  // This controls the time-centering of the vertical differences in the diffusive term for (rho theta) only
369  int n_impfac = pp.countval("vert_implicit_fac");
370  AMREX_ALWAYS_ASSERT(n_impfac == 0 || n_impfac == 1 || n_impfac==3);
371 
372  if (n_impfac == 1) {
373  amrex::Real fac_in;
374  pp.get("vert_implicit_fac", fac_in);
375  for (int i=0; i<3; ++i) vert_implicit_fac[i] = fac_in;
376  } else if (n_impfac == 3) {
377  pp.getarr("vert_implicit_fac", vert_implicit_fac);
378  }
379 
380  // This controls when the vertical implicit solve for the diffusive terms will happen relative to
381  // the acoustic substepping (if it happens, i.e. if any of the implicit_fac > 0.)
382  // The default is false (i.e. that it happens after the acoustic substepping).
383  pp.query("implicit_before_substep", implicit_before_substep);
384 #endif
385 
386  // *******************************************************************************
387  // Error check on deprecated input
388  // *******************************************************************************
389  int nvals_old = pp.countval("no_substepping");
390  if (nvals_old > 0) {
391  amrex::Abort("The no_substepping flag is deprecated -- set substepping_type instead");
392  }
393  // *******************************************************************************
394 
395  bool any_anelastic = false;
396  for (int i = 0; i <= max_level; ++i) {
397  if (anelastic[i] == 1) any_anelastic = true;
398  }
399 
400  if (any_anelastic == 1) {
402  fixed_density = true; // We default to true but are allowed to override below
403  buoyancy_type = 3; // (This isn't actually used when anelastic is set)
404  } else {
405  pp.query("project_initial_velocity", project_initial_velocity);
406  }
407 
408  pp.query("fixed_density", fixed_density);
409 
410  // *******************************************************************************
411 
412  pp.query("ncorr", ncorr);
413  pp.query("poisson_abstol", poisson_abstol);
414  pp.query("poisson_reltol", poisson_reltol);
415 
416  for (int lev = 0; lev <= max_level; lev++) {
417  if (anelastic[lev] != 0)
418  {
419  substepping_type[lev] = SubsteppingType::None;
420  }
421  }
422 
423  pp.query("force_stage1_single_substep", force_stage1_single_substep);
424 
425  // Include Coriolis forcing?
426  pp.query("use_coriolis", use_coriolis);
427  pp.query("has_lat_lon", has_lat_lon);
428  pp.query("variable_coriolis", variable_coriolis);
429 
430  // Include Rayleigh damping (separate flags for each variable)
431  pp.query("rayleigh_damp_U", rayleigh_damp_U);
432  pp.query("rayleigh_damp_V", rayleigh_damp_V);
433  pp.query("rayleigh_damp_W", rayleigh_damp_W);
434  pp.query("rayleigh_damp_T", rayleigh_damp_T);
435  pp.query("rayleigh_dampcoef", rayleigh_dampcoef);
436  pp.query("rayleigh_zdamp", rayleigh_zdamp);
437  pp.query("rayleigh_damp_substep", rayleigh_damp_substep); // apply Rayleigh damping source terms in substep only
438 
439  // Include vertical-velocity damping to improve robustness
440  pp.query("w_damping", w_damping);
441  pp.query("w_damping_cfl", w_damping_cfl);
442  pp.query("w_damping_coeff", w_damping_coeff);
443 
444  // Include four stream radiation approximation
445  pp.query("four_stream_radiation", four_stream_radiation);
446 
447  // flags for whether to apply other source terms in substep only
448  pp.query("immersed_forcing_substep", immersed_forcing_substep); // apply Rayleigh damping source terms in substep only
449  pp.query("forest_substep", forest_substep); // apply Rayleigh damping source terms in substep only
450 
451  // immersed forcing parameters
452  pp.query("if_Cd_scalar", if_Cd_scalar);
453  pp.query("if_Cd_momentum", if_Cd_momentum);
454  pp.query("if_z0", if_z0);
455  pp.query("if_surf_temp_flux", if_surf_temp_flux);
456  pp.query("if_init_surf_temp", if_init_surf_temp);
457  pp.query("if_surf_heating_rate", if_surf_heating_rate);
458  pp.query("if_Olen", if_Olen_in);
459  pp.query("if_use_most",if_use_most);
460 
461  if ((if_init_surf_temp > 0.0 && if_surf_temp_flux != 1e-8) ||
462  (if_init_surf_temp > 0.0 && if_Olen_in != 1e-8) ||
463  (if_Olen_in != 1e-8 && if_surf_temp_flux != 1e-8))
464  {
465  amrex::Abort("Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
466  }
467 
468  // Flag to do MOST rotations with terrain
469  pp.query("use_rotate_surface_flux",use_rotate_surface_flux);
471  AMREX_ASSERT_WITH_MESSAGE(terrain_type != TerrainType::None,"MOST stress rotations are only valid with terrain!");
472  }
473 
474  // Which external forcings?
475  abl_driver_type = ABLDriverType::None; // Default: no ABL driver for simulating classical fluid dynamics problems
476  pp.query_enum_case_insensitive("abl_driver_type",abl_driver_type);
477  pp.query("const_massflux_u", const_massflux_u);
478  pp.query("const_massflux_v", const_massflux_v);
479  pp.query("const_massflux_tau", const_massflux_tau);
480  pp.query("const_massflux_layer_lo", const_massflux_layer_lo);
481  pp.query("const_massflux_layer_hi", const_massflux_layer_hi);
482 
483  // Which type of inflow turbulent generation
484  pert_type = PerturbationType::None; // Default
485  pp.query_enum_case_insensitive("perturbation_type",pert_type);
486 
487  amrex::Vector<amrex::Real> abl_pressure_grad_in = {0.0, 0.0, 0.0};
488  pp.queryarr("abl_pressure_grad",abl_pressure_grad_in);
489  for(int i = 0; i < AMREX_SPACEDIM; ++i) abl_pressure_grad[i] = abl_pressure_grad_in[i];
490 
491  amrex::Vector<amrex::Real> abl_geo_forcing_in = {0.0, 0.0, 0.0};
492  if(pp.queryarr("abl_geo_forcing",abl_geo_forcing_in)) {
493  amrex::Print() << "Specified abl_geo_forcing: (";
494  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
495  abl_geo_forcing[i] = abl_geo_forcing_in[i];
496  amrex::Print() << abl_geo_forcing[i] << " ";
497  }
498  amrex::Print() << ")" << std::endl;
499  }
500 
501  if (use_coriolis)
502  {
504  }
505 
506  pp.query("add_custom_rhotheta_forcing", custom_rhotheta_forcing);
507  pp.query("add_custom_moisture_forcing", custom_moisture_forcing);
508  pp.query("add_custom_w_subsidence", custom_w_subsidence);
509  pp.query("add_custom_geostrophic_profile", custom_geostrophic_profile);
510  pp.query("custom_forcing_uses_primitive_vars", custom_forcing_prim_vars);
511 
512  pp.query("nudging_from_input_sounding", nudging_from_input_sounding);
513 
515  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(!(!abl_geo_wind_table.empty() && custom_geostrophic_profile),
516  "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
517 
518  pp.query("Ave_Plane", ave_plane);
519 
520  pp.query("use_moist_background", use_moist_background);
521 
522  // Use numerical diffusion?
523  pp.query("num_diff_coeff",num_diff_coeff);
524  AMREX_ASSERT_WITH_MESSAGE(( (num_diff_coeff >= 0.) && (num_diff_coeff <= 1.) ),
525  "Numerical diffusion coefficient must be between 0 & 1.");
527  if (use_num_diff) {
528  amrex::Print() << "6th-order numerical diffusion turned on with coefficient = "
529  << num_diff_coeff << std::endl;
530  num_diff_coeff *= std::pow(2.0,-6);
531  }
532 
533  advChoice.init_params(pp_prefix);
534  diffChoice.init_params(pp_prefix);
535  spongeChoice.init_params(pp_prefix);
536 
537  turbChoice.resize(max_level+1);
538  for (int lev = 0; lev <= max_level; lev++) {
539  turbChoice[lev].init_params(lev,max_level,pp_prefix);
540  }
541 
542  // YSU PBL: use consistent coriolis frequency
543  for (int lev = 0; lev <= max_level; lev++) {
544  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
545  if (use_coriolis) {
546  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
547  if (lev == 0) {
548  amrex::Print() << "YSU PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
549  }
550  } else {
551  amrex::Abort("YSU cannot use ERF coriolis frequency if not using coriolis");
552  }
553  }
554  }
555  // MRF
556  for (int lev = 0; lev <= max_level; lev++) {
557  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
558  if (use_coriolis) {
559  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
560  if (lev == 0) {
561  amrex::Print() << "MRF PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
562  }
563  } else {
564  amrex::Abort("MRF cannot use ERF coriolis frequency if not using coriolis");
565  }
566  }
567  }
568 
569  // Are we using SHOC? (test on compilation done in turb struct)
570  if (turbChoice[0].pbl_type == PBLType::SHOC) { use_shoc = true; }
571 
572  // Which type of multilevel coupling
573  coupling_type = CouplingType::TwoWay; // Default
574  pp.query_enum_case_insensitive("coupling_type",coupling_type);
575 
576  // Which type of windfarm model
577  windfarm_type = WindFarmType::None; // Default
578  pp.query_enum_case_insensitive("windfarm_type",windfarm_type);
579 
580  static std::string windfarm_loc_type_string = "None";
581  windfarm_loc_type = WindFarmLocType::None;
582  pp.query_enum_case_insensitive("windfarm_loc_type",windfarm_loc_type);
583 
584  pp.query("windfarm_loc_table", windfarm_loc_table);
585  pp.query("windfarm_spec_table", windfarm_spec_table);
586  pp.query("windfarm_blade_table", windfarm_blade_table);
587  pp.query("windfarm_airfoil_tables", windfarm_airfoil_tables);
588  pp.query("windfarm_spec_table_extra", windfarm_spec_table_extra);
589 
590  // Sampling distance upstream of the turbine to find the
591  // incoming free stream velocity as a factor of the diameter of the
592  // turbine. ie. the sampling distance will be this number multiplied
593  // by the diameter of the turbine
594  pp.query("sampling_distance_by_D", sampling_distance_by_D);
595  pp.query("turb_disk_angle_from_x", turb_disk_angle);
596 
597  pp.query("windfarm_x_shift",windfarm_x_shift);
598  pp.query("windfarm_y_shift",windfarm_y_shift);
599  // Test if time averaged data is to be output
600  pp.query("time_avg_vel",time_avg_vel);
601 
602  pp.query("hindcast_lateral_forcing", hindcast_lateral_forcing);
603 
605  pp.query("hindcast_boundary_data_dir", hindcast_boundary_data_dir);
606 
607  if(hindcast_boundary_data_dir.empty()) {
608  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
609  }
610  pp.query("hindcast_data_interval_in_hrs", hindcast_data_interval_in_hrs);
612  amrex::Abort("ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
613  "data files is either missing or set to less than zero");
614  }
615  pp.query("hindcast_lateral_sponge_strength", hindcast_lateral_sponge_strength);
616  pp.query("hindcast_lateral_sponge_length", hindcast_lateral_sponge_length);
617 
618  pp.query("hindcast_zhi_sponge_length", hindcast_zhi_sponge_length);
619  pp.query("hindcast_zhi_sponge_strength", hindcast_zhi_sponge_strength);
620 
621  pp.query("hindcast_zhi_sponge_damping", hindcast_zhi_sponge_damping);
622 
624  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
625  }
626 
628  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
629  }
630 
632  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
633  }
634 
636  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
637  }
638  }
639 
640  pp.query("io_hurricane_eye_tracker", io_hurricane_eye_tracker);
642  pp.query("hurricane_eye_latitude", hurricane_eye_latitude);
643  pp.query("hurricane_eye_longitude", hurricane_eye_longitude);
644  if(hurricane_eye_latitude == -1e10 or hurricane_eye_longitude == -1e10) {
645  amrex::Abort("ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
646  " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
647  " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
648  " location of the eye in the initial condition");
649  }
650  }
651 
652  check_params(max_level);
653  }
654 
655  void check_params (int /*max_level*/)
656  {
657 #if 0
658  // Warn for PBL models and moisture - these may not yet be compatible
659  for (int lev = 0; lev <= max_level; lev++) {
660  if ((moisture_type != MoistureType::None) && (turbChoice[lev].pbl_type != PBLType::None)) {
661  amrex::Warning("\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
662  }
663  }
664 #endif
665  //
666  // Buoyancy type check
667  //
668  if (buoyancy_type != 1 && buoyancy_type != 2 && buoyancy_type != 3 && buoyancy_type != 4) {
669  amrex::Abort("buoyancy_type must be 1, 2, 3 or 4");
670  }
671 
672  if (!use_lagged_delta_rt && !(terrain_type == TerrainType::MovingFittedMesh)) {
673  amrex::Error("Can't turn off lagged_delta_rt when terrain not moving");
674  }
675 
676  //
677  // Wind farm checks
678  //
679  if (windfarm_type==WindFarmType::SimpleAD and sampling_distance_by_D < 0.0) {
680  amrex::Abort("To use simplified actuator disks, you need to provide a variable"
681  " erf.sampling_distance_by_D in the inputs which specifies the upstream"
682  " distance as a factor of the turbine diameter at which the incoming free stream"
683  " velocity will be computed at.");
684  }
685  if ( (windfarm_type==WindFarmType::SimpleAD ||
686  windfarm_type==WindFarmType::GeneralAD ) && turb_disk_angle < 0.0) {
687  amrex::Abort("To use simplified actuator disks, you need to provide a variable"
688  " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
689  " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
690  " will have turb_disk_angle value of 90 deg.");
691  }
692  if (windfarm_loc_type == WindFarmLocType::lat_lon and (windfarm_x_shift < 0.0 or windfarm_y_shift < 0.0)) {
693  amrex::Abort("You are using windfarms with latitude-logitude option to position the turbines."
694  " For this you should provide the inputs erf.windfarm_x_shift and"
695  " erf.windfarm_y_shift which are the values by which the bounding box of the"
696  " windfarm is shifted from the x and the y axes.");
697  }
698  }
699 
700  void display (int max_level, std::string pp_prefix)
701  {
702  amrex::Print() << "SOLVER CHOICE: " << std::endl;
703  for (int lev = 0; lev <= max_level; lev++) {
704  if (anelastic[lev]) {
705  amrex::Print() << "Level " << lev << " is anelastic" << std::endl;
706  }
707  if (substepping_type[lev] == SubsteppingType::None) {
708  amrex::Print() << "No substepping at level " << lev << std::endl;
709  } else if (substepping_type[lev] == SubsteppingType::Explicit) {
710  amrex::Print() << "Explicit substepping at level " << lev << std::endl;
711  } else if (substepping_type[lev] == SubsteppingType::Implicit) {
712  amrex::Print() << "Implicit substepping at level " << lev << std::endl;
713  }
714  }
715  amrex::Print() << "vert_implicit_fac : " << vert_implicit_fac[0] << " "
716  << vert_implicit_fac[1] << " "
717  << vert_implicit_fac[2] << std::endl;
718  amrex::Print() << "fixed_density : " << fixed_density << std::endl;
719  amrex::Print() << "use_coriolis : " << use_coriolis << std::endl;
720  amrex::Print() << "use_gravity : " << use_gravity << std::endl;
721 
722  amrex::Print() << "Rayleigh damping :";
724  if (rayleigh_damp_U) amrex::Print() << " U";
725  if (rayleigh_damp_V) amrex::Print() << " V";
726  if (rayleigh_damp_W) amrex::Print() << " W";
727  if (rayleigh_damp_T) amrex::Print() << " T";
728  amrex::Print() << " (coef=" << rayleigh_dampcoef << " 1/s,"
729  << " depth=" << rayleigh_zdamp << " m)"
730  << std::endl;
731  } else {
732  amrex::Print() << " None" << std::endl;
733  }
734  amrex::Print() << "w damping : " << w_damping << std::endl;
735 
736  if (moisture_type == MoistureType::SAM) {
737  amrex::Print() << "Moisture Model: SAM" << std::endl;
738  } else if (moisture_type == MoistureType::SAM_NoIce) {
739  amrex::Print() << "Moisture Model: SAM No Ice" << std::endl;
740  } else if (moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
741  amrex::Print() << "Moisture Model: SAM No Precip No Ice" << std::endl;
742  } else if (moisture_type == MoistureType::Morrison) {
743  amrex::Print() << "Moisture Model: Morrison" << std::endl;
744  } else if (moisture_type == MoistureType::Morrison_NoIce) {
745  amrex::Print() << "Moisture Model: Morrison_NoIce" << std::endl;
746  } else if (moisture_type == MoistureType::Kessler) {
747  amrex::Print() << "Moisture Model: Kessler" << std::endl;
748  } else if (moisture_type == MoistureType::Kessler_NoRain) {
749  amrex::Print() << "Moisture Model: Kessler No Rain" << std::endl;
750  } else if (moisture_type == MoistureType::SatAdj) {
751  amrex::Print() << "Moisture Model: Saturation Adjustment" << std::endl;
752  } else {
753  amrex::Print() << "Moisture Model: None" << std::endl;
754  }
755 
756  if (terrain_type == TerrainType::StaticFittedMesh) {
757  amrex::Print() << "Terrain Type: StaticFittedMesh" << std::endl;
758  } else if (terrain_type == TerrainType::MovingFittedMesh) {
759  amrex::Print() << "Terrain Type: MovingFittedMesh" << std::endl;
760  } else if (terrain_type == TerrainType::EB) {
761  amrex::Print() << "Terrain Type: EB" << std::endl;
762  } else if (terrain_type == TerrainType::ImmersedForcing) {
763  amrex::Print() << "Terrain Type: ImmersedForcing" << std::endl;
764  } else {
765  amrex::Print() << "Terrain Type: None" << std::endl;
766  }
767 
768  if (mesh_type == MeshType::ConstantDz) {
769  amrex::Print() << " Mesh Type: ConstantDz" << std::endl;
770  } else if (mesh_type == MeshType::StretchedDz) {
771  amrex::Print() << " Mesh Type: StretchedDz" << std::endl;
772  } else if (mesh_type == MeshType::VariableDz) {
773  amrex::Print() << " Mesh Type: VariableDz" << std::endl;
774  } else {
775  amrex::Abort("No mesh_type set!");
776  }
777 
778  amrex::Print() << "ABL Driver Type: " << std::endl;
779  if (abl_driver_type == ABLDriverType::None) {
780  amrex::Print() << " None" << std::endl;
781  } else if (abl_driver_type == ABLDriverType::PressureGradient) {
782  amrex::Print() << " Pressure Gradient "
783  << amrex::RealVect(abl_pressure_grad[0],abl_pressure_grad[1],abl_pressure_grad[2])
784  << std::endl;
785  } else if (abl_driver_type == ABLDriverType::GeostrophicWind) {
786  amrex::Print() << " Geostrophic Wind "
787  << amrex::RealVect(abl_geo_forcing[0],abl_geo_forcing[1],abl_geo_forcing[2])
788  << std::endl;
789  }
790 
791  if (max_level > 0) {
792  amrex::Print() << "Coupling Type: " << std::endl;
793  if (coupling_type == CouplingType::TwoWay) {
794  amrex::Print() << " Two-way" << std::endl;
795  } else if (coupling_type == CouplingType::OneWay) {
796  amrex::Print() << " One-way" << std::endl;
797  }
798  }
799 
800  if (rad_type == RadiationType::RRTMGP) {
801  amrex::Print() << "Radiation Model: RRTMGP" << std::endl;
802  } else {
803  amrex::Print() << "Radiation Model: None" << std::endl;
804  }
805 
806  amrex::Print() << "Gradp_type : " << gradp_type << std::endl;
807 
808  amrex::Print() << "Buoyancy_type : " << buoyancy_type << std::endl;
809 
810  advChoice.display(pp_prefix);
813 
814  for (int lev = 0; lev <= max_level; lev++) {
815  turbChoice[lev].display(lev);
816  }
817  }
818 
819  void build_coriolis_forcings_const_lat (std::string pp_prefix)
820  {
821  amrex::ParmParse pp(pp_prefix);
822 
823  // Read the rotational time period (in seconds)
824  amrex::Real rot_time_period = 86400.0;
825  pp.query("rotational_time_period", rot_time_period);
826 
827  coriolis_factor = 2.0 * 2.0 * PI / rot_time_period;
828 
829  amrex::Real latitude = 90.0;
830  pp.query("latitude", latitude);
831 
832  pp.query("coriolis_3d", coriolis_3d);
833 
834  // Convert to radians
835  latitude *= (PI/180.);
836  sinphi = std::sin(latitude);
837  if (coriolis_3d) {
838  cosphi = std::cos(latitude);
839  }
840 
841  amrex::Print() << "Coriolis frequency, f = " << coriolis_factor * sinphi << " 1/s" << std::endl;
842 
843  if (abl_driver_type == ABLDriverType::GeostrophicWind) {
844  // Read in the geostrophic wind -- we only use this to construct
845  // the forcing term so no need to keep it
846  amrex::Vector<amrex::Real> abl_geo_wind(3);
847  pp.queryarr("abl_geo_wind",abl_geo_wind);
848 
849  if(!pp.query("abl_geo_wind_table",abl_geo_wind_table)) {
850  abl_geo_forcing = {
851  -coriolis_factor * (abl_geo_wind[1]*sinphi - abl_geo_wind[2]*cosphi),
852  coriolis_factor * abl_geo_wind[0]*sinphi,
853  -coriolis_factor * abl_geo_wind[0]*cosphi
854  };
855  } else {
856  amrex::Print() << "NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
857  }
858  }
859  }
860 
861  void read_int_string (int max_level, const char* string_to_read,
862  amrex::Vector<int>& vec_to_fill, int default_int)
863  {
864  amrex::ParmParse pp("erf");
865  int nvals = pp.countval(string_to_read);
866  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
867  amrex::Vector<int> temp; temp.resize(nvals);
868  pp.queryarr(string_to_read,temp);
869  if (nvals == 0) {
870  for (int i = 0; i <= max_level; ++i) vec_to_fill.push_back(default_int);
871  } else if (nvals == 1) {
872  for (int i = 0; i <= max_level; ++i) vec_to_fill.push_back(temp[0]);
873  } else {
874  for (int i = 0; i <= max_level; ++i) vec_to_fill.push_back(temp[i]);
875  }
876  }
877 
878  inline static
879  InitType init_type = InitType::None;
880 
881  inline static
882  SoundingType sounding_type = SoundingType::Ideal;
883 
884  inline static
885  TerrainType terrain_type = TerrainType::None;
886 
887  inline static
888  bool use_real_bcs = false;
889 
890  inline static
891  bool upwind_real_bcs = false;
892 
893  inline static
894  MeshType mesh_type = MeshType::ConstantDz;
895 
896  static
897  void set_mesh_type (MeshType new_mesh_type)
898  {
899  mesh_type = new_mesh_type;
900  }
901 
905  amrex::Vector<TurbChoice> turbChoice;
906 
908 
909  amrex::Vector<SubsteppingType> substepping_type;
910  amrex::Vector<int> anelastic;
911 
912  // time off-centering coefficient, > 0 for forward weighting (i.e., bias
913  // towards the future time step)
915 
916  // This controls the time-centering of the *vertical* differences in the diffusive term for (rho theta) only
917  // 0: fully explicit
918  // 1: fully implicit
919  amrex::Vector<amrex::Real> vert_implicit_fac = {0.0, 0.0, 0.0}; // one value per RK stage
920 
922 
923  bool fixed_density = false;
924  int ncorr = 1;
927 
928  bool test_mapfactor = false;
929 
930  int gradp_type = 0;
931 
932  int buoyancy_type = 1; // uses rhoprime directly
933 
934  // Specify what additional physics/forcing modules we use
935  bool use_gravity = false;
936  bool use_coriolis = false;
937  bool coriolis_3d = true;
938 
939  bool rayleigh_damp_U = false;
940  bool rayleigh_damp_V = false;
941  bool rayleigh_damp_W = false;
942  bool rayleigh_damp_T = false;
943  amrex::Real rayleigh_dampcoef = 0.2; // inverse time scale [1/s]
944  amrex::Real rayleigh_zdamp = 500.0; // damping layer depth [m]
946  bool rayleigh_damp_substep = false; // use Rayleigh on substep only?
947 
948  bool w_damping = false;
950  amrex::Real w_damping_coeff = 0.3; // damping coefficient [m/s]
951 
952  bool four_stream_radiation = false;
953 
954  // Specify whether to apply other various source terms on substep only
956  bool forest_substep = false;
957 
958  // immersed forcing parameters
961  // immersed forcing MOST parameters.
962  amrex::Real if_z0 = 0.1; // [m]
963  amrex::Real if_surf_temp_flux = 1e-8; // [K m/s]
966  amrex::Real if_Olen_in = 1e-8; // [m]
967  bool if_use_most = false;
968 
969  // This defaults to true but can be set to false for moving terrain cases only
970  bool use_lagged_delta_rt = true;
971 
972  // Constants
974  amrex::Real c_p = Cp_d; // specific heat at constant pressure for dry air [J/(kg-K)]
976 
977  // Staggered z levels for vertical grid stretching
981 
983 
984  // Coriolis forcing
988 
989  // User-specified forcings in problem definition
992  bool custom_w_subsidence = false;
995 
996  // Do we use source terms to nudge the solution towards
997  // the time-varying data provided in input sounding files?
999 
1000  // MOST stress rotations
1002 
1003  // Should we use SHOC?
1004  bool use_shoc = false;
1005 
1006  // User wishes to output time averaged velocity fields
1007  bool time_avg_vel = false;
1008 
1009  // Type of perturbation
1010  PerturbationType pert_type;
1011 
1012  // Numerical diffusion
1013  bool use_num_diff{false};
1015 
1016  // Rebalance wrfinput
1017  bool rebalance_wrfinput{false};
1018 
1019  CouplingType coupling_type;
1020  MoistureType moisture_type;
1021  WindFarmType windfarm_type;
1022  WindFarmLocType windfarm_loc_type;
1023  LandSurfaceType lsm_type;
1024  RadiationType rad_type;
1025 
1026  ABLDriverType abl_driver_type;
1027  amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> abl_pressure_grad;
1028  amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> abl_geo_forcing;
1029  std::string abl_geo_wind_table;
1031 
1032  bool has_lat_lon{false};
1033  bool variable_coriolis{false};
1034 
1035  int ave_plane {2};
1036 
1037  // Microphysics params
1038  bool use_moist_background {false};
1040 
1042 
1049 
1050  // Use forest canopy model?
1051  bool do_forest_drag {false};
1052 
1053  // Enforce constant mass flux?
1059  int massflux_klo {0}; // these are updated in ERF.cpp
1060  int massflux_khi {0};
1061 
1068 
1071 };
1072 #endif
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:12
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:21
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
TauType
Definition: ERF_DataStruct.H:29
@ tau12
Definition: ERF_DataStruct.H:30
@ tau23
Definition: ERF_DataStruct.H:30
@ tau33
Definition: ERF_DataStruct.H:30
@ tau22
Definition: ERF_DataStruct.H:30
@ tau11
Definition: ERF_DataStruct.H:30
@ tau32
Definition: ERF_DataStruct.H:30
@ tau31
Definition: ERF_DataStruct.H:30
@ tau21
Definition: ERF_DataStruct.H:30
@ tau13
Definition: ERF_DataStruct.H:30
Rayleigh
Definition: ERF_DataStruct.H:90
@ ubar
Definition: ERF_DataStruct.H:91
@ wbar
Definition: ERF_DataStruct.H:91
@ nvars
Definition: ERF_DataStruct.H:91
@ vbar
Definition: ERF_DataStruct.H:91
@ thetabar
Definition: ERF_DataStruct.H:91
Sponge
Definition: ERF_DataStruct.H:95
@ nvars_sponge
Definition: ERF_DataStruct.H:96
@ vbar_sponge
Definition: ERF_DataStruct.H:96
@ ubar_sponge
Definition: ERF_DataStruct.H:96
MapFacType
Definition: ERF_DataStruct.H:20
@ v_x
Definition: ERF_DataStruct.H:22
@ num
Definition: ERF_DataStruct.H:22
@ u_y
Definition: ERF_DataStruct.H:23
@ v_y
Definition: ERF_DataStruct.H:23
@ m_y
Definition: ERF_DataStruct.H:23
@ u_x
Definition: ERF_DataStruct.H:22
@ m_x
Definition: ERF_DataStruct.H:22
Coord
Definition: ERF_DataStruct.H:85
AMREX_ENUM(InitType, None, Input_Sounding, NCFile, WRFInput, Metgrid, Uniform, HindCast)
#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 RhoQ1_comp
Definition: ERF_IndexDefines.H:42
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:47
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:233
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_EWP.H:9
Definition: ERF_Fitch.H:9
Definition: ERF_GeneralAD.H:8
Definition: ERF_Kessler.H:38
Definition: ERF_MM5.H:26
Definition: ERF_Morrison.H:58
Definition: ERF_NOAHMP.H:49
Definition: ERF_SAM.H:53
Definition: ERF_SLM.H:26
Definition: ERF_SatAdj.H:41
Definition: ERF_SimpleAD.H:8
@ bogus
Definition: ERF_IndexDefines.H:204
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_DiffStruct.H:19
void init_params(std::string pp_prefix)
Definition: ERF_DiffStruct.H:21
void display()
Definition: ERF_DiffStruct.H:67
Definition: ERF_DataStruct.H:99
int qs
Definition: ERF_DataStruct.H:104
int qr
Definition: ERF_DataStruct.H:103
MoistureComponentIndices()=default
int qi
Definition: ERF_DataStruct.H:102
int qv
Definition: ERF_DataStruct.H:100
int qc
Definition: ERF_DataStruct.H:101
int qg
Definition: ERF_DataStruct.H:105
MoistureComponentIndices(int qv_comp, int qc_comp, int qi_comp=-1, int qr_comp=-1, int qs_comp=-1, int qg_comp=-1)
Definition: ERF_DataStruct.H:108
Definition: ERF_DataStruct.H:123
amrex::Real w_damping_cfl
Definition: ERF_DataStruct.H:949
amrex::Real hurricane_eye_latitude
Definition: ERF_DataStruct.H:1070
bool rayleigh_damp_T
Definition: ERF_DataStruct.H:942
amrex::Real if_init_surf_temp
Definition: ERF_DataStruct.H:964
amrex::Real dz0
Definition: ERF_DataStruct.H:980
amrex::Real const_massflux_layer_lo
Definition: ERF_DataStruct.H:1057
bool use_lagged_delta_rt
Definition: ERF_DataStruct.H:970
amrex::Real coriolis_factor
Definition: ERF_DataStruct.H:985
static MeshType mesh_type
Definition: ERF_DataStruct.H:894
amrex::Real if_surf_temp_flux
Definition: ERF_DataStruct.H:963
amrex::Real windfarm_x_shift
Definition: ERF_DataStruct.H:1047
bool rayleigh_damp_V
Definition: ERF_DataStruct.H:940
void display(int max_level, std::string pp_prefix)
Definition: ERF_DataStruct.H:700
bool rebalance_wrfinput
Definition: ERF_DataStruct.H:1017
amrex::Real hindcast_lateral_sponge_strength
Definition: ERF_DataStruct.H:1065
amrex::Real poisson_reltol
Definition: ERF_DataStruct.H:926
bool rayleigh_damp_substep
Definition: ERF_DataStruct.H:946
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Definition: ERF_DataStruct.H:819
amrex::Real rayleigh_zdamp
Definition: ERF_DataStruct.H:944
bool if_use_most
Definition: ERF_DataStruct.H:967
amrex::Real rdOcp
Definition: ERF_DataStruct.H:975
RadiationType rad_type
Definition: ERF_DataStruct.H:1024
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:861
std::string windfarm_spec_table
Definition: ERF_DataStruct.H:1043
amrex::Real hindcast_zhi_sponge_length
Definition: ERF_DataStruct.H:1066
DiffChoice diffChoice
Definition: ERF_DataStruct.H:903
amrex::Real const_massflux_v
Definition: ERF_DataStruct.H:1055
amrex::Real if_z0
Definition: ERF_DataStruct.H:962
bool use_gravity
Definition: ERF_DataStruct.H:935
int ncorr
Definition: ERF_DataStruct.H:924
int force_stage1_single_substep
Definition: ERF_DataStruct.H:907
bool hindcast_zhi_sponge_damping
Definition: ERF_DataStruct.H:1067
std::string windfarm_spec_table_extra
Definition: ERF_DataStruct.H:1043
amrex::Real cosphi
Definition: ERF_DataStruct.H:986
LandSurfaceType lsm_type
Definition: ERF_DataStruct.H:1023
amrex::Real c_p
Definition: ERF_DataStruct.H:974
std::string windfarm_loc_table
Definition: ERF_DataStruct.H:1043
void check_params(int)
Definition: ERF_DataStruct.H:655
amrex::Real gravity
Definition: ERF_DataStruct.H:973
amrex::Real beta_s
Definition: ERF_DataStruct.H:914
bool custom_rhotheta_forcing
Definition: ERF_DataStruct.H:990
amrex::Real hindcast_lateral_sponge_length
Definition: ERF_DataStruct.H:1065
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Definition: ERF_DataStruct.H:1028
bool use_shoc
Definition: ERF_DataStruct.H:1004
WindFarmLocType windfarm_loc_type
Definition: ERF_DataStruct.H:1022
bool hindcast_lateral_forcing
Definition: ERF_DataStruct.H:1064
int massflux_klo
Definition: ERF_DataStruct.H:1059
bool moisture_tight_coupling
Definition: ERF_DataStruct.H:1041
bool custom_w_subsidence
Definition: ERF_DataStruct.H:992
bool nudging_from_input_sounding
Definition: ERF_DataStruct.H:998
bool rayleigh_damp_U
Definition: ERF_DataStruct.H:939
bool custom_geostrophic_profile
Definition: ERF_DataStruct.H:993
amrex::Real if_Cd_scalar
Definition: ERF_DataStruct.H:959
bool w_damping
Definition: ERF_DataStruct.H:948
amrex::Real rayleigh_ztop
Definition: ERF_DataStruct.H:945
bool immersed_forcing_substep
Definition: ERF_DataStruct.H:955
amrex::Real grid_stretching_ratio
Definition: ERF_DataStruct.H:978
amrex::Real sinphi
Definition: ERF_DataStruct.H:987
bool have_geo_wind_profile
Definition: ERF_DataStruct.H:1030
amrex::Vector< amrex::Real > vert_implicit_fac
Definition: ERF_DataStruct.H:919
amrex::Real hurricane_eye_longitude
Definition: ERF_DataStruct.H:1070
amrex::Real const_massflux_u
Definition: ERF_DataStruct.H:1054
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Definition: ERF_DataStruct.H:1027
void init_params(int max_level, std::string pp_prefix)
Definition: ERF_DataStruct.H:125
bool io_hurricane_eye_tracker
Definition: ERF_DataStruct.H:1069
amrex::Vector< SubsteppingType > substepping_type
Definition: ERF_DataStruct.H:909
bool coriolis_3d
Definition: ERF_DataStruct.H:937
amrex::Real if_Olen_in
Definition: ERF_DataStruct.H:966
amrex::Real w_damping_coeff
Definition: ERF_DataStruct.H:950
bool use_num_diff
Definition: ERF_DataStruct.H:1013
amrex::Real sampling_distance_by_D
Definition: ERF_DataStruct.H:1045
amrex::Real hindcast_zhi_sponge_strength
Definition: ERF_DataStruct.H:1066
bool test_mapfactor
Definition: ERF_DataStruct.H:928
bool use_coriolis
Definition: ERF_DataStruct.H:936
static SoundingType sounding_type
Definition: ERF_DataStruct.H:882
bool four_stream_radiation
Definition: ERF_DataStruct.H:952
bool custom_moisture_forcing
Definition: ERF_DataStruct.H:991
amrex::Real num_diff_coeff
Definition: ERF_DataStruct.H:1014
std::string windfarm_blade_table
Definition: ERF_DataStruct.H:1044
bool fixed_density
Definition: ERF_DataStruct.H:923
amrex::Real zsurf
Definition: ERF_DataStruct.H:979
amrex::Real if_surf_heating_rate
Definition: ERF_DataStruct.H:965
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:905
bool variable_coriolis
Definition: ERF_DataStruct.H:1033
bool project_initial_velocity
Definition: ERF_DataStruct.H:982
amrex::Vector< int > anelastic
Definition: ERF_DataStruct.H:910
amrex::Real if_Cd_momentum
Definition: ERF_DataStruct.H:960
static bool upwind_real_bcs
Definition: ERF_DataStruct.H:891
AdvChoice advChoice
Definition: ERF_DataStruct.H:902
bool use_moist_background
Definition: ERF_DataStruct.H:1038
MoistureType moisture_type
Definition: ERF_DataStruct.H:1020
bool custom_forcing_prim_vars
Definition: ERF_DataStruct.H:994
std::string abl_geo_wind_table
Definition: ERF_DataStruct.H:1029
static TerrainType terrain_type
Definition: ERF_DataStruct.H:885
amrex::Real hindcast_data_interval_in_hrs
Definition: ERF_DataStruct.H:1063
ABLDriverType abl_driver_type
Definition: ERF_DataStruct.H:1026
bool rayleigh_damp_W
Definition: ERF_DataStruct.H:941
PerturbationType pert_type
Definition: ERF_DataStruct.H:1010
SpongeChoice spongeChoice
Definition: ERF_DataStruct.H:904
WindFarmType windfarm_type
Definition: ERF_DataStruct.H:1021
static InitType init_type
Definition: ERF_DataStruct.H:879
amrex::Real const_massflux_layer_hi
Definition: ERF_DataStruct.H:1058
bool implicit_before_substep
Definition: ERF_DataStruct.H:921
static bool use_real_bcs
Definition: ERF_DataStruct.H:888
int buoyancy_type
Definition: ERF_DataStruct.H:932
amrex::Real poisson_abstol
Definition: ERF_DataStruct.H:925
MoistureComponentIndices moisture_indices
Definition: ERF_DataStruct.H:1039
amrex::Real turb_disk_angle
Definition: ERF_DataStruct.H:1046
amrex::Real windfarm_y_shift
Definition: ERF_DataStruct.H:1048
bool has_lat_lon
Definition: ERF_DataStruct.H:1032
bool use_rotate_surface_flux
Definition: ERF_DataStruct.H:1001
bool do_forest_drag
Definition: ERF_DataStruct.H:1051
amrex::Real const_massflux_tau
Definition: ERF_DataStruct.H:1056
int massflux_khi
Definition: ERF_DataStruct.H:1060
bool time_avg_vel
Definition: ERF_DataStruct.H:1007
bool forest_substep
Definition: ERF_DataStruct.H:956
amrex::Real rayleigh_dampcoef
Definition: ERF_DataStruct.H:943
CouplingType coupling_type
Definition: ERF_DataStruct.H:1019
std::string windfarm_airfoil_tables
Definition: ERF_DataStruct.H:1044
int gradp_type
Definition: ERF_DataStruct.H:930
static void set_mesh_type(MeshType new_mesh_type)
Definition: ERF_DataStruct.H:897
int ave_plane
Definition: ERF_DataStruct.H:1035
std::string hindcast_boundary_data_dir
Definition: ERF_DataStruct.H:1062
Definition: ERF_SpongeStruct.H:15
void display()
Definition: ERF_SpongeStruct.H:45
void init_params(std::string pp_prefix)
Definition: ERF_SpongeStruct.H:17