ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
SolverChoice Struct Reference

#include <ERF_DataStruct.H>

Collaboration diagram for SolverChoice:

Public Member Functions

void init_params (int max_level, std::string pp_prefix)
 
void check_params (int max_level)
 
void display (int max_level, std::string pp_prefix)
 
void build_coriolis_forcings_const_lat (std::string pp_prefix)
 
void read_int_string (int max_level, const char *string_to_read, amrex::Vector< int > &vec_to_fill, int default_int)
 

Static Public Member Functions

static void set_mesh_type (MeshType new_mesh_type)
 

Public Attributes

AdvChoice advChoice
 
DiffChoice diffChoice
 
DampingChoice dampingChoice
 
SpongeChoice spongeChoice
 
amrex::Vector< TurbChoiceturbChoice
 
int force_stage1_single_substep = 1
 
amrex::Vector< SubsteppingType > substepping_type
 
amrex::Vector< int > anelastic
 
amrex::Vector< int > fixed_density
 
amrex::Vector< int > project_initial_velocity
 
amrex::Vector< int > buoyancy_type
 
bool substepping_diag = false
 
amrex::Real beta_s = 0.1
 
amrex::Vector< amrex::Realvert_implicit_fac = {0.0, 0.0, 0.0}
 
bool implicit_thermal_diffusion = true
 
bool implicit_momentum_diffusion = true
 
bool implicit_before_substep = true
 
int ncorr = 1
 
amrex::Real poisson_abstol = 1e-8
 
amrex::Real poisson_reltol = 1e-8
 
bool test_mapfactor = false
 
int gradp_type = 0
 
bool use_gravity = false
 
bool use_coriolis = false
 
bool coriolis_3d = true
 
bool four_stream_radiation = false
 
bool immersed_forcing_substep = false
 
bool forest_substep = false
 
amrex::Real if_Cd_scalar = 10.0
 
amrex::Real if_Cd_momentum = 10.0
 
amrex::Real if_z0 = 0.1
 
amrex::Real if_surf_temp_flux = 1e-8
 
amrex::Real if_init_surf_temp = 0.0
 
amrex::Real if_surf_heating_rate = 0.0
 
amrex::Real if_Olen_in = 1e-8
 
bool if_use_most = false
 
bool use_lagged_delta_rt = true
 
amrex::Real gravity
 
amrex::Real c_p = Cp_d
 
amrex::Real rdOcp
 
amrex::Real grid_stretching_ratio = 0
 
amrex::Real zsurf = 0.0
 
amrex::Real dz0
 
amrex::Real coriolis_factor = 0.0
 
amrex::Real cosphi = 0.0
 
amrex::Real sinphi = 0.0
 
bool custom_rhotheta_forcing = false
 
bool custom_moisture_forcing = false
 
bool custom_w_subsidence = false
 
bool custom_geostrophic_profile = false
 
bool custom_forcing_prim_vars = false
 
bool nudging_from_input_sounding = false
 
bool use_rotate_surface_flux = false
 
bool use_shoc = false
 
bool time_avg_vel = false
 
PerturbationType pert_type
 
bool use_num_diff {false}
 
amrex::Real num_diff_coeff {0.}
 
bool rebalance_wrfinput {false}
 
CouplingType coupling_type
 
MoistureType moisture_type
 
WindFarmType windfarm_type
 
WindFarmLocType windfarm_loc_type
 
LandSurfaceType lsm_type
 
RadiationType rad_type
 
ABLDriverType abl_driver_type
 
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
 
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
 
std::string abl_geo_wind_table
 
bool have_geo_wind_profile {false}
 
bool has_lat_lon {false}
 
bool variable_coriolis {false}
 
int ave_plane {2}
 
bool use_moist_background {false}
 
MoistureComponentIndices moisture_indices
 
bool moisture_tight_coupling {false}
 
std::string windfarm_loc_table
 
std::string windfarm_spec_table
 
std::string windfarm_spec_table_extra
 
std::string windfarm_blade_table
 
std::string windfarm_airfoil_tables
 
amrex::Real sampling_distance_by_D = -1.0
 
amrex::Real turb_disk_angle = -1.0
 
amrex::Real windfarm_x_shift = -1.0
 
amrex::Real windfarm_y_shift = -1.0
 
bool do_forest_drag {false}
 
amrex::Real const_massflux_u = 0.0
 
amrex::Real const_massflux_v = 0.0
 
amrex::Real const_massflux_tau = 1.0
 
amrex::Real const_massflux_layer_lo = -1e34
 
amrex::Real const_massflux_layer_hi = 1e34
 
int massflux_klo {0}
 
int massflux_khi {0}
 
std::string hindcast_boundary_data_dir
 
amrex::Real hindcast_data_interval_in_hrs = -1.0
 
bool hindcast_lateral_forcing = false
 
amrex::Real hindcast_lateral_sponge_strength = -1.0
 
amrex::Real hindcast_lateral_sponge_length = -1.0
 
amrex::Real hindcast_zhi_sponge_strength = -1.0
 
amrex::Real hindcast_zhi_sponge_length = -1.0
 
bool hindcast_zhi_sponge_damping = false
 
bool io_hurricane_eye_tracker = false
 
amrex::Real hurricane_eye_latitude = -1e10
 
amrex::Real hurricane_eye_longitude = -1e10
 
int file_name_digits = 5
 

Static Public Attributes

static InitType init_type = InitType::None
 
static SoundingType sounding_type = SoundingType::Ideal
 
static TerrainType terrain_type = TerrainType::None
 
static BuildingsType buildings_type = BuildingsType::None
 
static bool use_real_bcs = false
 
static bool upwind_real_bcs = false
 
static MeshType mesh_type = MeshType::ConstantDz
 

Detailed Description

Container holding many of the algorithmic options and parameters

Member Function Documentation

◆ build_coriolis_forcings_const_lat()

void SolverChoice::build_coriolis_forcings_const_lat ( std::string  pp_prefix)
inline
901  {
902  amrex::ParmParse pp(pp_prefix);
903 
904  // Read the rotational time period (in seconds)
905  amrex::Real rot_time_period = 86400.0;
906  pp.query("rotational_time_period", rot_time_period);
907 
908  coriolis_factor = 2.0 * 2.0 * PI / rot_time_period;
909 
910  amrex::Real latitude = 90.0;
911  pp.query("latitude", latitude);
912 
913  pp.query("coriolis_3d", coriolis_3d);
914 
915  // Convert to radians
916  latitude *= (PI/180.);
917  sinphi = std::sin(latitude);
918  if (coriolis_3d) {
919  cosphi = std::cos(latitude);
920  }
921 
922  amrex::Print() << "Coriolis frequency, f = " << coriolis_factor * sinphi << " 1/s" << std::endl;
923 
924  if (abl_driver_type == ABLDriverType::GeostrophicWind) {
925  // Read in the geostrophic wind -- we only use this to construct
926  // the forcing term so no need to keep it
927  amrex::Vector<amrex::Real> abl_geo_wind(3);
928  pp.queryarr("abl_geo_wind",abl_geo_wind);
929 
930  if(!pp.query("abl_geo_wind_table",abl_geo_wind_table)) {
931  abl_geo_forcing = {
932  -coriolis_factor * (abl_geo_wind[1]*sinphi - abl_geo_wind[2]*cosphi),
933  coriolis_factor * abl_geo_wind[0]*sinphi,
934  -coriolis_factor * abl_geo_wind[0]*cosphi
935  };
936  } else {
937  amrex::Print() << "NOTE: abl_geo_wind_table provided, ignoring input abl_geo_wind" << std::endl;
938  }
939  }
940  }
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
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
amrex::Real coriolis_factor
Definition: ERF_DataStruct.H:1066
amrex::Real cosphi
Definition: ERF_DataStruct.H:1067
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Definition: ERF_DataStruct.H:1109
amrex::Real sinphi
Definition: ERF_DataStruct.H:1068
bool coriolis_3d
Definition: ERF_DataStruct.H:1033
std::string abl_geo_wind_table
Definition: ERF_DataStruct.H:1110
ABLDriverType abl_driver_type
Definition: ERF_DataStruct.H:1107

Referenced by init_params().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_params()

void SolverChoice::check_params ( int  max_level)
inline
725  {
726 #if 0
727  // Warn for PBL models and moisture - these may not yet be compatible
728  for (int lev = 0; lev <= max_level; lev++) {
729  if ((moisture_type != MoistureType::None) && (turbChoice[lev].pbl_type != PBLType::None)) {
730  amrex::Warning("\n*** WARNING: Moisture may not yet be compatible with PBL models, \n proceed with caution ***");
731  }
732  }
733 #endif
734  //
735  // Buoyancy type check
736  //
737  for (int lev = 0; lev <= max_level; lev++) {
738  if (buoyancy_type[lev] != 1 && buoyancy_type[lev] != 2 && buoyancy_type[lev] != 3 && buoyancy_type[lev] != 4) {
739  amrex::Abort("buoyancy_type must be 1, 2, 3 or 4");
740  }
741  }
742 
743  if (!use_lagged_delta_rt && !(terrain_type == TerrainType::MovingFittedMesh)) {
744  amrex::Error("Can't turn off lagged_delta_rt when terrain not moving");
745  }
746 
747  //
748  // Wind farm checks
749  //
750  if (windfarm_type==WindFarmType::SimpleAD and sampling_distance_by_D < 0.0) {
751  amrex::Abort("To use simplified actuator disks, you need to provide a variable"
752  " erf.sampling_distance_by_D in the inputs which specifies the upstream"
753  " distance as a factor of the turbine diameter at which the incoming free stream"
754  " velocity will be computed at.");
755  }
756  if ( (windfarm_type==WindFarmType::SimpleAD ||
757  windfarm_type==WindFarmType::GeneralAD ) && turb_disk_angle < 0.0) {
758  amrex::Abort("To use simplified actuator disks, you need to provide a variable"
759  " erf.turb_disk_angle_from_x in the inputs which is the angle of the face of the"
760  " turbine disk from the x-axis. A turbine facing an oncoming flow in the x-direction"
761  " will have turb_disk_angle value of 90 deg.");
762  }
763  if (windfarm_loc_type == WindFarmLocType::lat_lon and (windfarm_x_shift < 0.0 or windfarm_y_shift < 0.0)) {
764  amrex::Abort("You are using windfarms with latitude-logitude option to position the turbines."
765  " For this you should provide the inputs erf.windfarm_x_shift and"
766  " erf.windfarm_y_shift which are the values by which the bounding box of the"
767  " windfarm is shifted from the x and the y axes.");
768  }
769  }
bool use_lagged_delta_rt
Definition: ERF_DataStruct.H:1053
amrex::Real windfarm_x_shift
Definition: ERF_DataStruct.H:1128
amrex::Vector< int > buoyancy_type
Definition: ERF_DataStruct.H:1003
WindFarmLocType windfarm_loc_type
Definition: ERF_DataStruct.H:1103
amrex::Real sampling_distance_by_D
Definition: ERF_DataStruct.H:1126
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:995
MoistureType moisture_type
Definition: ERF_DataStruct.H:1101
static TerrainType terrain_type
Definition: ERF_DataStruct.H:971
WindFarmType windfarm_type
Definition: ERF_DataStruct.H:1102
amrex::Real turb_disk_angle
Definition: ERF_DataStruct.H:1127
amrex::Real windfarm_y_shift
Definition: ERF_DataStruct.H:1129

Referenced by init_params().

Here is the caller graph for this function:

◆ display()

void SolverChoice::display ( int  max_level,
std::string  pp_prefix 
)
inline
772  {
773  amrex::Print() << "SOLVER CHOICE: " << std::endl;
774  for (int lev = 0; lev <= max_level; lev++) {
775  amrex::Print() << "At level " << lev << " : " << std::endl;
776  if (anelastic[lev]) {
777  amrex::Print() << " anelastic with no substepping" << std::endl;
778  } else {
779  if (substepping_type[lev] == SubsteppingType::None) {
780  amrex::Print() << " compressible with no substepping" << std::endl;
781  } else if (substepping_type[lev] == SubsteppingType::Implicit) {
782  amrex::Print() << " compressible with implicit substepping" << std::endl;
783  }
784  }
785  if (fixed_density[lev]) {
786  amrex::Print() << " and fixed density" << std::endl;
787  }
788  }
789 
790  amrex::Print() << "vert_implicit_fac : " << vert_implicit_fac[0] << " "
791  << vert_implicit_fac[1] << " "
792  << vert_implicit_fac[2];
793  if (vert_implicit_fac[0] > 0 ||
794  vert_implicit_fac[0] > 1 ||
795  vert_implicit_fac[0] > 2)
796  {
797  amrex::Print() << " (theta=" << implicit_thermal_diffusion
798  << ", momenta=" << implicit_momentum_diffusion;
799 #ifdef ERF_IMPLICIT_W
800  amrex::Print() << ", including w";
801 #endif
802  amrex::Print() << ")";
803  }
804  amrex::Print() << std::endl;
805  amrex::Print() << "use_coriolis : " << use_coriolis << std::endl;
806  amrex::Print() << "use_gravity : " << use_gravity << std::endl;
807 
808  if (moisture_type == MoistureType::SAM) {
809  amrex::Print() << "Moisture Model: SAM" << std::endl;
810  } else if (moisture_type == MoistureType::SAM_NoIce) {
811  amrex::Print() << "Moisture Model: SAM No Ice" << std::endl;
812  } else if (moisture_type == MoistureType::SAM_NoPrecip_NoIce) {
813  amrex::Print() << "Moisture Model: SAM No Precip No Ice" << std::endl;
814  } else if (moisture_type == MoistureType::Morrison) {
815  amrex::Print() << "Moisture Model: Morrison" << std::endl;
816  } else if (moisture_type == MoistureType::Morrison_NoIce) {
817  amrex::Print() << "Moisture Model: Morrison_NoIce" << std::endl;
818  } else if (moisture_type == MoistureType::Kessler) {
819  amrex::Print() << "Moisture Model: Kessler" << std::endl;
820  } else if (moisture_type == MoistureType::Kessler_NoRain) {
821  amrex::Print() << "Moisture Model: Kessler No Rain" << std::endl;
822  } else if (moisture_type == MoistureType::SatAdj) {
823  amrex::Print() << "Moisture Model: Saturation Adjustment" << std::endl;
824  } else {
825  amrex::Print() << "Moisture Model: None" << std::endl;
826  }
827 
828  if (terrain_type == TerrainType::StaticFittedMesh) {
829  amrex::Print() << "Terrain Type: StaticFittedMesh" << std::endl;
830  } else if (terrain_type == TerrainType::MovingFittedMesh) {
831  amrex::Print() << "Terrain Type: MovingFittedMesh" << std::endl;
832  } else if (terrain_type == TerrainType::EB) {
833  amrex::Print() << "Terrain Type: EB" << std::endl;
834  } else if (terrain_type == TerrainType::ImmersedForcing) {
835  amrex::Print() << "Terrain Type: ImmersedForcing" << std::endl;
836  } else {
837  amrex::Print() << "Terrain Type: None" << std::endl;
838  }
839 
840  if (buildings_type == BuildingsType::ImmersedForcing) {
841  amrex::Print() << "Buildings Type: ImmersedForcing" << std::endl;
842  } else {
843  amrex::Print() << "Buildings Type: None" << std::endl;
844  }
845 
846  if (mesh_type == MeshType::ConstantDz) {
847  amrex::Print() << " Mesh Type: ConstantDz" << std::endl;
848  } else if (mesh_type == MeshType::StretchedDz) {
849  amrex::Print() << " Mesh Type: StretchedDz" << std::endl;
850  } else if (mesh_type == MeshType::VariableDz) {
851  amrex::Print() << " Mesh Type: VariableDz" << std::endl;
852  } else {
853  amrex::Abort("No mesh_type set!");
854  }
855 
856  amrex::Print() << "ABL Driver Type: " << std::endl;
857  if (abl_driver_type == ABLDriverType::None) {
858  amrex::Print() << " None" << std::endl;
859  } else if (abl_driver_type == ABLDriverType::PressureGradient) {
860  amrex::Print() << " Pressure Gradient "
861  << amrex::RealVect(abl_pressure_grad[0],abl_pressure_grad[1],abl_pressure_grad[2])
862  << std::endl;
863  } else if (abl_driver_type == ABLDriverType::GeostrophicWind) {
864  amrex::Print() << " Geostrophic Wind "
865  << amrex::RealVect(abl_geo_forcing[0],abl_geo_forcing[1],abl_geo_forcing[2])
866  << std::endl;
867  }
868 
869  if (max_level > 0) {
870  amrex::Print() << "Coupling Type: " << std::endl;
871  if (coupling_type == CouplingType::TwoWay) {
872  amrex::Print() << " Two-way" << std::endl;
873  } else if (coupling_type == CouplingType::OneWay) {
874  amrex::Print() << " One-way" << std::endl;
875  }
876  }
877 
878  if (rad_type == RadiationType::RRTMGP) {
879  amrex::Print() << "Radiation Model: RRTMGP" << std::endl;
880  } else {
881  amrex::Print() << "Radiation Model: None" << std::endl;
882  }
883 
884  amrex::Print() << "Gradp_type : " << gradp_type << std::endl;
885 
886  for (int lev = 0; lev <= max_level; lev++) {
887  amrex::Print() << "Buoyancy_type at level " << lev << " : " << buoyancy_type[lev] << std::endl;
888  }
889 
890  advChoice.display(pp_prefix);
894 
895  for (int lev = 0; lev <= max_level; lev++) {
896  turbChoice[lev].display(lev);
897  }
898  }
void display(std::string &pp_prefix)
Definition: ERF_AdvStruct.H:235
void display()
Definition: ERF_DampingStruct.H:61
void display()
Definition: ERF_DiffStruct.H:67
static MeshType mesh_type
Definition: ERF_DataStruct.H:983
DampingChoice dampingChoice
Definition: ERF_DataStruct.H:993
RadiationType rad_type
Definition: ERF_DataStruct.H:1105
DiffChoice diffChoice
Definition: ERF_DataStruct.H:992
bool use_gravity
Definition: ERF_DataStruct.H:1031
amrex::Vector< amrex::Real > vert_implicit_fac
Definition: ERF_DataStruct.H:1016
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_pressure_grad
Definition: ERF_DataStruct.H:1108
amrex::Vector< SubsteppingType > substepping_type
Definition: ERF_DataStruct.H:999
bool implicit_thermal_diffusion
Definition: ERF_DataStruct.H:1018
bool use_coriolis
Definition: ERF_DataStruct.H:1032
amrex::Vector< int > anelastic
Definition: ERF_DataStruct.H:1000
AdvChoice advChoice
Definition: ERF_DataStruct.H:991
static BuildingsType buildings_type
Definition: ERF_DataStruct.H:974
amrex::Vector< int > fixed_density
Definition: ERF_DataStruct.H:1001
SpongeChoice spongeChoice
Definition: ERF_DataStruct.H:994
bool implicit_momentum_diffusion
Definition: ERF_DataStruct.H:1019
CouplingType coupling_type
Definition: ERF_DataStruct.H:1100
int gradp_type
Definition: ERF_DataStruct.H:1028
void display()
Definition: ERF_SpongeStruct.H:45
Here is the call graph for this function:

◆ init_params()

void SolverChoice::init_params ( int  max_level,
std::string  pp_prefix 
)
inline
131  {
132  amrex::ParmParse pp(pp_prefix);
133 
134  bool bogus;
135  if (pp.query("use_terrain",bogus) > 0) {
136  amrex::Abort("The input use_terrain is deprecated. Set terrain_type instead.");
137  }
138 
139  // Do we set map scale factors to 0.5 instead of 1 for testing?
140  pp.query("test_mapfactor", test_mapfactor);
141 
142  // Which horizontal pressure gradient formulation to use with terrain fitted coords?
143  // 0: dp/dx with dp/dz correction (default)
144  // 1: gradient of vertically interpolated p, see Klemp 2011
145  pp.query("gradp_type", gradp_type);
146  AMREX_ALWAYS_ASSERT(gradp_type == 0 || gradp_type == 1);
147 
148  // What type of moisture model to use?
149  moisture_type = MoistureType::None; // Default
150  if (pp.query("moisture_type",moisture_type) > 0) {
151  amrex::Abort("The input moisture_type is deprecated. Set moisture_model instead.");
152  }
153  pp.query_enum_case_insensitive("moisture_model",moisture_type);
154  if ( (moisture_type == MoistureType::Morrison) ||
155  (moisture_type == MoistureType::SAM) ) {
157  RhoQ1_comp, // water vapor
158  RhoQ2_comp, // cloud water
159  RhoQ3_comp, // cloud ice
160  RhoQ4_comp, // rain
161  RhoQ5_comp, // snow
162  RhoQ6_comp // graupel
163  );
164  } else if ( (moisture_type == MoistureType::Morrison_NoIce) ||
165  (moisture_type == MoistureType::SAM_NoIce) ) {
167  RhoQ1_comp, // water vapor
168  RhoQ2_comp, // cloud water
169  -1, // cloud ice
170  RhoQ4_comp // rain
171  );
172  } else if ( (moisture_type == MoistureType::SAM_NoPrecip_NoIce) ||
173  (moisture_type == MoistureType::Kessler_NoRain) ||
174  (moisture_type == MoistureType::SatAdj) ) {
176  RhoQ1_comp, // water vapor
177  RhoQ2_comp // cloud water
178  );
179  } else if (moisture_type == MoistureType::Kessler) {
181  RhoQ1_comp, // water vapor
182  RhoQ2_comp, // cloud water
183  -1, // cloud ice
184  RhoQ3_comp // rain
185  );
186  }
187 
188  // Set a default for dry
189  buoyancy_type.resize(max_level+1);
190  for (int i = 0; i <= max_level; ++i) {
191  buoyancy_type[i] = 1; // uses Rhoprime
192  }
193 
194  // Set a default for moist
195  if (moisture_type != MoistureType::None) {
196  if ( !(moisture_type == MoistureType::Kessler_NoRain ||
197  moisture_type == MoistureType::SAM ||
198  moisture_type == MoistureType::SAM_NoIce ||
199  moisture_type == MoistureType::SAM_NoPrecip_NoIce ||
200  moisture_type == MoistureType::Morrison ||
201  moisture_type == MoistureType::Morrison_NoIce ||
202  moisture_type == MoistureType::SatAdj) )
203  {
204  for (int i = 0; i <= max_level; ++i) {
205  buoyancy_type[i] = 2; // uses Tprime
206  }
207  }
208 
209  pp.query("moisture_tight_coupling",moisture_tight_coupling);
210  }
211 
212  // Which expression (1,2/3 or 4) to use for buoyancy
213  int default_buoyancy_type = buoyancy_type[0];
214  read_int_string(max_level, "buoyancy_type", buoyancy_type, default_buoyancy_type);
215 
216  // What type of land surface model to use
217  lsm_type = LandSurfaceType::None; // Default
218  pp.query_enum_case_insensitive("land_surface_model",lsm_type);
219 
220  // What type of radiation model to use
221  rad_type = RadiationType::None; // Default
222  pp.query_enum_case_insensitive("radiation_model", rad_type);
223 
224  // Verify that radiation model cannot be RRTMGP if ERF was not compiled with RRTMGP
225 #ifndef ERF_USE_RRTMGP
226  if (rad_type == RadiationType::RRTMGP)
227  {
228  amrex::Abort("ERF was not compiled with RRTMGP enabled!");
229  }
230 #endif
231 
232  // Is the terrain none, static or moving?
233  std::string terrain_type_temp = "";
234  pp.query("terrain_type", terrain_type_temp);
235  if (terrain_type_temp == "Moving") {
236  amrex::Warning("erf.terrain_type = Moving is deprecated; please replace Moving by MovingFittedMesh");
237  terrain_type = TerrainType::MovingFittedMesh;
238  } else if (terrain_type_temp == "Static") {
239  amrex::Warning("erf.terrain_type = Static is deprecated; please replace Static by StaticFittedMesh");
240  terrain_type = TerrainType::StaticFittedMesh;
241  } else {
242  pp.query_enum_case_insensitive("terrain_type",terrain_type);
243  }
244 
245  // Get buildings type
246  std::string buildings_type_temp = "";
247  pp.query("buildings_type", buildings_type_temp);
248  if (buildings_type_temp == "ImmersedForcing") {
249  buildings_type = BuildingsType::ImmersedForcing;
250  }
251 
252  //
253  // Read the init_type here to make sure we correctly set the mesh and terrain types
254  //
255  std::string init_type_temp_string;
256  pp.query("init_type",init_type_temp_string);
257  if ( (init_type_temp_string == "Real") || (init_type_temp_string == "real") ) {
258  amrex::Abort("erf.init_type = Real is deprecated; please replace Real by WRFInput");
259  } else if ( (init_type_temp_string == "Ideal") || (init_type_temp_string == "ideal") ) {
260  amrex::Abort("erf.init_type = Ideal is deprecated; please replace Ideal by WRFInput");
261  } else if (init_type_temp_string == "hindcast") {
262  init_type = InitType::HindCast;
263  }
264  else {
265  pp.query_enum_case_insensitive("init_type",init_type);
266  use_real_bcs = ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) );
267  }
268 
269  if ( (init_type == InitType::WRFInput) || (init_type == InitType::Metgrid) ) {
270  if (terrain_type != TerrainType::StaticFittedMesh) {
271  amrex::Abort("Only terrain_type = StaticFittedMesh are allowed with init_type = WRFInput or Metgrid");
272  }
273  }
274 
275  if (init_type == InitType::WRFInput) {
276  if (moisture_type == MoistureType::None) {
277  amrex::Abort("Can't have moisture_type = None with init_type = WRFInput");
278  }
279 
280  // NetCDF wrfbdy lateral boundary file
281  std::string nc_bdy_file_temp_string;
282  bool has_bdy = pp.query("nc_bdy_file", nc_bdy_file_temp_string);
283  if (!has_bdy) use_real_bcs = false;
284 
285  bool use_real_bcs_temp = use_real_bcs;
286  pp.query("use_real_bcs", use_real_bcs_temp);
287  if (use_real_bcs && !use_real_bcs_temp) {
288  use_real_bcs = false;
289  }
290  }
291 
292  if (use_real_bcs) {
293  pp.query("upwind_real_bcs",upwind_real_bcs);
294  }
295 
296  // Check for rebalancing with wrfinput
297  if (init_type == InitType::WRFInput) {
298  pp.query("rebalance_wrfinput",rebalance_wrfinput);
299  }
300 
301  // How to interpret input_sounding
302  if (init_type == InitType::Input_Sounding) {
303  pp.query_enum_case_insensitive("sounding_type",sounding_type);
304  }
305 
306  if (terrain_type == TerrainType::StaticFittedMesh ||
307  terrain_type == TerrainType::MovingFittedMesh) {
308  mesh_type = MeshType::VariableDz;
309  }
310 
311  pp.query("grid_stretching_ratio", grid_stretching_ratio);
312  if (grid_stretching_ratio != 0) {
313  AMREX_ASSERT_WITH_MESSAGE((grid_stretching_ratio >= 1.),
314  "The grid stretching ratio must be greater than 1");
315  }
316  if (grid_stretching_ratio >= 1) {
317  if (terrain_type == TerrainType::None) {
318  terrain_type = TerrainType::StaticFittedMesh;
319  }
320  if (mesh_type == MeshType::ConstantDz) {
321  mesh_type = MeshType::StretchedDz;
322  }
323  pp.query("zsurface", zsurf);
324  if (zsurf != 0.0) {
325  amrex::Print() << "Nominal zsurface height != 0, may result in unexpected behavior"
326  << std::endl;
327  }
328  pp.get("initial_dz", dz0);
329  }
330 
331  int n_zlevels = pp.countval("terrain_z_levels");
332  if (n_zlevels > 0)
333  {
334  if (terrain_type == TerrainType::None) {
335  terrain_type = TerrainType::StaticFittedMesh;
336  }
337  if (mesh_type == MeshType::ConstantDz) {
338  mesh_type = MeshType::StretchedDz;
339  }
340  }
341 
342  // Use lagged_delta_rt in the fast integrator?
343  pp.query("use_lagged_delta_rt", use_lagged_delta_rt);
344 
345  // These default to true but are used for unit testing
346  pp.query("use_gravity", use_gravity);
348 
349  pp.query("c_p", c_p);
350  rdOcp = R_d / c_p;
351 
352  // *******************************************************************************
353  // Read anelastic etc and over-ride if necessary
354  // *******************************************************************************
355 
356  read_int_string(max_level, "anelastic", anelastic, 0);
357  read_int_string(max_level, "fixed_density", fixed_density, 0);
358  read_int_string(max_level, "project_initial_velocity", project_initial_velocity, 0);
359 
360  for (int i = 0; i <= max_level; ++i) {
361  if (anelastic[i] == 1) {
362  project_initial_velocity[i] = true;
363  fixed_density[i] = true; // We default to true but are allowed to override below
364  buoyancy_type[i] = 3; // (This isn't actually used when anelastic is set)
365  }
366  }
367 
368  // *******************************************************************************
369 
370  if (!upwind_real_bcs && anelastic[0]) {
371  amrex::Print() << "Setting upwind_real_bcs to true because we are doing anelastic at level 0" << std::endl;
372  upwind_real_bcs = true;
373  }
374 
375  // *******************************************************************************
376  // Read substepping_type and allow for different values at each level
377  // *******************************************************************************
378  substepping_type.resize(max_level+1);
379 
380  for (int i = 0; i <= max_level; i++) {
381  substepping_type[i] = SubsteppingType::Implicit;
382  }
383 
384  int nvals = pp.countval("substepping_type");
385  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
386 
387  if (nvals == 1) {
388  pp.query_enum_case_insensitive("substepping_type",substepping_type[0]);
389  for (int i = 1; i <= max_level; i++) {
391  }
392  } else if (nvals > 1) { // in this case we have asserted nvals >= max_level+1
393  for (int i = 0; i <= max_level; i++) {
394  pp.query_enum_case_insensitive("substepping_type",substepping_type[i],i);
395  }
396  }
397 
398  pp.query("substepping_diag", substepping_diag);
399 
400  pp.query("beta_s", beta_s);
401 
402 
403 
404  // *******************************************************************************
405  // Error check on deprecated input
406  // *******************************************************************************
407  int nvals_old = pp.countval("no_substepping");
408  if (nvals_old > 0) {
409  amrex::Abort("The no_substepping flag is deprecated -- set substepping_type instead");
410  }
411 
412  // *******************************************************************************
413 
414  pp.query("ncorr", ncorr);
415  pp.query("poisson_abstol", poisson_abstol);
416  pp.query("poisson_reltol", poisson_reltol);
417 
418  for (int lev = 0; lev <= max_level; lev++) {
419  if (anelastic[lev] != 0)
420  {
421  substepping_type[lev] = SubsteppingType::None;
422  }
423  }
424 
425  pp.query("force_stage1_single_substep", force_stage1_single_substep);
426 
427  // Include Coriolis forcing?
428  pp.query("use_coriolis", use_coriolis);
429  pp.query("has_lat_lon", has_lat_lon);
430  pp.query("variable_coriolis", variable_coriolis);
431 
432  // Include four stream radiation approximation
433  pp.query("four_stream_radiation", four_stream_radiation);
434 
435  // flags for whether to apply other source terms in substep only
436  pp.query("immersed_forcing_substep", immersed_forcing_substep); // apply immersed forcing source terms in substep only
437  pp.query("forest_substep", forest_substep); // apply canopy-related source terms in substep only
438 
439  // immersed forcing parameters
440  pp.query("if_Cd_scalar", if_Cd_scalar);
441  pp.query("if_Cd_momentum", if_Cd_momentum);
442  pp.query("if_z0", if_z0);
443  pp.query("if_surf_temp_flux", if_surf_temp_flux);
444  pp.query("if_init_surf_temp", if_init_surf_temp);
445  pp.query("if_surf_heating_rate", if_surf_heating_rate);
446  pp.query("if_Olen", if_Olen_in);
447  pp.query("if_use_most",if_use_most);
448 
449  if ((if_init_surf_temp > 0.0 && if_surf_temp_flux != 1e-8) ||
450  (if_init_surf_temp > 0.0 && if_Olen_in != 1e-8) ||
451  (if_Olen_in != 1e-8 && if_surf_temp_flux != 1e-8))
452  {
453  amrex::Abort("Can only specify one of init_surf_temp, surf_temp_flux, or Olen");
454  }
455 
456  if (if_use_most && buildings_type == BuildingsType::ImmersedForcing)
457  {
458  amrex::Abort("MOST wall-model with immersed forcing for buildings is not currently supported");
459  }
460 
461  if (if_surf_temp_flux != 1e-8 && buildings_type == BuildingsType::ImmersedForcing)
462  {
463  amrex::Abort("Specifying surf_temp_flux with immersed forcing for buildings is not currently supported");
464  }
465 
466  if (if_Olen_in != 1e-8 && buildings_type == BuildingsType::ImmersedForcing)
467  {
468  amrex::Abort("Specifying Olen with immersed forcing for buildings is not currently supported");
469  }
470 
471  // Flag to do MOST rotations with terrain
472  pp.query("use_rotate_surface_flux",use_rotate_surface_flux);
474  AMREX_ASSERT_WITH_MESSAGE(terrain_type != TerrainType::None,"MOST stress rotations are only valid with terrain!");
475  }
476 
477  // Which external forcings?
478  abl_driver_type = ABLDriverType::None; // Default: no ABL driver for simulating classical fluid dynamics problems
479  pp.query_enum_case_insensitive("abl_driver_type",abl_driver_type);
480  pp.query("const_massflux_u", const_massflux_u);
481  pp.query("const_massflux_v", const_massflux_v);
482  pp.query("const_massflux_tau", const_massflux_tau);
483  pp.query("const_massflux_layer_lo", const_massflux_layer_lo);
484  pp.query("const_massflux_layer_hi", const_massflux_layer_hi);
485 
486  // Which type of inflow turbulent generation
487  pert_type = PerturbationType::None; // Default
488  pp.query_enum_case_insensitive("perturbation_type",pert_type);
489 
490  amrex::Vector<amrex::Real> abl_pressure_grad_in = {0.0, 0.0, 0.0};
491  pp.queryarr("abl_pressure_grad",abl_pressure_grad_in);
492  for(int i = 0; i < AMREX_SPACEDIM; ++i) abl_pressure_grad[i] = abl_pressure_grad_in[i];
493 
494  amrex::Vector<amrex::Real> abl_geo_forcing_in = {0.0, 0.0, 0.0};
495  if(pp.queryarr("abl_geo_forcing",abl_geo_forcing_in)) {
496  amrex::Print() << "Specified abl_geo_forcing: (";
497  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
498  abl_geo_forcing[i] = abl_geo_forcing_in[i];
499  amrex::Print() << abl_geo_forcing[i] << " ";
500  }
501  amrex::Print() << ")" << std::endl;
502  }
503 
504  if (use_coriolis)
505  {
507  }
508 
509  pp.query("add_custom_rhotheta_forcing", custom_rhotheta_forcing);
510  pp.query("add_custom_moisture_forcing", custom_moisture_forcing);
511  pp.query("add_custom_w_subsidence", custom_w_subsidence);
512  pp.query("add_custom_geostrophic_profile", custom_geostrophic_profile);
513  pp.query("custom_forcing_uses_primitive_vars", custom_forcing_prim_vars);
514 
515  pp.query("nudging_from_input_sounding", nudging_from_input_sounding);
516 
518  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(!(!abl_geo_wind_table.empty() && custom_geostrophic_profile),
519  "Should not have both abl_geo_wind_table and custom_geostrophic_profile set.");
520 
521  pp.query("Ave_Plane", ave_plane);
522 
523  pp.query("use_moist_background", use_moist_background);
524 
525  // Use numerical diffusion?
526  pp.query("num_diff_coeff",num_diff_coeff);
527  AMREX_ASSERT_WITH_MESSAGE(( (num_diff_coeff >= 0.) && (num_diff_coeff <= 1.) ),
528  "Numerical diffusion coefficient must be between 0 & 1.");
530  if (use_num_diff) {
531  amrex::Print() << "6th-order numerical diffusion turned on with coefficient = "
532  << num_diff_coeff << std::endl;
533  num_diff_coeff *= std::pow(2.0,-6);
534  }
535 
536  advChoice.init_params(pp_prefix);
537  diffChoice.init_params(pp_prefix);
538  dampingChoice.init_params(pp_prefix);
539  spongeChoice.init_params(pp_prefix);
540 
541 
542 
543  turbChoice.resize(max_level+1);
544  for (int lev = 0; lev <= max_level; lev++) {
545  turbChoice[lev].init_params(lev,max_level,pp_prefix);
546  }
547 
548  // YSU PBL: use consistent coriolis frequency
549  for (int lev = 0; lev <= max_level; lev++) {
550  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
551  if (use_coriolis) {
552  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
553  if (lev == 0) {
554  amrex::Print() << "YSU PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
555  }
556  } else {
557  amrex::Abort("YSU cannot use ERF coriolis frequency if not using coriolis");
558  }
559  }
560  }
561  // MRF
562  for (int lev = 0; lev <= max_level; lev++) {
563  if (turbChoice[lev].pbl_ysu_use_consistent_coriolis) {
564  if (use_coriolis) {
565  turbChoice[lev].pbl_ysu_coriolis_freq = coriolis_factor * sinphi;
566  if (lev == 0) {
567  amrex::Print() << "MRF PBL using ERF coriolis frequency: " << turbChoice[lev].pbl_ysu_coriolis_freq << std::endl;
568  }
569  } else {
570  amrex::Abort("MRF cannot use ERF coriolis frequency if not using coriolis");
571  }
572  }
573  }
574 
575  // Are we using SHOC? (test on compilation done in turb struct)
576  if (turbChoice[0].pbl_type == PBLType::SHOC) { use_shoc = true; }
577 
578  // Implicit vertical diffusion (not available with Shoc)
579  if (!use_shoc) {
580  // This controls the time-centering of the vertical differences in the diffusive term
581  bool do_vert_implicit = false;
582  if (pp.query("vert_implicit", do_vert_implicit) && do_vert_implicit) {
583  // set to default here
584  vert_implicit_fac[0] = 1.0;
585  vert_implicit_fac[1] = 1.0;
586  vert_implicit_fac[2] = 0.0;
587  }
588 
589  // This may be one value for all RK stages or a different value in each stage
590  int n_impfac = pp.countval("vert_implicit_fac");
591  AMREX_ALWAYS_ASSERT(n_impfac == 0 || n_impfac == 1 || n_impfac==3);
592  if (n_impfac > 0 && do_vert_implicit) {
593  amrex::Print() << "Overriding defaults with specified implicit factor(s)" << std::endl;
594  }
595 
596  if (n_impfac == 1) {
597  amrex::Real fac_in;
598  pp.get("vert_implicit_fac", fac_in);
599  for (int i=0; i<3; ++i) { vert_implicit_fac[i] = fac_in; }
600  } else if (n_impfac == 3) {
601  pp.getarr("vert_implicit_fac", vert_implicit_fac);
602  }
603 
604  // If true (default), include implicit contributions to vertical
605  // thermal diffusion
606  pp.query("implicit_thermal_diffusion", implicit_thermal_diffusion);
607 
608  // If true (default), include implicit contributions in tau13, tau23,
609  // (and if ERF_IMPLICIT_W is set, tau33) to correct u, v, (and w).
610  pp.query("implicit_momentum_diffusion", implicit_momentum_diffusion);
611 
613  amrex::Print() << "Thermal and momentum diffusion are both turned off -- turning off vertical implicit solve" << std::endl;
614  vert_implicit_fac[0] = 0.0;
615  vert_implicit_fac[1] = 0.0;
616  vert_implicit_fac[2] = 0.0;
617  }
618 
619  // This controls when the vertical implicit solve for the diffusive terms will happen relative to
620  // the acoustic substepping (if it happens, i.e. if any of the implicit_fac > 0.)
621  // The default is true (i.e. that it happens before the acoustic substepping).
622  pp.query("implicit_before_substep", implicit_before_substep);
623  }
624 
625  // Which type of multilevel coupling
626  coupling_type = CouplingType::TwoWay; // Default
627  pp.query_enum_case_insensitive("coupling_type",coupling_type);
628 
629  // Test for hybrid (compressible + anelastic) -- in this case we must use one-way coupling
630  bool any_anelastic = false;
631  bool any_compress = false;
632  for (int lev = 0; lev <= max_level; lev++) {
633  if (anelastic[lev] == 0) {
634  any_compress = true;
635  } else {
636  any_anelastic = true;
637  }
638  }
639  if (any_anelastic && any_compress) {
640  coupling_type = CouplingType::OneWay;
641  }
642 
643  // Which type of windfarm model
644  windfarm_type = WindFarmType::None; // Default
645  pp.query_enum_case_insensitive("windfarm_type",windfarm_type);
646 
647  static std::string windfarm_loc_type_string = "None";
648  windfarm_loc_type = WindFarmLocType::None;
649  pp.query_enum_case_insensitive("windfarm_loc_type",windfarm_loc_type);
650 
651  pp.query("windfarm_loc_table", windfarm_loc_table);
652  pp.query("windfarm_spec_table", windfarm_spec_table);
653  pp.query("windfarm_blade_table", windfarm_blade_table);
654  pp.query("windfarm_airfoil_tables", windfarm_airfoil_tables);
655  pp.query("windfarm_spec_table_extra", windfarm_spec_table_extra);
656 
657  // Sampling distance upstream of the turbine to find the
658  // incoming free stream velocity as a factor of the diameter of the
659  // turbine. ie. the sampling distance will be this number multiplied
660  // by the diameter of the turbine
661  pp.query("sampling_distance_by_D", sampling_distance_by_D);
662  pp.query("turb_disk_angle_from_x", turb_disk_angle);
663 
664  pp.query("windfarm_x_shift",windfarm_x_shift);
665  pp.query("windfarm_y_shift",windfarm_y_shift);
666  // Test if time averaged data is to be output
667  pp.query("time_avg_vel",time_avg_vel);
668 
669  pp.query("hindcast_lateral_forcing", hindcast_lateral_forcing);
670 
672  pp.query("hindcast_boundary_data_dir", hindcast_boundary_data_dir);
673 
674  if(hindcast_boundary_data_dir.empty()) {
675  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_boundary_data_dir' for boundary data for lateral forcing");
676  }
677  pp.query("hindcast_data_interval_in_hrs", hindcast_data_interval_in_hrs);
679  amrex::Abort("ERROR: Input parameter 'erf.hindcast_data_interval_in_hrs' which is the time interval between the "
680  "data files is either missing or set to less than zero");
681  }
682  pp.query("hindcast_lateral_sponge_strength", hindcast_lateral_sponge_strength);
683  pp.query("hindcast_lateral_sponge_length", hindcast_lateral_sponge_length);
684 
685  pp.query("hindcast_zhi_sponge_length", hindcast_zhi_sponge_length);
686  pp.query("hindcast_zhi_sponge_strength", hindcast_zhi_sponge_strength);
687 
688  pp.query("hindcast_zhi_sponge_damping", hindcast_zhi_sponge_damping);
689 
691  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_strength' or it is specified to be less than zero");
692  }
693 
695  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_lateral_sponge_length' or it is specified to be less than zero");
696  }
697 
699  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
700  }
701 
703  amrex::Abort("ERROR: Missing input parameter 'erf.hindcast_zhi_sponge_strength' or it is specified to be less than zero");
704  }
705  }
706 
707  pp.query("io_hurricane_eye_tracker", io_hurricane_eye_tracker);
709  pp.query("hurricane_eye_latitude", hurricane_eye_latitude);
710  pp.query("hurricane_eye_longitude", hurricane_eye_longitude);
711  if(hurricane_eye_latitude == -1e10 or hurricane_eye_longitude == -1e10) {
712  amrex::Abort("ERROR: You are using 'erf.io_hurricane_eye_tracker' to write out the files that track the eye of the hurricane"
713  " but have not provided the initial location of the eye of the hurricane to be tracked. There has to be two"
714  " options in the inputs - erf.hurricane_eye_latitude and erf.hurricane_eye_longitude that gives an approximate"
715  " location of the eye in the initial condition");
716  }
717  }
718 
719  pp.query("file_name_digits", file_name_digits);
720 
721  check_params(max_level);
722  }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:21
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
#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
@ bogus
Definition: ERF_IndexDefines.H:204
void init_params(std::string pp_prefix)
Definition: ERF_AdvStruct.H:21
void init_params(std::string pp_prefix)
Definition: ERF_DampingStruct.H:21
void init_params(std::string pp_prefix)
Definition: ERF_DiffStruct.H:21
Definition: ERF_DataStruct.H:104
amrex::Real hurricane_eye_latitude
Definition: ERF_DataStruct.H:1151
amrex::Real if_init_surf_temp
Definition: ERF_DataStruct.H:1047
amrex::Real dz0
Definition: ERF_DataStruct.H:1063
amrex::Real const_massflux_layer_lo
Definition: ERF_DataStruct.H:1138
amrex::Real if_surf_temp_flux
Definition: ERF_DataStruct.H:1046
bool rebalance_wrfinput
Definition: ERF_DataStruct.H:1098
amrex::Real hindcast_lateral_sponge_strength
Definition: ERF_DataStruct.H:1146
amrex::Real poisson_reltol
Definition: ERF_DataStruct.H:1024
void build_coriolis_forcings_const_lat(std::string pp_prefix)
Definition: ERF_DataStruct.H:900
bool if_use_most
Definition: ERF_DataStruct.H:1050
amrex::Real rdOcp
Definition: ERF_DataStruct.H:1058
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:942
amrex::Vector< int > project_initial_velocity
Definition: ERF_DataStruct.H:1002
std::string windfarm_spec_table
Definition: ERF_DataStruct.H:1124
amrex::Real hindcast_zhi_sponge_length
Definition: ERF_DataStruct.H:1147
amrex::Real const_massflux_v
Definition: ERF_DataStruct.H:1136
amrex::Real if_z0
Definition: ERF_DataStruct.H:1045
int ncorr
Definition: ERF_DataStruct.H:1022
int force_stage1_single_substep
Definition: ERF_DataStruct.H:997
bool hindcast_zhi_sponge_damping
Definition: ERF_DataStruct.H:1148
std::string windfarm_spec_table_extra
Definition: ERF_DataStruct.H:1124
LandSurfaceType lsm_type
Definition: ERF_DataStruct.H:1104
amrex::Real c_p
Definition: ERF_DataStruct.H:1057
std::string windfarm_loc_table
Definition: ERF_DataStruct.H:1124
amrex::Real gravity
Definition: ERF_DataStruct.H:1056
void check_params(int max_level)
Definition: ERF_DataStruct.H:724
amrex::Real beta_s
Definition: ERF_DataStruct.H:1010
bool custom_rhotheta_forcing
Definition: ERF_DataStruct.H:1071
amrex::Real hindcast_lateral_sponge_length
Definition: ERF_DataStruct.H:1146
bool use_shoc
Definition: ERF_DataStruct.H:1085
bool hindcast_lateral_forcing
Definition: ERF_DataStruct.H:1145
bool moisture_tight_coupling
Definition: ERF_DataStruct.H:1122
bool custom_w_subsidence
Definition: ERF_DataStruct.H:1073
bool nudging_from_input_sounding
Definition: ERF_DataStruct.H:1079
bool custom_geostrophic_profile
Definition: ERF_DataStruct.H:1074
amrex::Real if_Cd_scalar
Definition: ERF_DataStruct.H:1042
bool immersed_forcing_substep
Definition: ERF_DataStruct.H:1038
amrex::Real grid_stretching_ratio
Definition: ERF_DataStruct.H:1061
bool have_geo_wind_profile
Definition: ERF_DataStruct.H:1111
amrex::Real hurricane_eye_longitude
Definition: ERF_DataStruct.H:1151
amrex::Real const_massflux_u
Definition: ERF_DataStruct.H:1135
bool io_hurricane_eye_tracker
Definition: ERF_DataStruct.H:1150
amrex::Real if_Olen_in
Definition: ERF_DataStruct.H:1049
bool use_num_diff
Definition: ERF_DataStruct.H:1094
amrex::Real hindcast_zhi_sponge_strength
Definition: ERF_DataStruct.H:1147
bool test_mapfactor
Definition: ERF_DataStruct.H:1026
static SoundingType sounding_type
Definition: ERF_DataStruct.H:968
bool four_stream_radiation
Definition: ERF_DataStruct.H:1035
bool custom_moisture_forcing
Definition: ERF_DataStruct.H:1072
amrex::Real num_diff_coeff
Definition: ERF_DataStruct.H:1095
std::string windfarm_blade_table
Definition: ERF_DataStruct.H:1125
amrex::Real zsurf
Definition: ERF_DataStruct.H:1062
amrex::Real if_surf_heating_rate
Definition: ERF_DataStruct.H:1048
bool variable_coriolis
Definition: ERF_DataStruct.H:1114
amrex::Real if_Cd_momentum
Definition: ERF_DataStruct.H:1043
static bool upwind_real_bcs
Definition: ERF_DataStruct.H:980
bool use_moist_background
Definition: ERF_DataStruct.H:1119
bool custom_forcing_prim_vars
Definition: ERF_DataStruct.H:1075
amrex::Real hindcast_data_interval_in_hrs
Definition: ERF_DataStruct.H:1144
PerturbationType pert_type
Definition: ERF_DataStruct.H:1091
static InitType init_type
Definition: ERF_DataStruct.H:965
bool substepping_diag
Definition: ERF_DataStruct.H:1006
amrex::Real const_massflux_layer_hi
Definition: ERF_DataStruct.H:1139
bool implicit_before_substep
Definition: ERF_DataStruct.H:1020
static bool use_real_bcs
Definition: ERF_DataStruct.H:977
amrex::Real poisson_abstol
Definition: ERF_DataStruct.H:1023
MoistureComponentIndices moisture_indices
Definition: ERF_DataStruct.H:1120
int file_name_digits
Definition: ERF_DataStruct.H:1153
bool has_lat_lon
Definition: ERF_DataStruct.H:1113
bool use_rotate_surface_flux
Definition: ERF_DataStruct.H:1082
amrex::Real const_massflux_tau
Definition: ERF_DataStruct.H:1137
bool time_avg_vel
Definition: ERF_DataStruct.H:1088
bool forest_substep
Definition: ERF_DataStruct.H:1039
std::string windfarm_airfoil_tables
Definition: ERF_DataStruct.H:1125
int ave_plane
Definition: ERF_DataStruct.H:1116
std::string hindcast_boundary_data_dir
Definition: ERF_DataStruct.H:1143
void init_params(std::string pp_prefix)
Definition: ERF_SpongeStruct.H:17
Here is the call graph for this function:

◆ read_int_string()

void SolverChoice::read_int_string ( int  max_level,
const char *  string_to_read,
amrex::Vector< int > &  vec_to_fill,
int  default_int 
)
inline
944  {
945  amrex::ParmParse pp("erf");
946  int nvals = pp.countval(string_to_read);
947  AMREX_ALWAYS_ASSERT(nvals == 0 || nvals == 1 || nvals >= max_level+1);
948  amrex::Vector<int> temp; temp.resize(nvals);
949  pp.queryarr(string_to_read,temp);
950 
951  if (vec_to_fill.size() < max_level+1) {
952  vec_to_fill.resize(max_level+1);
953  }
954 
955  if (nvals == 0) {
956  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = default_int;
957  } else if (nvals == 1) {
958  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[0];
959  } else {
960  for (int i = 0; i <= max_level; ++i) vec_to_fill[i] = temp[i];
961  }
962  }

Referenced by init_params().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_mesh_type()

static void SolverChoice::set_mesh_type ( MeshType  new_mesh_type)
inlinestatic
987  {
988  mesh_type = new_mesh_type;
989  }

Referenced by ProblemBase::init_custom_terrain(), and ERF::ReadCheckpointFile().

Here is the caller graph for this function:

Member Data Documentation

◆ abl_driver_type

ABLDriverType SolverChoice::abl_driver_type

◆ abl_geo_forcing

amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> SolverChoice::abl_geo_forcing

◆ abl_geo_wind_table

std::string SolverChoice::abl_geo_wind_table

◆ abl_pressure_grad

amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> SolverChoice::abl_pressure_grad

◆ advChoice

◆ anelastic

amrex::Vector<int> SolverChoice::anelastic

◆ ave_plane

int SolverChoice::ave_plane {2}

◆ beta_s

amrex::Real SolverChoice::beta_s = 0.1

Referenced by init_params().

◆ buildings_type

BuildingsType SolverChoice::buildings_type = BuildingsType::None
inlinestatic

◆ buoyancy_type

amrex::Vector<int> SolverChoice::buoyancy_type

◆ c_p

◆ const_massflux_layer_hi

amrex::Real SolverChoice::const_massflux_layer_hi = 1e34

Referenced by init_params().

◆ const_massflux_layer_lo

amrex::Real SolverChoice::const_massflux_layer_lo = -1e34

Referenced by init_params().

◆ const_massflux_tau

amrex::Real SolverChoice::const_massflux_tau = 1.0

Referenced by init_params(), and make_mom_sources().

◆ const_massflux_u

amrex::Real SolverChoice::const_massflux_u = 0.0

Referenced by init_params(), and make_mom_sources().

◆ const_massflux_v

amrex::Real SolverChoice::const_massflux_v = 0.0

Referenced by init_params(), and make_mom_sources().

◆ coriolis_3d

bool SolverChoice::coriolis_3d = true

◆ coriolis_factor

amrex::Real SolverChoice::coriolis_factor = 0.0

◆ cosphi

amrex::Real SolverChoice::cosphi = 0.0

◆ coupling_type

CouplingType SolverChoice::coupling_type

◆ custom_forcing_prim_vars

bool SolverChoice::custom_forcing_prim_vars = false

◆ custom_geostrophic_profile

bool SolverChoice::custom_geostrophic_profile = false

Referenced by init_params().

◆ custom_moisture_forcing

bool SolverChoice::custom_moisture_forcing = false

Referenced by init_params(), and make_sources().

◆ custom_rhotheta_forcing

bool SolverChoice::custom_rhotheta_forcing = false

Referenced by init_params(), and make_sources().

◆ custom_w_subsidence

bool SolverChoice::custom_w_subsidence = false

◆ dampingChoice

DampingChoice SolverChoice::dampingChoice

◆ diffChoice

◆ do_forest_drag

bool SolverChoice::do_forest_drag {false}

Referenced by make_mom_sources().

◆ dz0

amrex::Real SolverChoice::dz0

Referenced by init_params().

◆ file_name_digits

int SolverChoice::file_name_digits = 5

Referenced by init_params().

◆ fixed_density

amrex::Vector<int> SolverChoice::fixed_density

◆ force_stage1_single_substep

int SolverChoice::force_stage1_single_substep = 1

Referenced by init_params().

◆ forest_substep

bool SolverChoice::forest_substep = false

Referenced by init_params(), and make_mom_sources().

◆ four_stream_radiation

bool SolverChoice::four_stream_radiation = false

Referenced by init_params(), and make_sources().

◆ gradp_type

int SolverChoice::gradp_type = 0

◆ gravity

◆ grid_stretching_ratio

amrex::Real SolverChoice::grid_stretching_ratio = 0

Referenced by init_params().

◆ has_lat_lon

bool SolverChoice::has_lat_lon {false}

Referenced by init_params(), and make_mom_sources().

◆ have_geo_wind_profile

bool SolverChoice::have_geo_wind_profile {false}

Referenced by init_params(), and make_mom_sources().

◆ hindcast_boundary_data_dir

std::string SolverChoice::hindcast_boundary_data_dir

Referenced by init_params().

◆ hindcast_data_interval_in_hrs

amrex::Real SolverChoice::hindcast_data_interval_in_hrs = -1.0

Referenced by init_params().

◆ hindcast_lateral_forcing

bool SolverChoice::hindcast_lateral_forcing = false

Referenced by init_params(), and make_mom_sources().

◆ hindcast_lateral_sponge_length

amrex::Real SolverChoice::hindcast_lateral_sponge_length = -1.0

◆ hindcast_lateral_sponge_strength

amrex::Real SolverChoice::hindcast_lateral_sponge_strength = -1.0

◆ hindcast_zhi_sponge_damping

bool SolverChoice::hindcast_zhi_sponge_damping = false

◆ hindcast_zhi_sponge_length

amrex::Real SolverChoice::hindcast_zhi_sponge_length = -1.0

◆ hindcast_zhi_sponge_strength

amrex::Real SolverChoice::hindcast_zhi_sponge_strength = -1.0

◆ hurricane_eye_latitude

amrex::Real SolverChoice::hurricane_eye_latitude = -1e10

Referenced by init_params().

◆ hurricane_eye_longitude

amrex::Real SolverChoice::hurricane_eye_longitude = -1e10

Referenced by init_params().

◆ if_Cd_momentum

amrex::Real SolverChoice::if_Cd_momentum = 10.0

Referenced by init_params(), and make_mom_sources().

◆ if_Cd_scalar

amrex::Real SolverChoice::if_Cd_scalar = 10.0

Referenced by init_params(), and make_sources().

◆ if_init_surf_temp

amrex::Real SolverChoice::if_init_surf_temp = 0.0

Referenced by init_params(), and make_sources().

◆ if_Olen_in

amrex::Real SolverChoice::if_Olen_in = 1e-8

◆ if_surf_heating_rate

amrex::Real SolverChoice::if_surf_heating_rate = 0.0

Referenced by init_params(), and make_sources().

◆ if_surf_temp_flux

amrex::Real SolverChoice::if_surf_temp_flux = 1e-8

◆ if_use_most

bool SolverChoice::if_use_most = false

Referenced by init_params(), and make_mom_sources().

◆ if_z0

amrex::Real SolverChoice::if_z0 = 0.1

◆ immersed_forcing_substep

bool SolverChoice::immersed_forcing_substep = false

◆ implicit_before_substep

bool SolverChoice::implicit_before_substep = true

Referenced by init_params().

◆ implicit_momentum_diffusion

bool SolverChoice::implicit_momentum_diffusion = true

◆ implicit_thermal_diffusion

bool SolverChoice::implicit_thermal_diffusion = true

◆ init_type

InitType SolverChoice::init_type = InitType::None
inlinestatic

Referenced by init_params(), and make_mom_sources().

◆ io_hurricane_eye_tracker

bool SolverChoice::io_hurricane_eye_tracker = false

Referenced by init_params().

◆ lsm_type

LandSurfaceType SolverChoice::lsm_type

◆ massflux_khi

int SolverChoice::massflux_khi {0}

Referenced by make_mom_sources().

◆ massflux_klo

int SolverChoice::massflux_klo {0}

Referenced by make_mom_sources().

◆ mesh_type

◆ moisture_indices

MoistureComponentIndices SolverChoice::moisture_indices

◆ moisture_tight_coupling

bool SolverChoice::moisture_tight_coupling {false}

Referenced by init_params().

◆ moisture_type

◆ ncorr

int SolverChoice::ncorr = 1

Referenced by init_params().

◆ nudging_from_input_sounding

bool SolverChoice::nudging_from_input_sounding = false

◆ num_diff_coeff

amrex::Real SolverChoice::num_diff_coeff {0.}

◆ pert_type

PerturbationType SolverChoice::pert_type

Referenced by init_params(), and make_sources().

◆ poisson_abstol

amrex::Real SolverChoice::poisson_abstol = 1e-8

Referenced by init_params().

◆ poisson_reltol

amrex::Real SolverChoice::poisson_reltol = 1e-8

Referenced by init_params().

◆ project_initial_velocity

amrex::Vector<int> SolverChoice::project_initial_velocity

Referenced by init_params().

◆ rad_type

RadiationType SolverChoice::rad_type

Referenced by display(), init_params(), and make_sources().

◆ rdOcp

◆ rebalance_wrfinput

bool SolverChoice::rebalance_wrfinput {false}

Referenced by init_params().

◆ sampling_distance_by_D

amrex::Real SolverChoice::sampling_distance_by_D = -1.0

Referenced by check_params(), and init_params().

◆ sinphi

amrex::Real SolverChoice::sinphi = 0.0

◆ sounding_type

SoundingType SolverChoice::sounding_type = SoundingType::Ideal
inlinestatic

Referenced by init_params().

◆ spongeChoice

SpongeChoice SolverChoice::spongeChoice

◆ substepping_diag

bool SolverChoice::substepping_diag = false

Referenced by init_params().

◆ substepping_type

amrex::Vector<SubsteppingType> SolverChoice::substepping_type

Referenced by display(), and init_params().

◆ terrain_type

◆ test_mapfactor

bool SolverChoice::test_mapfactor = false

Referenced by init_params().

◆ time_avg_vel

bool SolverChoice::time_avg_vel = false

Referenced by init_params().

◆ turb_disk_angle

amrex::Real SolverChoice::turb_disk_angle = -1.0

Referenced by check_params(), and init_params().

◆ turbChoice

◆ upwind_real_bcs

bool SolverChoice::upwind_real_bcs = false
inlinestatic

Referenced by init_params().

◆ use_coriolis

bool SolverChoice::use_coriolis = false

◆ use_gravity

bool SolverChoice::use_gravity = false

Referenced by display(), and init_params().

◆ use_lagged_delta_rt

bool SolverChoice::use_lagged_delta_rt = true

Referenced by check_params(), and init_params().

◆ use_moist_background

bool SolverChoice::use_moist_background {false}

Referenced by init_params().

◆ use_num_diff

bool SolverChoice::use_num_diff {false}

◆ use_real_bcs

bool SolverChoice::use_real_bcs = false
inlinestatic

Referenced by init_params().

◆ use_rotate_surface_flux

bool SolverChoice::use_rotate_surface_flux = false

◆ use_shoc

◆ variable_coriolis

bool SolverChoice::variable_coriolis {false}

Referenced by init_params(), and make_mom_sources().

◆ vert_implicit_fac

amrex::Vector<amrex::Real> SolverChoice::vert_implicit_fac = {0.0, 0.0, 0.0}

◆ windfarm_airfoil_tables

std::string SolverChoice::windfarm_airfoil_tables

Referenced by init_params().

◆ windfarm_blade_table

std::string SolverChoice::windfarm_blade_table

Referenced by init_params().

◆ windfarm_loc_table

std::string SolverChoice::windfarm_loc_table

Referenced by init_params().

◆ windfarm_loc_type

WindFarmLocType SolverChoice::windfarm_loc_type

Referenced by check_params(), and init_params().

◆ windfarm_spec_table

std::string SolverChoice::windfarm_spec_table

Referenced by init_params().

◆ windfarm_spec_table_extra

std::string SolverChoice::windfarm_spec_table_extra

Referenced by init_params().

◆ windfarm_type

WindFarmType SolverChoice::windfarm_type

Referenced by check_params(), and init_params().

◆ windfarm_x_shift

amrex::Real SolverChoice::windfarm_x_shift = -1.0

Referenced by check_params(), and init_params().

◆ windfarm_y_shift

amrex::Real SolverChoice::windfarm_y_shift = -1.0

Referenced by check_params(), and init_params().

◆ zsurf

amrex::Real SolverChoice::zsurf = 0.0

Referenced by init_params().


The documentation for this struct was generated from the following file: