ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_BuoyancyUtils.H File Reference
#include <ERF_EOS.H>
#include <ERF_Constants.H>
Include dependency graph for ERF_BuoyancyUtils.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic (int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_data)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic_eb (int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_data, amrex::Array4< amrex::EBCellFlag const > const &flag)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert (int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &qt_arr)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert_eb (int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &qt_arr, amrex::Array4< amrex::EBCellFlag const > const &flag)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Tpert (int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &p0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_data)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Thpert (int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_prim)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_Tpert (int &i, int &j, int &k, const int &n_qstate, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &p0_arr, const amrex::Array4< const amrex::Real > &cell_prim, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &qt_arr)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_Thpert (int &i, int &j, int &k, const int &n_qstate, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &cell_prim, const amrex::Array4< const amrex::Real > &qt_arr)
 

Function Documentation

◆ buoyancy_dry_anelastic()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic ( int &  i,
int &  j,
int &  k,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  th0_arr,
const amrex::Array4< const amrex::Real > &  cell_data 
)

Compute dry anelastic vertical perturbational gravitational force density [N/m^3].

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]grav_gpuGravity
[in]r0_arrDry reference density field
[in]th0_arrReference potential temperature field
[in]cell_dataState data FAB
Returns
Dry anelastic vertical force density [N/m^3]
27 {
28  // The dry anelastic branch averages theta and theta0 before forming their ratio.
29  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
30  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
31 
32  amrex::Real theta_d_wface = myhalf * (theta_d_lo + theta_d_hi);
33  amrex::Real theta_d0_wface = myhalf * (th0_arr(i,j,k) + th0_arr(i,j,k-1));
34  amrex::Real rho0_wface = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
35 
36  return (-rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface);
37 }
#define Rho_comp
Definition: ERF_IndexDefines.H:42
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:43
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by make_buoyancy().

Here is the caller graph for this function:

◆ buoyancy_dry_anelastic_eb()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic_eb ( int &  i,
int &  j,
int &  k,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  th0_arr,
const amrex::Array4< const amrex::Real > &  cell_data,
amrex::Array4< amrex::EBCellFlag const > const &  flag 
)

Compute dry anelastic force density with embedded boundary handling.

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]grav_gpuGravity
[in]r0_arrReference density field
[in]th0_arrReference potential temperature field
[in]cell_dataState data FAB
[in]flagEB cell flags
Returns
Dry anelastic vertical force density [N/m^3]
61 {
62  amrex::Real buoyancy = zero;
63  if (flag(i,j,k).isRegular()) {
64  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
65  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
66  amrex::Real theta_d_wface = myhalf * (theta_d_lo + theta_d_hi);
67  amrex::Real theta_d0_wface = myhalf * (th0_arr(i,j,k) + th0_arr(i,j,k-1));
68  amrex::Real rho0_wface = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
69  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
70  } else if (flag(i,j,k).isSingleValued()) {
71  if (flag(i,j,k-1).isCovered()) {
72  amrex::Real theta_d_hihi = cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp);
73  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
74  amrex::Real theta_d_wface = myhalf * (three*theta_d_hi - theta_d_hihi);
75  amrex::Real theta_d0_wface = myhalf * (three*th0_arr(i,j,k) - th0_arr(i,j,k+1));
76  amrex::Real rho0_wface = myhalf * (three*r0_arr(i,j,k) - r0_arr(i,j,k+1));
77  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
78  } else if (flag(i,j,k).isCovered()) {
79  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
80  amrex::Real theta_d_lolo = cell_data(i,j,k-2,RhoTheta_comp)/cell_data(i,j,k-2,Rho_comp);
81  amrex::Real theta_d_wface = myhalf * (three*theta_d_lo - theta_d_lolo);
82  amrex::Real theta_d0_wface = myhalf * (three*th0_arr(i,j,k-1) - th0_arr(i,j,k-2));
83  amrex::Real rho0_wface = myhalf * (three*r0_arr(i,j,k-1) - r0_arr(i,j,k-2));
84  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
85  } else {
86  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
87  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
88  amrex::Real theta_d_wface = myhalf * (theta_d_lo + theta_d_hi);
89  amrex::Real theta_d0_wface = myhalf * (th0_arr(i,j,k) + th0_arr(i,j,k-1));
90  amrex::Real rho0_wface = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
91  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
92  }
93  }
94  return buoyancy;
95 }
constexpr amrex::Real three
Definition: ERF_NumericalConstants.H:39
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36

