1 #ifndef ERF_ADV_STRUCT_H_
2 #define ERF_ADV_STRUCT_H_
7 #include <AMReX_ParmParse.H>
8 #include <AMReX_Print.H>
10 #include <AMReX_Geometry.H>
23 amrex::ParmParse
pp(pp_prefix);
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);
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);
39 amrex::Print() <<
"Using efficient advection scheme" << std::endl;
42 if ( (dycore_horiz_adv_string ==
"Blended_3rd4th") ||
43 (dycore_horiz_adv_string ==
"Blended_5th6th") )
47 "The dycore horizontal upwinding fraction must be between 0 and 1");
50 if ( (dycore_vert_adv_string ==
"Blended_3rd4th") ||
51 (dycore_vert_adv_string ==
"Blended_5th6th") )
55 "The dycore vertical upwinding fraction must be between 0 and 1");
58 if ( (dryscal_horiz_adv_string ==
"Blended_3rd4th") ||
59 (dryscal_horiz_adv_string ==
"Blended_5th6th") )
63 "The dry scalar horizontal upwinding fraction must be between 0 and 1");
66 if ( (dryscal_vert_adv_string ==
"Blended_3rd4th") ||
67 (dryscal_vert_adv_string ==
"Blended_5th6th") )
71 "The dry scalar vertical upwinding fraction must be between 0 and 1");
74 if ( (moistscal_horiz_adv_string ==
"Blended_3rd4th") ||
75 (moistscal_horiz_adv_string ==
"Blended_5th6th") )
79 "The moist scalar horizontal upwinding fraction must be between 0 and 1");
82 if ( (moistscal_vert_adv_string ==
"Blended_3rd4th") ||
83 (moistscal_vert_adv_string ==
"Blended_5th6th") )
87 "The moist scalar vertical upwinding fraction must be between 0 and 1");
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") )
101 if ( (dycore_vert_adv_string ==
"Centered_2nd") ||
102 (dycore_vert_adv_string ==
"Upwind_3rd" ) ||
103 (dycore_vert_adv_string ==
"Blended_3rd4th") ||
104 (dycore_vert_adv_string ==
"Centered_4th") ||
105 (dycore_vert_adv_string ==
"Upwind_5th" ) ||
106 (dycore_vert_adv_string ==
"Blended_5th6th") ||
107 (dycore_vert_adv_string ==
"Centered_6th") )
112 if ( (dryscal_horiz_adv_string ==
"Centered_2nd") ||
113 (dryscal_horiz_adv_string ==
"Upwind_3rd" ) ||
114 (dryscal_horiz_adv_string ==
"Blended_3rd4th") ||
115 (dryscal_horiz_adv_string ==
"Centered_4th") ||
116 (dryscal_horiz_adv_string ==
"Upwind_5th" ) ||
117 (dryscal_horiz_adv_string ==
"Blended_5th6th") ||
118 (dryscal_horiz_adv_string ==
"Centered_6th") ||
119 (dryscal_horiz_adv_string ==
"WENO3" ) ||
120 (dryscal_horiz_adv_string ==
"WENOZ3" ) ||
121 (dryscal_horiz_adv_string ==
"WENOMZQ3" ) ||
122 (dryscal_horiz_adv_string ==
"WENO5" ) ||
123 (dryscal_horiz_adv_string ==
"WENOZ5" ) ||
124 (dryscal_horiz_adv_string ==
"WENO7" ) ||
125 (dryscal_horiz_adv_string ==
"WENOZ7" ) )
130 if ( (dryscal_vert_adv_string ==
"Centered_2nd") ||
131 (dryscal_vert_adv_string ==
"Upwind_3rd" ) ||
132 (dryscal_vert_adv_string ==
"Blended_3rd4th") ||
133 (dryscal_vert_adv_string ==
"Centered_4th") ||
134 (dryscal_vert_adv_string ==
"Upwind_5th" ) ||
135 (dryscal_vert_adv_string ==
"Blended_5th6th") ||
136 (dryscal_vert_adv_string ==
"Centered_6th") ||
137 (dryscal_vert_adv_string ==
"WENO3" ) ||
138 (dryscal_vert_adv_string ==
"WENOZ3" ) ||
139 (dryscal_vert_adv_string ==
"WENOMZQ3" ) ||
140 (dryscal_vert_adv_string ==
"WENO5" ) ||
141 (dryscal_vert_adv_string ==
"WENOZ5" ) ||
142 (dryscal_vert_adv_string ==
"WENO7" ) ||
143 (dryscal_vert_adv_string ==
"WENOZ7" ))
148 if ( (moistscal_horiz_adv_string ==
"Centered_2nd") ||
149 (moistscal_horiz_adv_string ==
"Upwind_3rd" ) ||
150 (moistscal_horiz_adv_string ==
"Blended_3rd4th") ||
151 (moistscal_horiz_adv_string ==
"Centered_4th") ||
152 (moistscal_horiz_adv_string ==
"Upwind_5th" ) ||
153 (moistscal_horiz_adv_string ==
"Blended_5th6th") ||
154 (moistscal_horiz_adv_string ==
"Centered_6th") ||
155 (moistscal_horiz_adv_string ==
"WENO3" ) ||
156 (moistscal_horiz_adv_string ==
"WENOZ3" ) ||
157 (moistscal_horiz_adv_string ==
"WENOMZQ3" ) ||
158 (moistscal_horiz_adv_string ==
"WENO5" ) ||
159 (moistscal_horiz_adv_string ==
"WENOZ5" ) ||
160 (moistscal_horiz_adv_string ==
"WENO7" ) ||
161 (moistscal_horiz_adv_string ==
"WENOZ7" ))
166 if ( (moistscal_vert_adv_string ==
"Centered_2nd") ||
167 (moistscal_vert_adv_string ==
"Upwind_3rd" ) ||
168 (moistscal_vert_adv_string ==
"Blended_3rd4th") ||
169 (moistscal_vert_adv_string ==
"Centered_4th") ||
170 (moistscal_vert_adv_string ==
"Upwind_5th" ) ||
171 (moistscal_vert_adv_string ==
"Blended_5th6th") ||
172 (moistscal_vert_adv_string ==
"Centered_6th") ||
173 (moistscal_vert_adv_string ==
"WENO3" ) ||
174 (moistscal_vert_adv_string ==
"WENOZ3" ) ||
175 (moistscal_vert_adv_string ==
"WENOMZQ3" ) ||
176 (moistscal_vert_adv_string ==
"WENO5" ) ||
177 (moistscal_vert_adv_string ==
"WENOZ5" ) ||
178 (moistscal_vert_adv_string ==
"WENO7" ) ||
179 (moistscal_vert_adv_string ==
"WENOZ7" ))
192 amrex::Print() <<
"Advection Choices: " << std::endl;
195 amrex::ParmParse
pp(pp_prefix);
196 std::string dycore_horiz_adv_string =
"" ; std::string dycore_vert_adv_string =
"";
197 std::string dryscal_horiz_adv_string =
"" ; std::string dryscal_vert_adv_string =
"";
198 pp.query(
"dycore_horiz_adv_type" , dycore_horiz_adv_string);
199 pp.query(
"dycore_vert_adv_type" , dycore_vert_adv_string);
200 pp.query(
"dryscal_horiz_adv_type" , dryscal_horiz_adv_string);
201 pp.query(
"dryscal_vert_adv_type" , dryscal_vert_adv_string);
202 std::string moistscal_horiz_adv_string =
""; std::string moistscal_vert_adv_string =
"";
203 pp.query(
"moistscal_horiz_adv_type", moistscal_horiz_adv_string);
204 pp.query(
"moistscal_vert_adv_type" , moistscal_vert_adv_string);
206 if (dycore_horiz_adv_string !=
"") {
207 amrex::Print() <<
" dycore_horiz_adv_type : " << dycore_horiz_adv_string;
211 if ( (dycore_horiz_adv_string ==
"Blended_3rd4th") ||
212 (dycore_horiz_adv_string ==
"Blended_5th6th") ) {
215 amrex::Print() << std::endl;
217 if (dycore_vert_adv_string !=
"") {
218 amrex::Print() <<
" dycore_vert_adv_type : " << dycore_vert_adv_string;
222 if ( (dycore_vert_adv_string ==
"Blended_3rd4th") ||
223 (dycore_vert_adv_string ==
"Blended_5th6th") ) {
226 amrex::Print() << std::endl;
228 if (dryscal_horiz_adv_string !=
"") {
229 amrex::Print() <<
" dryscal_horiz_adv_type : " << dryscal_horiz_adv_string;
233 if ( (dryscal_horiz_adv_string ==
"Blended_3rd4th") ||
234 (dryscal_horiz_adv_string ==
"Blended_5th6th") ) {
237 amrex::Print() << std::endl;
239 if (dryscal_vert_adv_string !=
"") {
240 amrex::Print() <<
" dryscal_vert_adv_type : " << dryscal_vert_adv_string;
244 if ( (dryscal_vert_adv_string ==
"Blended_3rd4th") ||
245 (dryscal_vert_adv_string ==
"Blended_5th6th") ) {
248 amrex::Print() << std::endl;
250 if (moistscal_horiz_adv_string !=
"") {
251 amrex::Print() <<
" moistscal_horiz_adv_type : " << moistscal_horiz_adv_string;
255 if ( (moistscal_horiz_adv_string ==
"Blended_3rd4th") ||
256 (moistscal_horiz_adv_string ==
"Blended_5th6th") ) {
259 amrex::Print() << std::endl;
261 if (moistscal_vert_adv_string !=
"") {
262 amrex::Print() <<
" moistscal_vert_adv_type : " << moistscal_vert_adv_string;
266 if ( (moistscal_vert_adv_string ==
"Blended_3rd4th") ||
267 (moistscal_vert_adv_string ==
"Blended_5th6th") ) {
270 amrex::Print() << std::endl;
277 return "Centered_2nd";
281 return "Centered_4th";
285 return "Centered_6th";
307 if (adv_string ==
"Centered_2nd") {
309 }
else if ((adv_string ==
"Upwind_3rd") || (adv_string ==
"Blended_3rd4th")) {
311 }
else if (adv_string ==
"Centered_4th") {
313 }
else if (adv_string ==
"Upwind_5th" || (adv_string ==
"Blended_5th6th")) {
315 }
else if (adv_string ==
"Centered_6th") {
317 }
else if (adv_string ==
"WENO3") {
319 }
else if (adv_string ==
"WENOZ3") {
321 }
else if (adv_string ==
"WENO5") {
323 }
else if (adv_string ==
"WENOZ5") {
325 }
else if (adv_string ==
"WENOMZQ3") {
327 }
else if (adv_string ==
"WENO7") {
329 }
else if (adv_string ==
"WENOZ7") {
AdvType
Definition: ERF_IndexDefines.H:203
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:219
Definition: ERF_AdvStruct.H:19
void display(std::string &pp_prefix)
Definition: ERF_AdvStruct.H:190
void init_params(std::string pp_prefix)
Definition: ERF_AdvStruct.H:21
amrex::Vector< amrex::IntVect > zero_yflux
Definition: ERF_AdvStruct.H:358
AdvType adv_type_convert_string_to_advtype(std::string adv_string)
Definition: ERF_AdvStruct.H:305
amrex::Real dryscal_vert_upw_frac
Definition: ERF_AdvStruct.H:352
AdvType moistscal_horiz_adv_type
Definition: ERF_AdvStruct.H:343
AdvType dycore_vert_adv_type
Definition: ERF_AdvStruct.H:340
AdvType moistscal_vert_adv_type
Definition: ERF_AdvStruct.H:344
amrex::Real moistscal_vert_upw_frac
Definition: ERF_AdvStruct.H:354
amrex::Real dycore_vert_upw_frac
Definition: ERF_AdvStruct.H:350
bool use_efficient_advection
Definition: ERF_AdvStruct.H:338
amrex::Real moistscal_horiz_upw_frac
Definition: ERF_AdvStruct.H:353
AdvType dryscal_horiz_adv_type
Definition: ERF_AdvStruct.H:341
amrex::Vector< amrex::IntVect > zero_xflux
Definition: ERF_AdvStruct.H:357
amrex::Vector< amrex::IntVect > zero_zflux
Definition: ERF_AdvStruct.H:359
AdvType dycore_horiz_adv_type
Definition: ERF_AdvStruct.H:339
bool have_zero_flux_faces
Definition: ERF_AdvStruct.H:360
amrex::Real dycore_horiz_upw_frac
Definition: ERF_AdvStruct.H:349
std::string adv_type_convert_int_to_string(AdvType adv_int)
Definition: ERF_AdvStruct.H:274
AdvType dryscal_vert_adv_type
Definition: ERF_AdvStruct.H:342
amrex::Real dryscal_horiz_upw_frac
Definition: ERF_AdvStruct.H:351