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

#include <AdvStruct.H>

Collaboration diagram for AdvChoice:

Public Member Functions

void init_params ()
 
void display ()
 
std::string adv_type_convert_int_to_string (AdvType adv_int)
 
AdvType adv_type_convert_string_to_advtype (std::string adv_string)
 

Public Attributes

std::string pp_prefix {"erf"}
 
bool use_efficient_advection = false
 
AdvType dycore_horiz_adv_type = AdvType::Upwind_3rd
 
AdvType dycore_vert_adv_type = AdvType::Upwind_3rd
 
AdvType dryscal_horiz_adv_type = AdvType::Upwind_3rd
 
AdvType dryscal_vert_adv_type = AdvType::Upwind_3rd
 
AdvType moistscal_horiz_adv_type = AdvType::Weno_3
 
AdvType moistscal_vert_adv_type = AdvType::Weno_3
 
amrex::Real dycore_horiz_upw_frac = 1.0
 
amrex::Real dycore_vert_upw_frac = 1.0
 
amrex::Real dryscal_horiz_upw_frac = 1.0
 
amrex::Real dryscal_vert_upw_frac = 1.0
 
amrex::Real moistscal_horiz_upw_frac = 1.0
 
amrex::Real moistscal_vert_upw_frac = 1.0
 
amrex::Vector< amrex::IntVect > zero_xflux
 
amrex::Vector< amrex::IntVect > zero_yflux
 
amrex::Vector< amrex::IntVect > zero_zflux
 

Detailed Description

Container holding the advection-related choices

Member Function Documentation

◆ adv_type_convert_int_to_string()

std::string AdvChoice::adv_type_convert_int_to_string ( AdvType  adv_int)
inline
224  {
225  if (adv_int == AdvType::Centered_2nd) {
226  return "Centered_2nd";
227  } else if (adv_int == AdvType::Upwind_3rd) {
228  return "Upwind_3rd";
229  } else if (adv_int == AdvType::Centered_4th) {
230  return "Centered_4th";
231  } else if (adv_int == AdvType::Upwind_5th) {
232  return "Upwind_5th";
233  } else if (adv_int == AdvType::Centered_6th) {
234  return "Centered_6th";
235  } else if (adv_int == AdvType::Weno_3) {
236  return "WENO3";
237  } else if (adv_int == AdvType::Weno_3Z) {
238  return "WENOZ3";
239  } else if (adv_int == AdvType::Weno_5) {
240  return "WENO5";
241  } else if (adv_int == AdvType::Weno_5Z) {
242  return "WENOZ5";
243  } else if (adv_int == AdvType::Weno_3MZQ) {
244  return "WENOMZQ3";
245  } else {
246  return "Unknown";
247  }
248  }
@ Centered_4th
@ Centered_6th
@ Centered_2nd

Referenced by display().

Here is the caller graph for this function:

◆ adv_type_convert_string_to_advtype()

AdvType AdvChoice::adv_type_convert_string_to_advtype ( std::string  adv_string)
inline
251  {
252  if (adv_string == "Centered_2nd") {
253  return AdvType::Centered_2nd;
254  } else if ((adv_string == "Upwind_3rd") || (adv_string == "Blended_3rd4th")) {
255  return AdvType::Upwind_3rd;
256  } else if (adv_string == "Centered_4th") {
257  return AdvType::Centered_4th;
258  } else if (adv_string == "Upwind_5th" || (adv_string == "Blended_5th6th")) {
259  return AdvType::Upwind_5th;
260  } else if (adv_string == "Centered_6th") {
261  return AdvType::Centered_6th;
262  } else if (adv_string == "WENO3") {
263  return AdvType::Weno_3;
264  } else if (adv_string == "WENOZ3") {
265  return AdvType::Weno_3Z;
266  } else if (adv_string == "WENO5") {
267  return AdvType::Weno_5;
268  } else if (adv_string == "WENOZ5") {
269  return AdvType::Weno_5Z;
270  } else if (adv_string == "WENOMZQ3") {
271  return AdvType::Weno_3MZQ;
272  } else {
273  return AdvType::Unknown;
274  }
275  }

Referenced by init_params().

Here is the caller graph for this function:

◆ display()

void AdvChoice::display ( )
inline
200  {
201  amrex::Print() << "Advection Choices: " << std::endl;
202  amrex::Print() << "dycore_horiz_adv_type : " << adv_type_convert_int_to_string(dycore_horiz_adv_type);
203  if (dycore_horiz_upw_frac < 1) amrex::Print() << " with " << 100*dycore_horiz_upw_frac << "% upwinding";
204  amrex::Print() << std::endl;
205  amrex::Print() << "dycore_vert_adv_type : " << adv_type_convert_int_to_string(dycore_vert_adv_type);
206  if (dycore_vert_upw_frac < 1) amrex::Print() << " with " << 100*dycore_vert_upw_frac << "% upwinding";
207  amrex::Print() << std::endl;
208  amrex::Print() << "dryscal_horiz_adv_type : " << adv_type_convert_int_to_string(dryscal_horiz_adv_type);
209  if (dryscal_horiz_upw_frac < 1) amrex::Print() << " with " << 100*dryscal_horiz_upw_frac << "% upwinding";
210  amrex::Print() << std::endl;
211  amrex::Print() << "dryscal_vert_adv_type : " << adv_type_convert_int_to_string(dryscal_vert_adv_type);
212  if (dryscal_vert_upw_frac < 1) amrex::Print() << " with " << 100*dryscal_vert_upw_frac << "% upwinding";
213  amrex::Print() << std::endl;
214  amrex::Print() << "moistscal_horiz_adv_type : " << adv_type_convert_int_to_string(moistscal_horiz_adv_type);
215  if (moistscal_horiz_upw_frac < 1) amrex::Print() << " with " << 100*moistscal_horiz_upw_frac << "% upwinding";
216  amrex::Print() << std::endl;
217  amrex::Print() << "moistscal_vert_adv_type : " << adv_type_convert_int_to_string(moistscal_vert_adv_type);
218  if (moistscal_vert_upw_frac < 1) amrex::Print() << " with " << 100*moistscal_vert_upw_frac << "% upwinding";
219  amrex::Print() << std::endl;
220  }
amrex::Real dryscal_vert_upw_frac
Definition: AdvStruct.H:296
AdvType moistscal_horiz_adv_type
Definition: AdvStruct.H:287
AdvType dycore_vert_adv_type
Definition: AdvStruct.H:284
AdvType moistscal_vert_adv_type
Definition: AdvStruct.H:288
amrex::Real moistscal_vert_upw_frac
Definition: AdvStruct.H:298
amrex::Real dycore_vert_upw_frac
Definition: AdvStruct.H:294
amrex::Real moistscal_horiz_upw_frac
Definition: AdvStruct.H:297
AdvType dryscal_horiz_adv_type
Definition: AdvStruct.H:285
AdvType dycore_horiz_adv_type
Definition: AdvStruct.H:283
amrex::Real dycore_horiz_upw_frac
Definition: AdvStruct.H:293
std::string adv_type_convert_int_to_string(AdvType adv_int)
Definition: AdvStruct.H:223
AdvType dryscal_vert_adv_type
Definition: AdvStruct.H:286
amrex::Real dryscal_horiz_upw_frac
Definition: AdvStruct.H:295

Referenced by SolverChoice::display().

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

◆ init_params()

void AdvChoice::init_params ( )
inline
22  {
23  amrex::ParmParse pp(pp_prefix);
24 
25  // Order and type of spatial discretizations used in advection
26  pp.query("use_efficient_advection", use_efficient_advection);
27  std::string dycore_horiz_adv_string = "" ; std::string dycore_vert_adv_string = "";
28  std::string dryscal_horiz_adv_string = "" ; std::string dryscal_vert_adv_string = "";
29  pp.query("dycore_horiz_adv_type" , dycore_horiz_adv_string);
30  pp.query("dycore_vert_adv_type" , dycore_vert_adv_string);
31  pp.query("dryscal_horiz_adv_type" , dryscal_horiz_adv_string);
32  pp.query("dryscal_vert_adv_type" , dryscal_vert_adv_string);
33 
34  std::string moistscal_horiz_adv_string = ""; std::string moistscal_vert_adv_string = "";
35  pp.query("moistscal_horiz_adv_type", moistscal_horiz_adv_string);
36  pp.query("moistscal_vert_adv_type" , moistscal_vert_adv_string);
37 
39  amrex::Print() << "Using efficient advection scheme" << std::endl;;
40  }
41 
42  if ( (dycore_horiz_adv_string == "Blended_3rd4th") ||
43  (dycore_horiz_adv_string == "Blended_5th6th") )
44  {
45  pp.query("dycore_horiz_upw_frac" , dycore_horiz_upw_frac);
46  AMREX_ASSERT_WITH_MESSAGE((dycore_horiz_upw_frac >= 0.) && (dycore_horiz_upw_frac <= 1.),
47  "The dycore horizontal upwinding fraction must be between 0 and 1");
48  }
49 
50  if ( (dycore_vert_adv_string == "Blended_3rd4th") ||
51  (dycore_vert_adv_string == "Blended_5th6th") )
52  {
53  pp.query("dycore_vert_upw_frac" , dycore_vert_upw_frac);
54  AMREX_ASSERT_WITH_MESSAGE((dycore_vert_upw_frac >= 0.) && (dycore_vert_upw_frac <= 1.),
55  "The dycore vertical upwinding fraction must be between 0 and 1");
56  }
57 
58  if ( (dryscal_horiz_adv_string == "Blended_3rd4th") ||
59  (dryscal_horiz_adv_string == "Blended_5th6th") )
60  {
61  pp.query("dryscal_horiz_upw_frac" , dryscal_horiz_upw_frac);
62  AMREX_ASSERT_WITH_MESSAGE((dryscal_horiz_upw_frac >= 0.) && (dryscal_horiz_upw_frac <= 1.),
63  "The dry scalar horizontal upwinding fraction must be between 0 and 1");
64  }
65 
66  if ( (dryscal_vert_adv_string == "Blended_3rd4th") ||
67  (dryscal_vert_adv_string == "Blended_5th6th") )
68  {
69  pp.query("dryscal_vert_upw_frac" , dryscal_vert_upw_frac);
70  AMREX_ASSERT_WITH_MESSAGE((dryscal_vert_upw_frac >= 0.) && (dryscal_vert_upw_frac <= 1.),
71  "The dry scalar vertical upwinding fraction must be between 0 and 1");
72  }
73 
74  if ( (moistscal_horiz_adv_string == "Blended_3rd4th") ||
75  (moistscal_horiz_adv_string == "Blended_5th6th") )
76  {
77  pp.query("moistscal_horiz_upw_frac" , moistscal_horiz_upw_frac);
78  AMREX_ASSERT_WITH_MESSAGE((moistscal_horiz_upw_frac >= 0.) && (moistscal_horiz_upw_frac <= 1.),
79  "The moist scalar horizontal upwinding fraction must be between 0 and 1");
80  }
81 
82  if ( (moistscal_vert_adv_string == "Blended_3rd4th") ||
83  (moistscal_vert_adv_string == "Blended_5th6th") )
84  {
85  pp.query("moistscal_vert_upw_frac" , moistscal_vert_upw_frac);
86  AMREX_ASSERT_WITH_MESSAGE((moistscal_vert_upw_frac >= 0.) && (moistscal_vert_upw_frac <= 1.),
87  "The moist scalar vertical upwinding fraction must be between 0 and 1");
88  }
89 
90  if ( (dycore_horiz_adv_string == "Centered_2nd") ||
91  (dycore_horiz_adv_string == "Upwind_3rd" ) ||
92  (dycore_horiz_adv_string == "Blended_3rd4th") ||
93  (dycore_horiz_adv_string == "Centered_4th") ||
94  (dycore_horiz_adv_string == "Upwind_5th" ) ||
95  (dycore_horiz_adv_string == "Blended_5th6th") ||
96  (dycore_horiz_adv_string == "Centered_6th") )
97  {
99  amrex::Print() << "Using dycore_horiz_adv_type: " << dycore_horiz_adv_string << std::endl;
100  } else {
101  amrex::Print() << "Using default dycore_horiz_adv_type" << std::endl;;
102  }
103 
104  if ( (dycore_vert_adv_string == "Centered_2nd") ||
105  (dycore_vert_adv_string == "Upwind_3rd" ) ||
106  (dycore_vert_adv_string == "Blended_3rd4th") ||
107  (dycore_vert_adv_string == "Centered_4th") ||
108  (dycore_vert_adv_string == "Upwind_5th" ) ||
109  (dycore_vert_adv_string == "Blended_5th6th") ||
110  (dycore_vert_adv_string == "Centered_6th") )
111  {
113  amrex::Print() << "Using dycore_vert_adv_type: " << dycore_vert_adv_string << std::endl;
114  } else {
115  amrex::Print() << "Using default dycore_vert_adv_type" << std::endl;;
116  }
117 
118  if ( (dryscal_horiz_adv_string == "Centered_2nd") ||
119  (dryscal_horiz_adv_string == "Upwind_3rd" ) ||
120  (dryscal_horiz_adv_string == "Blended_3rd4th") ||
121  (dryscal_horiz_adv_string == "Centered_4th") ||
122  (dryscal_horiz_adv_string == "Upwind_5th" ) ||
123  (dryscal_horiz_adv_string == "Blended_5th6th") ||
124  (dryscal_horiz_adv_string == "Centered_6th") ||
125  (dryscal_horiz_adv_string == "WENO3" ) ||
126  (dryscal_horiz_adv_string == "WENOZ3" ) ||
127  (dryscal_horiz_adv_string == "WENOMZQ3" ) ||
128  (dryscal_horiz_adv_string == "WENO5" ) ||
129  (dryscal_horiz_adv_string == "WENOZ5" ) )
130  {
132  amrex::Print() << "Using dryscal_horiz_adv_type: " << dryscal_horiz_adv_string << std::endl;
133  } else {
134  amrex::Print() << "Using default dryscal_horiz_adv_type" << std::endl;;
135  }
136 
137  if ( (dryscal_vert_adv_string == "Centered_2nd") ||
138  (dryscal_vert_adv_string == "Upwind_3rd" ) ||
139  (dryscal_vert_adv_string == "Blended_3rd4th") ||
140  (dryscal_vert_adv_string == "Centered_4th") ||
141  (dryscal_vert_adv_string == "Upwind_5th" ) ||
142  (dryscal_vert_adv_string == "Blended_5th6th") ||
143  (dryscal_vert_adv_string == "Centered_6th") ||
144  (dryscal_vert_adv_string == "WENO3" ) ||
145  (dryscal_vert_adv_string == "WENOZ3" ) ||
146  (dryscal_vert_adv_string == "WENOMZQ3" ) ||
147  (dryscal_vert_adv_string == "WENO5" ) ||
148  (dryscal_vert_adv_string == "WENOZ5" ) )
149  {
151  amrex::Print() << "Using dryscal_vert_adv_type: " << dryscal_vert_adv_string << std::endl;
152  } else {
153  amrex::Print() << "Using default dryscal_vert_adv_type" << std::endl;;
154  }
155 
156  if ( (moistscal_horiz_adv_string == "Centered_2nd") ||
157  (moistscal_horiz_adv_string == "Upwind_3rd" ) ||
158  (moistscal_horiz_adv_string == "Blended_3rd4th") ||
159  (moistscal_horiz_adv_string == "Centered_4th") ||
160  (moistscal_horiz_adv_string == "Upwind_5th" ) ||
161  (moistscal_horiz_adv_string == "Blended_5th6th") ||
162  (moistscal_horiz_adv_string == "Centered_6th") ||
163  (moistscal_horiz_adv_string == "WENO3" ) ||
164  (moistscal_horiz_adv_string == "WENOZ3" ) ||
165  (moistscal_horiz_adv_string == "WENOMZQ3" ) ||
166  (moistscal_horiz_adv_string == "WENO5" ) ||
167  (moistscal_horiz_adv_string == "WENOZ5" ) )
168  {
169  moistscal_horiz_adv_type = adv_type_convert_string_to_advtype(moistscal_horiz_adv_string);
170  amrex::Print() << "Using moistscal_horiz_adv_type: " << moistscal_horiz_adv_string << std::endl;
171  } else {
172  amrex::Print() << "Using default moistscal_horiz_adv_type" << std::endl;;
173  }
174 
175  if ( (moistscal_vert_adv_string == "Centered_2nd") ||
176  (moistscal_vert_adv_string == "Upwind_3rd" ) ||
177  (moistscal_vert_adv_string == "Blended_3rd4th") ||
178  (moistscal_vert_adv_string == "Centered_4th") ||
179  (moistscal_vert_adv_string == "Upwind_5th" ) ||
180  (moistscal_vert_adv_string == "Blended_5th6th") ||
181  (moistscal_vert_adv_string == "Centered_6th") ||
182  (moistscal_vert_adv_string == "WENO3" ) ||
183  (moistscal_vert_adv_string == "WENOZ3" ) ||
184  (moistscal_vert_adv_string == "WENOMZQ3" ) ||
185  (moistscal_vert_adv_string == "WENO5" ) ||
186  (moistscal_vert_adv_string == "WENOZ5" ) )
187  {
188  moistscal_vert_adv_type = adv_type_convert_string_to_advtype(moistscal_vert_adv_string);
189  amrex::Print() << "Using moistscal_vert_adv_type: " << moistscal_vert_adv_string << std::endl;
190  } else {
191  amrex::Print() << "Using default moistscal_vert_adv_type" << std::endl;;
192  }
193 
194  pp.queryarr("zero_xflux_faces", zero_xflux);
195  pp.queryarr("zero_yflux_faces", zero_yflux);
196  pp.queryarr("zero_zflux_faces", zero_zflux);
197  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: Microphysics_Utils.H:183
amrex::Vector< amrex::IntVect > zero_yflux
Definition: AdvStruct.H:302
AdvType adv_type_convert_string_to_advtype(std::string adv_string)
Definition: AdvStruct.H:250
bool use_efficient_advection
Definition: AdvStruct.H:282
std::string pp_prefix
Definition: AdvStruct.H:278
amrex::Vector< amrex::IntVect > zero_xflux
Definition: AdvStruct.H:301
amrex::Vector< amrex::IntVect > zero_zflux
Definition: AdvStruct.H:303

Referenced by SolverChoice::init_params().

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

Member Data Documentation

◆ dryscal_horiz_adv_type

AdvType AdvChoice::dryscal_horiz_adv_type = AdvType::Upwind_3rd

◆ dryscal_horiz_upw_frac

amrex::Real AdvChoice::dryscal_horiz_upw_frac = 1.0

◆ dryscal_vert_adv_type

AdvType AdvChoice::dryscal_vert_adv_type = AdvType::Upwind_3rd

◆ dryscal_vert_upw_frac

amrex::Real AdvChoice::dryscal_vert_upw_frac = 1.0

◆ dycore_horiz_adv_type

◆ dycore_horiz_upw_frac

amrex::Real AdvChoice::dycore_horiz_upw_frac = 1.0

◆ dycore_vert_adv_type

◆ dycore_vert_upw_frac

amrex::Real AdvChoice::dycore_vert_upw_frac = 1.0

◆ moistscal_horiz_adv_type

AdvType AdvChoice::moistscal_horiz_adv_type = AdvType::Weno_3

◆ moistscal_horiz_upw_frac

amrex::Real AdvChoice::moistscal_horiz_upw_frac = 1.0

◆ moistscal_vert_adv_type

AdvType AdvChoice::moistscal_vert_adv_type = AdvType::Weno_3

◆ moistscal_vert_upw_frac

amrex::Real AdvChoice::moistscal_vert_upw_frac = 1.0

◆ pp_prefix

std::string AdvChoice::pp_prefix {"erf"}

Referenced by init_params().

◆ use_efficient_advection

bool AdvChoice::use_efficient_advection = false

Referenced by erf_slow_rhs_post(), and init_params().

◆ zero_xflux

amrex::Vector<amrex::IntVect> AdvChoice::zero_xflux

Referenced by init_params().

◆ zero_yflux

amrex::Vector<amrex::IntVect> AdvChoice::zero_yflux

Referenced by init_params().

◆ zero_zflux

amrex::Vector<amrex::IntVect> AdvChoice::zero_zflux

Referenced by init_params().


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