ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Utils.H
Go to the documentation of this file.
1 #ifndef ERF_UTILS_H_
2 #define ERF_UTILS_H_
3 
4 #include "AMReX.H"
5 #include "AMReX_MultiFab.H"
6 #include "AMReX_BCRec.H"
7 #include "ERF_Constants.H"
8 #include "ERF_DataStruct.H"
9 #include "ERF_IndexDefines.H"
10 #include "ERF_SurfaceLayer.H"
11 #include "ERF_FillPatcher.H"
12 #include "ERF_ReadBndryPlanes.H"
13 
14 /** Build one density-weighted, nonnegative WRF moisture target. */
15 AMREX_GPU_HOST_DEVICE
16 AMREX_FORCE_INLINE
19  const amrex::Real q_n,
20  const amrex::Real q_np1,
21  const amrex::Real alpha) noexcept
22 {
23  const amrex::Real q = (one - alpha) * q_n + alpha * q_np1;
24  return rho * amrex::max(q, amrex::Real(0.0));
25 }
26 
27 /** True when ERF carries all five hydrometeor mass species separately. */
28 AMREX_GPU_HOST_DEVICE
29 AMREX_FORCE_INLINE
30 bool
32 {
33  return moisture_indices.qc >= 0 && moisture_indices.qi >= 0 &&
34  moisture_indices.qr >= 0 && moisture_indices.qs >= 0 &&
35  moisture_indices.qg >= 0;
36 }
37 
38 /** Map an active conserved moisture component to its real-boundary field. */
39 inline int
41  const MoistureComponentIndices& moisture_indices,
42  const bool use_wrf_bdy_qc_qi,
43  const bool separate_hydrometeors = false)
44 {
45  if (comp == moisture_indices.qv) { return RealBdyVars::QV; }
46  if (use_wrf_bdy_qc_qi) {
47  if (comp == moisture_indices.qc) { return RealBdyVars::QC; }
48  if (moisture_indices.qi >= 0 && comp == moisture_indices.qi) {
49  return RealBdyVars::QI;
50  }
51  if (separate_hydrometeors) {
52  if (comp == moisture_indices.qr) { return RealBdyHydrometeorVars::QR; }
53  if (comp == moisture_indices.qs) { return RealBdyHydrometeorVars::QS; }
54  if (comp == moisture_indices.qg) { return RealBdyHydrometeorVars::QG; }
55  }
56  }
57  return -1;
58 }
59 
60 /*
61  * Rebalance state to satisfy both EOS and HSE one column at a time
62  */
63 void
64 rebalance_columns (amrex::MultiFab& rho,
65  amrex::MultiFab& theta,
66  const amrex::MultiFab& qt,
67  const amrex::MultiFab& qv,
68  const amrex::MultiFab* z_phys,
69  const amrex::Geometry& geom,
70  const bool& maintain_Th,
71  bool use_sfc = false);
72 
73 /*
74  * Create a new BoxArray in which every grid touches the bottom boundary
75  */
76 void ChopGrids2D (amrex::BoxArray& ba, const amrex::Box& domain, int target_size);
77 
78 /*
79  * Create a new BoxArray with exactly the number of boxes as MPI ranks.
80  * This is designed to work only on the base level which covers the entire domain.
81  */
82 amrex::BoxArray
83 ERFPostProcessBaseGrids (const amrex::Box& domain, bool decompose_in_z);
84 
85 /**
86  * Convert conservative state to primitive variables.
87  * @param[in] cons_state Conservative state MultiFab.
88  * @param[out] S_prim Primitive state MultiFab.
89  * @param[in] ng Number of ghost cells.
90  */
91 void
92 cons_to_prim(const amrex::MultiFab& cons_state, amrex::MultiFab& S_prim, int ng);
93 
94 /**
95  * Fill the ghost cells of the wall distance field, which is only computed on
96  * the valid region, so that operators reading from grown boxes do not see the
97  * sentinel value used to initialize it.
98  * @param[inout] wdist MultiFab holding the wall distance.
99  * @param[in] geom Geometry at this level.
100  */
101 void
102 fill_wall_dist_ghost_cells (amrex::MultiFab& wdist, const amrex::Geometry& geom);
103 
104 /**
105  * Compute total water mixing ratio from conservative state.
106  * @param[in] cons_state Conservative state MultiFab.
107  * @param[out] qt MultiFab to store total water.
108  * @param[in] n_qstate_into_total Number of components to include in total water.
109  */
110 void
111 make_qt(const amrex::MultiFab& cons_state, amrex::MultiFab& qt, int n_qstate_into_total);
112 
113 /*
114  * Create the Jacobian for the metric transformation when use_terrain is true
115  */
116 void make_J (const amrex::Geometry& geom,
117  amrex::MultiFab& z_phys_nd,
118  amrex::MultiFab& detJ_cc);
119 
120 void make_areas (const amrex::Geometry& geom,
121  amrex::MultiFab& z_phys_nd,
122  amrex::MultiFab& ax,
123  amrex::MultiFab& ay,
124  amrex::MultiFab& az);
125 
126 /*
127  * Average z_phys_nd on nodes to cell centers
128  */
129 void make_zcc (const amrex::Geometry& geom,
130  amrex::MultiFab& z_phys_nd,
131  amrex::MultiFab& z_phys_cc);
132 
133 /*
134  * Convert momentum to velocity by dividing by density averaged onto faces
135  */
136 void MomentumToVelocity (amrex::MultiFab& xvel_out,
137  amrex::MultiFab& yvel_out,
138  amrex::MultiFab& zvel_out,
139  const amrex::MultiFab& cons_in,
140  const amrex::MultiFab& xmom_in,
141  const amrex::MultiFab& ymom_in,
142  const amrex::MultiFab& zmom_in,
143  const amrex::Box& domain,
144  const amrex::Vector<amrex::BCRec>& domain_bcs_type_h,
145  const amrex::MultiFab* c_vfrac = nullptr // optional
146  );
147 
148 /*
149  * Convert velocity to momentum by multiplying by density averaged onto faces
150  */
151 void VelocityToMomentum (const amrex::MultiFab& xvel_in,
152  const amrex::IntVect & xvel_ngrow,
153  const amrex::MultiFab& yvel_in,
154  const amrex::IntVect & yvel_ngrow,
155  const amrex::MultiFab& zvel_in,
156  const amrex::IntVect & zvel_ngrow,
157  const amrex::MultiFab& cons_in,
158  amrex::MultiFab& xmom_out,
159  amrex::MultiFab& ymom_out,
160  amrex::MultiFab& zmom_out,
161  const amrex::Box& domain,
162  const amrex::Vector<amrex::BCRec>& domain_bcs_type_h,
163  const amrex::MultiFab* c_vfrac = nullptr // optional
164  );
165 
166 /*
167  * Convert (den_div u) to (den_mlt u) by multiplying by (den_mlt/den_div)
168  */
169 void
170 ConvertForProjection (const amrex::MultiFab& den_div, const amrex::MultiFab& den_mlt,
171  amrex::MultiFab& xmom, amrex::MultiFab& ymom, amrex::MultiFab& zmom,
172  const amrex::Box& domain, const amrex::Vector<amrex::BCRec>& domain_bcs_type_h);
173 
174 /*
175  * Compute lateral boundary mass influx/outflux from base-state-density-weighted
176  * boundary normal velocities.
177  */
178 void
179 compute_influx_outflux_bdy (amrex::FArrayBox& bdy_data_xlo, amrex::FArrayBox& bdy_data_xhi,
180  amrex::FArrayBox& bdy_data_ylo, amrex::FArrayBox& bdy_data_yhi,
181  amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>& area_vec,
182  const amrex::Geometry& geom,
183  amrex::Real& influx, amrex::Real& outflux,
184  const int n);
185 
186 /*
187  * \brief Enforces solvability on lateral boundary data by scaling outflow to
188  * match with inflow.
189  */
190 void enforceInOutSolvability_bdy (const amrex::MultiFab& rho0,
191  amrex::FArrayBox& bdy_data_xlo,
192  amrex::FArrayBox& bdy_data_xhi,
193  amrex::FArrayBox& bdy_data_ylo,
194  amrex::FArrayBox& bdy_data_yhi,
195  amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>& area_vec,
196  const amrex::Geometry& geom,
197  const amrex::Vector<amrex::BCRec>& domain_bcs_type_h);
198 
199 /*
200  * \brief Enforces solvability by scaling outflow to match with inflow.
201  *
202  */
204  amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>& vels_vec,
205  amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>& area_vec,
206  const amrex::Geometry& geom);
207 
208 /*
209  * Compute boxes for looping over interior/exterior ghost cells
210  * for use by fillpatch, erf_slow_rhs_pre, and erf_slow_rhs_post
211  */
212 void realbdy_interior_bxs_xy (const amrex::Box& bx,
213  const amrex::Box& domain,
214  const int& width,
215  amrex::Box& bx_xlo,
216  amrex::Box& bx_xhi,
217  amrex::Box& bx_ylo,
218  amrex::Box& bx_yhi,
219  const amrex::IntVect& ng_vect=amrex::IntVect(0,0,0),
220  const bool get_int_ng=false);
221 
222 /*
223  * Compute boxes for looping over set region cells
224  * for use by fillpatch, erf_slow_rhs_pre, and erf_slow_rhs_post
225  */
226 void realbdy_bc_bxs_xy (const amrex::Box& bx,
227  const amrex::Box& domain,
228  const int& set_width,
229  amrex::Box& bx_xlo,
230  amrex::Box& bx_xhi,
231  amrex::Box& bx_ylo,
232  amrex::Box& bx_yhi,
233  const amrex::IntVect& ng_vect=amrex::IntVect(0,0,0));
234 
235 /*
236  * Compute relaxation region RHS with wrfbdy
237  */
238 void realbdy_compute_interior_ghost_rhs (const double& total_time,
239  const double& delta_t,
240  const double& start_bdy_time,
241  const double& final_bdy_time,
242  const double& bdy_time_interval,
243  const amrex::Real& nudge_factor,
244  int width,
245  const amrex::Geometry& geom,
246  amrex::Vector<amrex::MultiFab>& S_rhs,
247  amrex::Vector<amrex::MultiFab>& S_cur_data,
248  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xlo,
249  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xhi,
250  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_ylo,
251  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_yhi,
252  std::unique_ptr<ReadBndryPlanes>& m_r2d,
253  const amrex::Real& c_p,
254  const amrex::Real& rdOcp,
255  const bool use_wrf_bdy_density,
256  const amrex::Real& bdy_rho_nudge_factor);
257 
258 /*
259  * Compute relaxation region RHS at fine-crse interface
260  */
261 void
263  const double& delta_t,
264  const int& width,
265  const int& set_width,
266  const amrex::Geometry& geom,
267  ERFFillPatcher* FPr_c,
268  ERFFillPatcher* FPr_u,
269  ERFFillPatcher* FPr_v,
270  ERFFillPatcher* FPr_w,
271  amrex::Vector<amrex::BCRec>& domain_bcs_type,
272  amrex::Vector<amrex::MultiFab>& S_rhs_f,
273  amrex::Vector<amrex::MultiFab>& S_data_f);
274 
275 /*
276  * Accumulate time averaged velocity fields
277  */
278 void
279 Time_Avg_Vel_atCC (double dt,
280  double& t_avg_cnt,
281  amrex::MultiFab* vel_t_avg,
282  amrex::MultiFab& xvel,
283  amrex::MultiFab& yvel,
284  amrex::MultiFab& zvel);
285 
286 /**
287  * Accumulate time-weighted cell-centered velocity/theta first and second moments.
288  * @param[in] dt accumulation interval
289  * @param[in,out] t_mean_cnt accumulated time
290  * @param[in,out] interval_means ten-component moment storage
291  * @param[in] xvel x-face velocity
292  * @param[in] yvel y-face velocity
293  * @param[in] zvel z-face velocity
294  * @param[in] cons conserved cell-centered state
295  */
296 void
298  double& t_mean_cnt,
299  amrex::MultiFab* interval_means,
300  amrex::MultiFab& xvel,
301  amrex::MultiFab& yvel,
302  amrex::MultiFab& zvel,
303  amrex::MultiFab& cons);
304 
305 /**
306  * Compute the nudging relaxation
307  *
308  * @param[in] delta_t time step
309  * @param[in] icomp component offset
310  * @param[in] num_var number of variables to loop
311  * @param[in] width width of wrf bdy file
312  * @param[in] dom_lo low bound of domain
313  * @param[in] dom_hi high bound of domain
314  * @param[in] F1 drift relaxation parameter
315  * @param[in] bx_xlo box for low x relaxation
316  * @param[in] bx_xhi box for high x relaxation
317  * @param[in] bx_ylo box for low y relaxation
318  * @param[in] bx_yhi box for high y relaxation
319  * @param[in] arr_xlo array for low x relaxation
320  * @param[in] arr_xhi array for high x relaxation
321  * @param[in] arr_ylo array for low y relaxation
322  * @param[in] arr_yhi array for high y relaxation
323  * @param[in] data_arr data array
324  * @param[out] rhs_arr RHS array
325  */
326 AMREX_GPU_HOST
327 AMREX_FORCE_INLINE
328 void
329 realbdy_compute_relaxation (const int& icomp,
330  const int& num_var,
331  const int& width,
332  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& dx,
333  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbLo,
334  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbHi,
335  const amrex::Real& F1,
336  const amrex::Box& bx_xlo,
337  const amrex::Box& bx_xhi,
338  const amrex::Box& bx_ylo,
339  const amrex::Box& bx_yhi,
340  const amrex::Array4<const amrex::Real>& arr_xlo,
341  const amrex::Array4<const amrex::Real>& arr_xhi,
342  const amrex::Array4<const amrex::Real>& arr_ylo,
343  const amrex::Array4<const amrex::Real>& arr_yhi,
344  const amrex::Array4<const amrex::Real>& data_arr,
345  const amrex::Array4<amrex::Real>& rhs_arr,
346  const amrex::Real& c_p,
347  const amrex::Real& rdOcp,
348  const int bdy_moist_nudge_type=0)
349 {
350  amrex::IntVect iv = bx_xlo.type();
351  amrex::Real ioff = (iv[0]==1) ? zero : myhalf;
352  amrex::Real joff = (iv[1]==1) ? zero : myhalf;
353 
354  // These are defined in ERF_Constants.H
355  amrex::Real l_rdOcp = rdOcp;
356  amrex::Real cond_fac = lcond / c_p; // condensation
357  amrex::Real sub_fac = lsub / c_p; // sublimation
358 
359  int nq = num_var;
360 
361  amrex::ParallelFor( bx_xlo, bx_xhi,
362  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
363  {
364  // Corners with x boxes
365  amrex::Real x = ProbLo[0] + (i + ioff) * dx[0];
366  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
367  amrex::Real x_end = ProbLo[0] + width * dx[0];
368  amrex::Real y_end = ProbLo[1] + width * dx[1];
369  amrex::Real y_strt = ProbHi[1] - width * dx[1];
370  amrex::Real xi = (x_end - x) / (x_end - ProbLo[0]);
371  amrex::Real eta_lo = (y < y_end ) ? (y_end - y) / (y_end - ProbLo[1]) : zero;
372  amrex::Real eta_hi = (y > y_strt) ? (y - y_strt) / (ProbHi[1] - y_strt) : zero;
373  amrex::Real eta = std::max(eta_lo,eta_hi);
374  amrex::Real Factor = std::max(xi*xi,eta*eta) * F1;
375 
376  if (icomp == RhoQ1_comp)
377  {
378  amrex::Real exner_pi = getExnergivenRTh(data_arr(i,j,k,RhoTheta_comp),l_rdOcp,
379  data_arr(i,j,k,RhoQ1_comp)/data_arr(i,j,k,Rho_comp));
380 
381  // qv
382  amrex::Real delta = arr_xlo(i,j,k,0) - data_arr(i,j,k,icomp);
383  rhs_arr(i,j,k,icomp) += Factor*delta;
384 
385  if (bdy_moist_nudge_type==2) {
386  // NOTE: we only operate on qv (above), qc and qi here; the
387  // precipitating species (qr/qs/qg) are left untouched.
388 
389  // qc and heat source term due to evaporation
390  delta = -data_arr(i,j,k,RhoQ2_comp); // This effectively nudges to 0
391  rhs_arr(i,j,k,RhoQ2_comp ) += Factor * delta;
392  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * cond_fac / exner_pi;
393 
394  // qi and heat source term due to sublimation
395  if (nq > 3) { // nq > 3 guarantees that RhoQ3 is ice
396  delta = -data_arr(i,j,k,RhoQ3_comp); // This effectively nudges to 0
397  rhs_arr(i,j,k,RhoQ3_comp ) += Factor * delta;
398  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * sub_fac / exner_pi;
399  }
400  } // moist_nudge_type
401  } else {
402  for (int n = 0; n < nq; n++) {
403  amrex::Real delta = arr_xlo(i,j,k,n) - data_arr(i,j,k,n+icomp);
404  rhs_arr(i,j,k,n+icomp) += Factor*delta;
405  }
406  }
407  },
408  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
409  {
410  // Corners with x boxes
411  amrex::Real x = ProbLo[0] + (i + ioff) * dx[0];
412  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
413  amrex::Real x_strt = ProbHi[0] - width * dx[0];
414  amrex::Real y_strt = ProbHi[1] - width * dx[1];
415  amrex::Real y_end = ProbLo[1] + width * dx[1];
416  amrex::Real xi = (x - x_strt) / (ProbHi[0] - x_strt);
417  amrex::Real eta_lo = (y < y_end ) ? (y_end - y) / (y_end - ProbLo[1]) : zero;
418  amrex::Real eta_hi = (y > y_strt) ? (y - y_strt) / (ProbHi[1] - y_strt) : zero;
419  amrex::Real eta = std::max(eta_lo,eta_hi);
420  amrex::Real Factor = std::max(xi*xi,eta*eta) * F1;
421 
422  if (icomp == RhoQ1_comp)
423  {
424  amrex::Real exner_pi = getExnergivenRTh(data_arr(i,j,k,RhoTheta_comp),l_rdOcp,
425  data_arr(i,j,k,RhoQ1_comp)/data_arr(i,j,k,Rho_comp));
426 
427  // qv
428  amrex::Real delta = arr_xhi(i,j,k,0) - data_arr(i,j,k,icomp);
429  rhs_arr(i,j,k,icomp) += Factor*delta;
430 
431  if (bdy_moist_nudge_type==2) {
432  // NOTE: we only operate on qv (above), qc and qi here; the
433  // precipitating species (qr/qs/qg) are left untouched.
434 
435  // qc and heat source term due to evaporation
436  delta = -data_arr(i,j,k,RhoQ2_comp); // This effectively nudges to 0
437  rhs_arr(i,j,k,RhoQ2_comp ) += Factor*delta;
438  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * cond_fac / exner_pi;
439 
440  // qi and heat source term due to sublimation
441  if (nq > 3) { // nq > 3 guarantees that RhoQ3 is ice
442  delta = -data_arr(i,j,k,RhoQ3_comp); // This effectively nudges to 0
443  rhs_arr(i,j,k,RhoQ3_comp ) += Factor * delta;
444  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * sub_fac / exner_pi;
445  }
446  } // moist_nudge_type
447  } else {
448  for (int n = 0; n < nq; n++) {
449  amrex::Real delta = arr_xhi(i,j,k,n) - data_arr(i,j,k,n+icomp);
450  rhs_arr(i,j,k,n+icomp) += Factor*delta;
451  }
452  }
453  });
454 
455  amrex::ParallelFor( bx_ylo, bx_yhi,
456  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
457  {
458  // No corners for y boxes
459  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
460  amrex::Real y_end = ProbLo[1] + width * dx[1];
461  amrex::Real eta = (y_end - y) / (y_end - ProbLo[1]);
462  amrex::Real Factor = eta*eta * F1;
463 
464  if (icomp == RhoQ1_comp)
465  {
466  amrex::Real exner_pi = getExnergivenRTh(data_arr(i,j,k,RhoTheta_comp),l_rdOcp,
467  data_arr(i,j,k,RhoQ1_comp)/data_arr(i,j,k,Rho_comp));
468  // qv
469  amrex::Real delta = arr_ylo(i,j,k,0) - data_arr(i,j,k,icomp);
470  rhs_arr(i,j,k,icomp) += Factor*delta;
471 
472  if (bdy_moist_nudge_type==2) {
473  // NOTE: we only operate on qv (above), qc and qi here; the
474  // precipitating species (qr/qs/qg) are left untouched.
475 
476  // qc and heat source term due to evaporation
477  delta = -data_arr(i,j,k,RhoQ2_comp); // This effectively nudges to 0
478  rhs_arr(i,j,k,RhoQ2_comp ) += Factor*delta;
479  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * cond_fac / exner_pi;
480 
481  // qi and heat source term due to sublimation
482  if (nq > 3) { // nq > 3 guarantees that RhoQ3 is ice
483  delta = -data_arr(i,j,k,RhoQ3_comp); // This effectively nudges to 0
484  rhs_arr(i,j,k,RhoQ3_comp ) += Factor * delta;
485  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * sub_fac / exner_pi;
486  }
487  } // moist_nudge_type
488  } else {
489  for (int n = 0; n < nq; n++) {
490  amrex::Real delta = arr_ylo(i,j,k,n) - data_arr(i,j,k,n+icomp);
491  rhs_arr(i,j,k,n+icomp) += Factor*delta;
492  }
493  }
494  },
495  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
496  {
497  // No corners for y boxes
498  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
499  amrex::Real y_strt = ProbHi[1] - width * dx[1];
500  amrex::Real eta = (y - y_strt) / (ProbHi[1] - y_strt);
501  amrex::Real Factor = eta*eta * F1;
502 
503  if (icomp == RhoQ1_comp)
504  {
505  amrex::Real exner_pi = getExnergivenRTh(data_arr(i,j,k,RhoTheta_comp),l_rdOcp,
506  data_arr(i,j,k,RhoQ1_comp)/data_arr(i,j,k,Rho_comp));
507  // qv
508  amrex::Real delta = arr_yhi(i,j,k,0) - data_arr(i,j,k,icomp);
509  rhs_arr(i,j,k,icomp) += Factor*delta;
510 
511  if (bdy_moist_nudge_type==2) {
512  // NOTE: we only operate on qv (above), qc and qi here; the
513  // precipitating species (qr/qs/qg) are left untouched.
514 
515  // qc and heat source term due to evaporation
516  delta = -data_arr(i,j,k,RhoQ2_comp); // This effectively nudges to 0
517  rhs_arr(i,j,k,RhoQ2_comp ) += Factor * delta;
518  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * cond_fac / exner_pi;
519 
520  // qi and heat source term due to sublimation
521  if (nq > 3) { // nq > 3 guarantees that RhoQ3 is ice
522  delta = -data_arr(i,j,k,RhoQ3_comp); // This effectively nudges to 0
523  rhs_arr(i,j,k,RhoQ3_comp ) += Factor * delta;
524  rhs_arr(i,j,k,RhoTheta_comp) += Factor * delta * sub_fac / exner_pi;
525  }
526  } // moist_nudge_type
527  } else {
528  for (int n = 0; n < nq; n++) {
529  amrex::Real delta = arr_yhi(i,j,k,n) - data_arr(i,j,k,n+icomp);
530  rhs_arr(i,j,k,n+icomp) += Factor*delta;
531  }
532  }
533  });
534 }
535 
536 /**
537  * Apply Davies relaxation to explicitly mapped moisture components. Target
538  * component n corresponds to state component moisture_comps[n].
539  */
540 AMREX_GPU_HOST
541 AMREX_FORCE_INLINE
542 void
544  const amrex::GpuArray<int,6>& moisture_comps,
545  const int n_targets,
546  const int& width,
547  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& dx,
548  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbLo,
549  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbHi,
550  const amrex::Real& F1,
551  const amrex::Box& bx_xlo,
552  const amrex::Box& bx_xhi,
553  const amrex::Box& bx_ylo,
554  const amrex::Box& bx_yhi,
555  const amrex::Array4<const amrex::Real>& arr_xlo,
556  const amrex::Array4<const amrex::Real>& arr_xhi,
557  const amrex::Array4<const amrex::Real>& arr_ylo,
558  const amrex::Array4<const amrex::Real>& arr_yhi,
559  const amrex::Array4<const amrex::Real>& data_arr,
560  const amrex::Array4<amrex::Real>& rhs_arr)
561 {
562  const amrex::IntVect iv = bx_xlo.type();
563  const amrex::Real ioff = (iv[0] == 1) ? zero : myhalf;
564  const amrex::Real joff = (iv[1] == 1) ? zero : myhalf;
565 
566  amrex::ParallelFor(bx_xlo, bx_xhi,
567  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
568  {
569  const amrex::Real x = ProbLo[0] + (i + ioff) * dx[0];
570  const amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
571  const amrex::Real x_end = ProbLo[0] + width * dx[0];
572  const amrex::Real y_end = ProbLo[1] + width * dx[1];
573  const amrex::Real y_strt = ProbHi[1] - width * dx[1];
574  const amrex::Real xi = (x_end - x) / (x_end - ProbLo[0]);
575  const amrex::Real eta_lo = (y < y_end) ? (y_end - y) / (y_end - ProbLo[1]) : amrex::Real(0.0);
576  const amrex::Real eta_hi = (y > y_strt) ? (y - y_strt) / (ProbHi[1] - y_strt) : amrex::Real(0.0);
577  const amrex::Real factor = amrex::max(xi*xi, amrex::max(eta_lo,eta_hi)*amrex::max(eta_lo,eta_hi)) * F1;
578  for (int n = 0; n < n_targets; ++n) {
579  const int comp = moisture_comps[n];
580  if (comp >= 0) {
581  rhs_arr(i,j,k,comp) += factor * (arr_xlo(i,j,k,n) - data_arr(i,j,k,comp));
582  }
583  }
584  },
585  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
586  {
587  const amrex::Real x = ProbLo[0] + (i + ioff) * dx[0];
588  const amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
589  const amrex::Real x_strt = ProbHi[0] - width * dx[0];
590  const amrex::Real y_end = ProbLo[1] + width * dx[1];
591  const amrex::Real y_strt = ProbHi[1] - width * dx[1];
592  const amrex::Real xi = (x - x_strt) / (ProbHi[0] - x_strt);
593  const amrex::Real eta_lo = (y < y_end) ? (y_end - y) / (y_end - ProbLo[1]) : amrex::Real(0.0);
594  const amrex::Real eta_hi = (y > y_strt) ? (y - y_strt) / (ProbHi[1] - y_strt) : amrex::Real(0.0);
595  const amrex::Real eta = amrex::max(eta_lo,eta_hi);
596  const amrex::Real factor = amrex::max(xi*xi, eta*eta) * F1;
597  for (int n = 0; n < n_targets; ++n) {
598  const int comp = moisture_comps[n];
599  if (comp >= 0) {
600  rhs_arr(i,j,k,comp) += factor * (arr_xhi(i,j,k,n) - data_arr(i,j,k,comp));
601  }
602  }
603  });
604 
605  amrex::ParallelFor(bx_ylo, bx_yhi,
606  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
607  {
608  const amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
609  const amrex::Real y_end = ProbLo[1] + width * dx[1];
610  const amrex::Real eta = (y_end - y) / (y_end - ProbLo[1]);
611  const amrex::Real factor = eta*eta * F1;
612  for (int n = 0; n < n_targets; ++n) {
613  const int comp = moisture_comps[n];
614  if (comp >= 0) {
615  rhs_arr(i,j,k,comp) += factor * (arr_ylo(i,j,k,n) - data_arr(i,j,k,comp));
616  }
617  }
618  },
619  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
620  {
621  const amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
622  const amrex::Real y_strt = ProbHi[1] - width * dx[1];
623  const amrex::Real eta = (y - y_strt) / (ProbHi[1] - y_strt);
624  const amrex::Real factor = eta*eta * F1;
625  for (int n = 0; n < n_targets; ++n) {
626  const int comp = moisture_comps[n];
627  if (comp >= 0) {
628  rhs_arr(i,j,k,comp) += factor * (arr_yhi(i,j,k,n) - data_arr(i,j,k,comp));
629  }
630  }
631  });
632 }
633 
634 // Backward-compatible three-species overload used by existing unit tests and
635 // callers that only target qv/qc/qi.
636 AMREX_GPU_HOST
637 AMREX_FORCE_INLINE
638 void
640  const amrex::GpuArray<int,3>& moisture_comps,
641  const int& width,
642  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& dx,
643  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbLo,
644  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbHi,
645  const amrex::Real& F1,
646  const amrex::Box& bx_xlo,
647  const amrex::Box& bx_xhi,
648  const amrex::Box& bx_ylo,
649  const amrex::Box& bx_yhi,
650  const amrex::Array4<const amrex::Real>& arr_xlo,
651  const amrex::Array4<const amrex::Real>& arr_xhi,
652  const amrex::Array4<const amrex::Real>& arr_ylo,
653  const amrex::Array4<const amrex::Real>& arr_yhi,
654  const amrex::Array4<const amrex::Real>& data_arr,
655  const amrex::Array4<amrex::Real>& rhs_arr)
656 {
657  const amrex::GpuArray<int,6> extended_comps = {
658  moisture_comps[0], moisture_comps[1], moisture_comps[2], -1, -1, -1};
660  extended_comps, 3, width, dx, ProbLo, ProbHi, F1,
661  bx_xlo, bx_xhi, bx_ylo, bx_yhi,
662  arr_xlo, arr_xhi, arr_ylo, arr_yhi, data_arr, rhs_arr);
663 }
664 
665 /*
666  * Effectively a Multiply for a MultiFab and an iMultiFab mask
667  */
668 AMREX_GPU_HOST
669 AMREX_FORCE_INLINE
670 void
671 ApplyMask (amrex::MultiFab& dst,
672  const amrex::iMultiFab& imask,
673  const int nghost = 0)
674 {
675  for (amrex::MFIter mfi(dst,amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
676  {
677  const amrex::Box& bx = mfi.growntilebox(nghost);
678  if (bx.ok())
679  {
680  auto dstFab = dst.array(mfi);
681  const auto maskFab = imask.const_array(mfi);
682  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
683  {
684  dstFab(i,j,k) *= maskFab(i,j,k);
685  });
686  }
687  }
688 }
689 
690 /**
691  * Multiply a MultiFab by the inverse of an integer mask.
692  * @param[in,out] dst MultiFab to be masked.
693  * @param[in] imask Integer mask MultiFab.
694  * @param[in] nghost Number of ghost cells to include.
695  */
696 AMREX_GPU_HOST
697 AMREX_FORCE_INLINE
698 void
699 ApplyInvertedMask (amrex::MultiFab& dst,
700  const amrex::iMultiFab& imask,
701  const int nghost = 0)
702 {
703  for (amrex::MFIter mfi(dst,amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
704  {
705  const amrex::Box& bx = mfi.growntilebox(nghost);
706  if (bx.ok())
707  {
708  auto dstFab = dst.array(mfi);
709  const auto maskFab = imask.const_array(mfi);
710  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
711  {
712  dstFab(i,j,k) *= (1-maskFab(i,j,k));
713  });
714  }
715  }
716 }
717 
718 /**
719  * Compute the distance to thin-body walls.
720  * @param[out] wdist MultiFab to store wall distances.
721  * @param[in] xfaces Indices of x-faces forming walls.
722  * @param[in] yfaces Indices of y-faces forming walls.
723  * @param[in] zfaces Indices of z-faces forming walls.
724  * @param[in] geomdata Geometry used for physical distance.
725  * @param[in] z_phys_cc Cell-centered physical height.
726  */
727 void
728 thinbody_wall_dist (std::unique_ptr<amrex::MultiFab>& wdist,
729  amrex::Vector<amrex::IntVect>& xfaces,
730  amrex::Vector<amrex::IntVect>& yfaces,
731  amrex::Vector<amrex::IntVect>& zfaces,
732  const amrex::Geometry& geomdata,
733  std::unique_ptr<amrex::MultiFab>& z_phys_cc);
734 
735 
736 void WeatherDataInterpolation(const double time);
737 
738 /**
739  * Perform quadratic interpolation in one dimension.
740  * @param[in] z Interpolation coordinate.
741  * @param[in] z0 Coordinate of first point.
742  * @param[in] p0 Value at first point.
743  * @param[in] z1 Coordinate of second point.
744  * @param[in] p1 Value at second point.
745  * @param[in] z2 Coordinate of third point.
746  * @param[in] p2 Value at third point.
747  * @return Interpolated value.
748  */
749 AMREX_GPU_HOST_DEVICE
750 AMREX_FORCE_INLINE
754  amrex::Real z1, amrex::Real p1,
755  amrex::Real z2, amrex::Real p2)
756 {
757  return p0 * ( (z - z1) * (z - z2) ) / ( (z0 - z1) * (z0 - z2) )
758  + p1 * ( (z - z0) * (z - z2) ) / ( (z1 - z0) * (z1 - z2) )
759  + p2 * ( (z - z0) * (z - z1) ) / ( (z2 - z0) * (z2 - z1) );
760 }
761 
762 #endif
constexpr amrex::Real lsub
Definition: ERF_Constants.H:111
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
constexpr amrex::Real lcond
Definition: ERF_Constants.H:109
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getExnergivenRTh(const amrex::Real rhotheta, const amrex::Real rdOcp, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:156
#define Rho_comp
Definition: ERF_IndexDefines.H:39
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:40
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:46
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:47
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
Real z0
Definition: ERF_InitCustomPertVels_ScalarAdvDiff.H:8
const Real rdOcp
Definition: ERF_InitCustomPert_ABL.H:72
const Real dx
Definition: ERF_InitCustomPert_ABL.H:44
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
amrex::Real Real
Definition: ERF_ShocInterface.H:19
void WeatherDataInterpolation(const double time)
void MomentumToVelocity(amrex::MultiFab &xvel_out, amrex::MultiFab &yvel_out, amrex::MultiFab &zvel_out, const amrex::MultiFab &cons_in, const amrex::MultiFab &xmom_in, const amrex::MultiFab &ymom_in, const amrex::MultiFab &zmom_in, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h, const amrex::MultiFab *c_vfrac=nullptr)
void compute_influx_outflux_bdy(amrex::FArrayBox &bdy_data_xlo, amrex::FArrayBox &bdy_data_xhi, amrex::FArrayBox &bdy_data_ylo, amrex::FArrayBox &bdy_data_yhi, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &area_vec, const amrex::Geometry &geom, amrex::Real &influx, amrex::Real &outflux, const int n)
void VelocityToMomentum(const amrex::MultiFab &xvel_in, const amrex::IntVect &xvel_ngrow, const amrex::MultiFab &yvel_in, const amrex::IntVect &yvel_ngrow, const amrex::MultiFab &zvel_in, const amrex::IntVect &zvel_ngrow, const amrex::MultiFab &cons_in, amrex::MultiFab &xmom_out, amrex::MultiFab &ymom_out, amrex::MultiFab &zmom_out, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h, const amrex::MultiFab *c_vfrac=nullptr)
void rebalance_columns(amrex::MultiFab &rho, amrex::MultiFab &theta, const amrex::MultiFab &qt, const amrex::MultiFab &qv, const amrex::MultiFab *z_phys, const amrex::Geometry &geom, const bool &maintain_Th, bool use_sfc=false)
void cons_to_prim(const amrex::MultiFab &cons_state, amrex::MultiFab &S_prim, int ng)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wrf_bdy_has_separate_hydrometeors(const MoistureComponentIndices &moisture_indices) noexcept
Definition: ERF_Utils.H:31
void fill_wall_dist_ghost_cells(amrex::MultiFab &wdist, const amrex::Geometry &geom)
void Accumulate_Interval_Means(double dt, double &t_mean_cnt, amrex::MultiFab *interval_means, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::MultiFab &zvel, amrex::MultiFab &cons)
void enforceInOutSolvability_bdy(const amrex::MultiFab &rho0, amrex::FArrayBox &bdy_data_xlo, amrex::FArrayBox &bdy_data_xhi, amrex::FArrayBox &bdy_data_ylo, amrex::FArrayBox &bdy_data_yhi, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &area_vec, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real quad_interp_1d(amrex::Real z, amrex::Real z0, amrex::Real p0, amrex::Real z1, amrex::Real p1, amrex::Real z2, amrex::Real p2)
Definition: ERF_Utils.H:752
void fine_compute_interior_ghost_rhs(const double &time, const double &delta_t, const int &width, const int &set_width, const amrex::Geometry &geom, ERFFillPatcher *FPr_c, ERFFillPatcher *FPr_u, ERFFillPatcher *FPr_v, ERFFillPatcher *FPr_w, amrex::Vector< amrex::BCRec > &domain_bcs_type, amrex::Vector< amrex::MultiFab > &S_rhs_f, amrex::Vector< amrex::MultiFab > &S_data_f)
void thinbody_wall_dist(std::unique_ptr< amrex::MultiFab > &wdist, amrex::Vector< amrex::IntVect > &xfaces, amrex::Vector< amrex::IntVect > &yfaces, amrex::Vector< amrex::IntVect > &zfaces, const amrex::Geometry &geomdata, std::unique_ptr< amrex::MultiFab > &z_phys_cc)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real wrf_moisture_target(const amrex::Real rho, const amrex::Real q_n, const amrex::Real q_np1, const amrex::Real alpha) noexcept
Definition: ERF_Utils.H:18
amrex::BoxArray ERFPostProcessBaseGrids(const amrex::Box &domain, bool decompose_in_z)
void make_zcc(const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &z_phys_cc)
void realbdy_bc_bxs_xy(const amrex::Box &bx, const amrex::Box &domain, const int &set_width, amrex::Box &bx_xlo, amrex::Box &bx_xhi, amrex::Box &bx_ylo, amrex::Box &bx_yhi, const amrex::IntVect &ng_vect=amrex::IntVect(0, 0, 0))
void Time_Avg_Vel_atCC(double dt, double &t_avg_cnt, amrex::MultiFab *vel_t_avg, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::MultiFab &zvel)
void realbdy_interior_bxs_xy(const amrex::Box &bx, const amrex::Box &domain, const int &width, amrex::Box &bx_xlo, amrex::Box &bx_xhi, amrex::Box &bx_ylo, amrex::Box &bx_yhi, const amrex::IntVect &ng_vect=amrex::IntVect(0, 0, 0), const bool get_int_ng=false)
AMREX_GPU_HOST AMREX_FORCE_INLINE void realbdy_compute_relaxation(const int &icomp, const int &num_var, const int &width, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbLo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbHi, const amrex::Real &F1, const amrex::Box &bx_xlo, const amrex::Box &bx_xhi, const amrex::Box &bx_ylo, const amrex::Box &bx_yhi, const amrex::Array4< const amrex::Real > &arr_xlo, const amrex::Array4< const amrex::Real > &arr_xhi, const amrex::Array4< const amrex::Real > &arr_ylo, const amrex::Array4< const amrex::Real > &arr_yhi, const amrex::Array4< const amrex::Real > &data_arr, const amrex::Array4< amrex::Real > &rhs_arr, const amrex::Real &c_p, const amrex::Real &rdOcp, const int bdy_moist_nudge_type=0)
Definition: ERF_Utils.H:329
AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyInvertedMask(amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0)
Definition: ERF_Utils.H:699
int wrf_bdy_var_for_moisture_component(const int comp, const MoistureComponentIndices &moisture_indices, const bool use_wrf_bdy_qc_qi, const bool separate_hydrometeors=false)
Definition: ERF_Utils.H:40
void make_J(const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &detJ_cc)
AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyMask(amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0)
Definition: ERF_Utils.H:671
void realbdy_compute_interior_ghost_rhs(const double &total_time, const double &delta_t, const double &start_bdy_time, const double &final_bdy_time, const double &bdy_time_interval, const amrex::Real &nudge_factor, int width, const amrex::Geometry &geom, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_cur_data, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_xlo, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_xhi, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_ylo, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_yhi, std::unique_ptr< ReadBndryPlanes > &m_r2d, const amrex::Real &c_p, const amrex::Real &rdOcp, const bool use_wrf_bdy_density, const amrex::Real &bdy_rho_nudge_factor)
void ConvertForProjection(const amrex::MultiFab &den_div, const amrex::MultiFab &den_mlt, amrex::MultiFab &xmom, amrex::MultiFab &ymom, amrex::MultiFab &zmom, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h)
void ChopGrids2D(amrex::BoxArray &ba, const amrex::Box &domain, int target_size)
void enforceInOutSolvability(int lev, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &vels_vec, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &area_vec, const amrex::Geometry &geom)
AMREX_GPU_HOST AMREX_FORCE_INLINE void realbdy_compute_moisture_relaxation(const amrex::GpuArray< int, 6 > &moisture_comps, const int n_targets, const int &width, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbLo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbHi, const amrex::Real &F1, const amrex::Box &bx_xlo, const amrex::Box &bx_xhi, const amrex::Box &bx_ylo, const amrex::Box &bx_yhi, const amrex::Array4< const amrex::Real > &arr_xlo, const amrex::Array4< const amrex::Real > &arr_xhi, const amrex::Array4< const amrex::Real > &arr_ylo, const amrex::Array4< const amrex::Real > &arr_yhi, const amrex::Array4< const amrex::Real > &data_arr, const amrex::Array4< amrex::Real > &rhs_arr)
Definition: ERF_Utils.H:543
void make_areas(const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &ax, amrex::MultiFab &ay, amrex::MultiFab &az)
void make_qt(const amrex::MultiFab &cons_state, amrex::MultiFab &qt, int n_qstate_into_total)
Definition: ERF_FillPatcher.H:9
@ ymom
Definition: ERF_IndexDefines.H:234
@ zmom
Definition: ERF_IndexDefines.H:235
@ xmom
Definition: ERF_IndexDefines.H:233
@ theta
Definition: ERF_SLM.H:20
@ rho
Definition: ERF_Kessler.H:24
@ qt
Definition: ERF_Kessler.H:29
@ qv
Definition: ERF_Kessler.H:30
@ ng
Definition: ERF_Morrison.H:49
@ QG
Definition: ERF_IndexDefines.H:144
@ QR
Definition: ERF_IndexDefines.H:142
@ QS
Definition: ERF_IndexDefines.H:143
@ QV
Definition: ERF_IndexDefines.H:129
@ QC
Definition: ERF_IndexDefines.H:131
@ QI
Definition: ERF_IndexDefines.H:132
@ xvel
Definition: ERF_IndexDefines.H:215
@ cons
Definition: ERF_IndexDefines.H:214
@ zvel
Definition: ERF_IndexDefines.H:217
@ yvel
Definition: ERF_IndexDefines.H:216
@ q
Definition: ERF_WSM6.H:184
real(c_double), parameter p0
Definition: ERF_module_model_constants.F90:40
real(kind=kind_phys), parameter, private alpha
Definition: ERF_module_mp_wdm6.F90:62
The moisture data carried by the active microphysics scheme.
Definition: ERF_DataStruct.H:195
int qs
snow
Definition: ERF_DataStruct.H:210
int qr
rain
Definition: ERF_DataStruct.H:209
int qi
cloud ice
Definition: ERF_DataStruct.H:208
int qv
water vapor
Definition: ERF_DataStruct.H:206
int qc
cloud liquid water
Definition: ERF_DataStruct.H:207
int qg
graupel
Definition: ERF_DataStruct.H:211