Referenced by make_buoyancy().

Here is the caller graph for this function:

◆ buoyancy_dry_Thpert()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Thpert ( int &  i,
int &  j,
int &  k,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  th0_arr,
const amrex::Array4< const amrex::Real > &  cell_prim 
)

Compute approximate dry potential-temperature force density [N/m^3].

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]grav_gpuGravity
[in]r0_arrReference density field
[in]th0_arrReference potential temperature field
[in]cell_primPrimitive variable FAB
Returns
Approximate dry potential-temperature force density [N/m^3]
244 {
245  amrex::Real thetaprime_hi = (cell_prim(i,j,k ,PrimTheta_comp) - th0_arr(i,j,k )) / th0_arr(i,j,k );
246  amrex::Real thetaprime_lo = (cell_prim(i,j,k-1,PrimTheta_comp) - th0_arr(i,j,k-1)) / th0_arr(i,j,k-1);
247 
248  amrex::Real thp_avg = myhalf * (thetaprime_hi + thetaprime_lo);
249  amrex::Real r0_avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
250 
251  return ( -r0_avg * grav_gpu * thp_avg);
252 }
#define PrimTheta_comp
Definition: ERF_IndexDefines.H:61

Referenced by make_buoyancy().

Here is the caller graph for this function:

◆ buoyancy_dry_Tpert()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Tpert ( int &  i,
int &  j,
int &  k,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  p0_arr,
const amrex::Array4< const amrex::Real > &  th0_arr,
const amrex::Array4< const amrex::Real > &  cell_data 
)

Compute approximate dry temperature-perturbation force density [N/m^3]. Compressible selectors 2 and 3 both dispatch to this implementation.

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]grav_gpuGravity
[in]r0_arrReference density field
[in]p0_arrReference pressure field
[in]th0_arrReference potential temperature field
[in]cell_dataState data FAB
Returns
Approximate dry temperature force density [N/m^3]
208 {
209  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k), th0_arr(i,j,k), RdoCp);
210  amrex::Real t_hi = getTgivenRandRTh(cell_data(i,j,k ,Rho_comp), cell_data(i,j,k ,RhoTheta_comp));
211 
212  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), th0_arr(i,j,k-1), RdoCp);
213  amrex::Real t_lo = getTgivenRandRTh(cell_data(i,j,k-1,Rho_comp), cell_data(i,j,k-1,RhoTheta_comp));
214 
215  amrex::Real tprime_hi = (t_hi-t0_hi)/t0_hi;
216  amrex::Real tprime_lo = (t_lo-t0_lo)/t0_lo;
217 
218  amrex::Real tp_avg = myhalf * (tprime_hi + tprime_lo);
219  amrex::Real r0_avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
220 
221  return ( -r0_avg * grav_gpu * tp_avg);
222 }
constexpr amrex::Real RdoCp
Definition: ERF_Constants.H:53
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getTgivenRandRTh(const amrex::Real rho, const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getTgivenPandTh(const amrex::Real P, const amrex::Real th, const amrex::Real rdOcp)
Definition: ERF_EOS.H:32

Referenced by make_buoyancy().

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

◆ buoyancy_moist_Thpert()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_Thpert ( int &  i,
int &  j,
int &  k,
const int &  n_qstate,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  th0_arr,
const amrex::Array4< const amrex::Real > &  qv0_arr,
const amrex::Array4< const amrex::Real > &  cell_prim,
const amrex::Array4< const amrex::Real > &  qt_arr 
)

Compute approximate moist potential-temperature force density [N/m^3].

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]n_qstateNumber of moisture species
[in]grav_gpuGravity
[in]r0_arrReference density field
[in]th0_arrReference potential temperature field
[in]qv0_arrReference water vapor mixing ratio field
[in]cell_primPrimitive variable FAB
[in]qt_arrTotal water mixing ratio field
Returns
Approximate moist potential-temperature force density [N/m^3]
334 {
335  amrex::Real qv_hi = (n_qstate >= 1) ? cell_prim(i,j,k ,PrimQ1_comp) : zero;
336  amrex::Real qv_lo = (n_qstate >= 1) ? cell_prim(i,j,k-1,PrimQ1_comp) : zero;
337 
338  amrex::Real qt_hi = qt_arr(i,j,k ) - qv_hi;
339  amrex::Real qt_lo = qt_arr(i,j,k-1) - qv_lo;
340 
341  amrex::Real dth_hi = cell_prim(i,j,k ,PrimTheta_comp) - th0_arr(i,j,k );
342  amrex::Real dth_lo = cell_prim(i,j,k-1,PrimTheta_comp) - th0_arr(i,j,k-1);
343 
344  amrex::Real qv0_hi = qv0_arr(i,j,k );
345  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
346 
347  amrex::Real q_hi = epsv * (qv_hi-qv0_hi) - qt_hi + dth_hi/th0_arr(i,j,k );
348  amrex::Real q_lo = epsv * (qv_lo-qv0_lo) - qt_lo + dth_lo/th0_arr(i,j,k-1);
349 
350  amrex::Real qavg = myhalf * (q_hi + q_lo);
351 
352  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
353 
354  return ( -r0avg * grav_gpu * qavg);
355 }
constexpr amrex::Real epsv
Definition: ERF_Constants.H:52
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:64

Referenced by make_buoyancy().

Here is the caller graph for this function:

◆ buoyancy_moist_Tpert()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_Tpert ( int &  i,
int &  j,
int &  k,
const int &  n_qstate,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  th0_arr,
const amrex::Array4< const amrex::Real > &  qv0_arr,
const amrex::Array4< const amrex::Real > &  p0_arr,
const amrex::Array4< const amrex::Real > &  cell_prim,
const amrex::Array4< const amrex::Real > &  cell_data,
const amrex::Array4< const amrex::Real > &  qt_arr 
)

Compute approximate moist temperature-perturbation force density [N/m^3]. Compressible selectors 2 and 3 both dispatch to this implementation.

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]n_qstateNumber of moisture species
[in]grav_gpuGravity
[in]r0_arrReference density field
[in]th0_arrReference potential temperature field
[in]qv0_arrReference water vapor mixing ratio field
[in]p0_arrReference pressure field
[in]cell_primPrimitive variable FAB
[in]cell_dataState data FAB
[in]qt_arrTotal water mixing ratio field
Returns
Approximate moist temperature force density [N/m^3]
285 {
286  amrex::Real qv_hi = (n_qstate >= 1) ? cell_prim(i,j,k ,PrimQ1_comp) : zero;
287  amrex::Real qv_lo = (n_qstate >= 1) ? cell_prim(i,j,k-1,PrimQ1_comp) : zero;
288 
289  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k ), th0_arr(i,j,k ), RdoCp);
290  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), th0_arr(i,j,k-1), RdoCp);
291 
292  amrex::Real dt_hi = getTgivenRandRTh(cell_data(i,j,k ,Rho_comp), cell_data(i,j,k ,RhoTheta_comp), qv_hi) - t0_hi;
293  amrex::Real dt_lo = getTgivenRandRTh(cell_data(i,j,k-1,Rho_comp), cell_data(i,j,k-1,RhoTheta_comp), qv_lo) - t0_lo;
294 
295  amrex::Real qv0_hi = qv0_arr(i,j,k );
296  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
297 
298  amrex::Real q_hi = epsv * (qv_hi-qv0_hi) - (qt_arr(i,j,k )-qv_hi) + dt_hi/t0_hi;
299  amrex::Real q_lo = epsv * (qv_lo-qv0_lo) - (qt_arr(i,j,k-1)-qv_lo) + dt_lo/t0_lo;
300 
301  amrex::Real qavg = myhalf * (q_hi + q_lo);
302 
303  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
304 
305  return ( -r0avg * grav_gpu * qavg);
306 }

Referenced by make_buoyancy().

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

◆ buoyancy_rhopert()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert ( int &  i,
int &  j,
int &  k,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  qv0_arr,
const amrex::Array4< const amrex::Real > &  cell_data,
const amrex::Array4< const amrex::Real > &  qt_arr 
)

Compute the exact total-density-perturbation gravitational force density [N/m^3].

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]grav_gpuGravity
[in]r0_arrDry reference density field
[in]qv0_arrReference water vapor mixing ratio field
[in]cell_dataConserved state FAB
[in]qt_arrTotal water mixing ratio field
Returns
Vertical perturbational gravitational force density [N/m^3]
119 {
120  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
121  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
122  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
123  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
124  return( grav_gpu * myhalf * ( rhop_hi + rhop_lo ) );
125 }
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37

Referenced by make_buoyancy().

Here is the caller graph for this function:

◆ buoyancy_rhopert_eb()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert_eb ( int &  i,
int &  j,
int &  k,
const amrex::Real &  grav_gpu,
const amrex::Array4< const amrex::Real > &  r0_arr,
const amrex::Array4< const amrex::Real > &  qv0_arr,
const amrex::Array4< const amrex::Real > &  cell_data,
const amrex::Array4< const amrex::Real > &  qt_arr,
amrex::Array4< amrex::EBCellFlag const > const &  flag 
)

Compute type-1 total-density-perturbation force density with EB handling.

Parameters
[in]ix-index
[in]jy-index
[in]kz-index
[in]grav_gpuGravity
[in]r0_arrReference density field
[in]qv0_arrReference water vapor mixing ratio field
[in]cell_dataState data FAB
[in]qt_arrTotal water mixing ratio field
[in]flagEB cell flags
Returns
Vertical perturbational gravitational force density [N/m^3]
151 {
152  amrex::Real buoyancy = zero;
153  if (flag(i,j,k).isRegular()) {
154  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
155  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
156  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
157  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
158  buoyancy = grav_gpu * myhalf * ( rhop_hi + rhop_lo );
159  } else if (flag(i,j,k).isSingleValued()) {
160  if (flag(i,j,k-1).isCovered()) {
161  amrex::Real rhop_hihi = cell_data(i,j,k+1,Rho_comp) * (one + qt_arr(i,j,k+1)) -
162  r0_arr(i,j,k+1 ) * (one + qv0_arr(i,j,k+1));
163  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
164  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
165  buoyancy = grav_gpu * myhalf * ( three * rhop_hi - rhop_hihi );
166  // buoyancy = grav_gpu * rhop_hi;
167  } else if (flag(i,j,k).isCovered()) {
168  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
169  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
170  amrex::Real rhop_lolo = cell_data(i,j,k-2,Rho_comp) * (one + qt_arr(i,j,k-2)) -
171  r0_arr(i,j,k-2 ) * (one + qv0_arr(i,j,k-2));
172  buoyancy = grav_gpu * myhalf * ( three * rhop_lo - rhop_lolo );
173  // buoyancy = grav_gpu * rhop_lo;
174  } else {
175  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
176  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
177  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
178  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
179  buoyancy = grav_gpu * myhalf * ( rhop_hi + rhop_lo );
180  }
181  }
182  return buoyancy;
183 }

Referenced by make_buoyancy().

Here is the caller graph for this function: