ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
derived Namespace Reference

Functions

void erf_derrhodivide (const Box &bx, FArrayBox &derfab, const FArrayBox &datfab, const int scalar_index)
 
void erf_dernull (const Box &, FArrayBox &, int, int, const FArrayBox &, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_dersoundspeed (const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_dertemp (const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_dermoisttemp (const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_dertheta (const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_derscalar (const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_derKE (const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_dervortx (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int, const FArrayBox *, const FArrayBox *mfy_fab)
 
void erf_dervorty (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int, const FArrayBox *mfx_fab, const FArrayBox *)
 
void erf_dervortz (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int, const FArrayBox *mfx_fab, const FArrayBox *mfy_fab)
 
void erf_derenstrophysq (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int, const FArrayBox *mfx_fab, const FArrayBox *mfy_fab)
 
void erf_dermagvel (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_dermagvelsq (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_derreflectivity (const Box &bx, FArrayBox &derfab, int dcomp, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &, Real, const int *, const int)
 
void erf_dermaxreflectivity (const Box &bx, FArrayBox &derfab, int dcomp, int, const FArrayBox &datfab, const FArrayBox &, const Geometry &geomdata, Real, const int *, const int)
 
void erf_derlocalhelicity (const Box &bx, FArrayBox &derfab, int dcomp, int, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int, const FArrayBox *mfx_fab, const FArrayBox *mfy_fab)
 
void erf_dervortstretching (const Box &bx, FArrayBox &derfab, int dcomp, int, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int, const FArrayBox *mfx_fab, const FArrayBox *mfy_fab)
 
void erf_derhelicity (const Box &bx, FArrayBox &derfab, int dcomp, int, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int, const FArrayBox *mfx_fab, const FArrayBox *mfy_fab)
 
void erf_derprecipitable (const Box &bx, FArrayBox &derfab, int dcomp, int, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int)
 
void erf_dermucape (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &zcc_fab, const Geometry &geomdata, Real, const int *, const int)
 
void erf_derrhodivide (const amrex::Box &bx, amrex::FArrayBox &derfab, const amrex::FArrayBox &datfab, const int scalar_index)
 
void erf_dernull (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dersoundspeed (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dertemp (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dermoisttemp (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dertheta (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_derscalar (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_derKE (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dervortx (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level, const amrex::FArrayBox *mfx_fab=nullptr, const amrex::FArrayBox *mfy_fab=nullptr)
 
void erf_dervorty (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level, const amrex::FArrayBox *mfx_fab=nullptr, const amrex::FArrayBox *mfy_fab=nullptr)
 
void erf_dervortz (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level, const amrex::FArrayBox *mfx_fab=nullptr, const amrex::FArrayBox *mfy_fab=nullptr)
 
void erf_derenstrophysq (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level, const amrex::FArrayBox *mfx_fab=nullptr, const amrex::FArrayBox *mfy_fab=nullptr)
 
void erf_dermagvel (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dermagvelsq (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_derreflectivity (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dermaxreflectivity (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_derhelicity (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level, const amrex::FArrayBox *mfx_fab=nullptr, const amrex::FArrayBox *mfy_fab=nullptr)
 
void erf_derlocalhelicity (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level, const amrex::FArrayBox *mfx_fab=nullptr, const amrex::FArrayBox *mfy_fab=nullptr)
 
void erf_dervortstretching (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level, const amrex::FArrayBox *mfx_fab=nullptr, const amrex::FArrayBox *mfy_fab=nullptr)
 
void erf_derprecipitable (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 
void erf_dermucape (const amrex::Box &bx, amrex::FArrayBox &derfab, int dcomp, int ncomp, const amrex::FArrayBox &datfab, const amrex::FArrayBox &zfab, const amrex::Geometry &geomdata, amrex::Real time, const int *bcrec, const int level)
 

Function Documentation

◆ erf_derenstrophysq() [1/2]

void derived::erf_derenstrophysq ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level,
const amrex::FArrayBox *  mfx_fab = nullptr,
const amrex::FArrayBox *  mfy_fab = nullptr 
)

◆ erf_derenstrophysq() [2/2]

void derived::erf_derenstrophysq ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int  ,
const FArrayBox *  mfx_fab,
const FArrayBox *  mfy_fab 
)
567 {
568  AMREX_ALWAYS_ASSERT(dcomp == 0);
569  AMREX_ALWAYS_ASSERT(ncomp == 1);
570 
571  auto const dat = datfab.array(); // cell-centered velocity
572  auto tfab = derfab.array(); // cell-centered enstrophy
573  auto z_arr = zcc_fab.array(); // cell-centered height z
574  auto mfx = mf_array(mfx_fab);
575  auto mfy = mf_array(mfy_fab);
576 
577  const Real two_dx = two * geomdata.CellSize(0);
578  const Real two_dy = two * geomdata.CellSize(1);
579 
580  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
581  {
582  Real vortx = cc_vort_x(i,j,k,dat,z_arr,mfy,two_dy);
583  Real vorty = cc_vort_y(i,j,k,dat,z_arr,mfx,two_dx);
584  Real vortz = cc_vort_z(i,j,k,dat,z_arr,mfx,mfy,two_dx,two_dy);
585 
586  tfab(i,j,k,dcomp) = vortx*vortx + vorty*vorty + vortz*vortz;
587  });
588 }
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
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);})
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38

Referenced by ERF::sum_derived_quantities().

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

◆ erf_derhelicity() [1/2]

void derived::erf_derhelicity ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level,
const amrex::FArrayBox *  mfx_fab = nullptr,
const amrex::FArrayBox *  mfy_fab = nullptr 
)

◆ erf_derhelicity() [2/2]

void derived::erf_derhelicity ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int  ,
const FArrayBox *  mfx_fab,
const FArrayBox *  mfy_fab 
)
817 {
818  AMREX_ALWAYS_ASSERT(dcomp == 0);
819 
820  // This is a vertical integral, so the incoming box must span the column
821  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
822  "helicity requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
823 
824  auto const dat = datfab.array(); // cell-centered velocity
825  auto dfab = derfab.array(); // integral of local helicity
826  auto z_arr = zcc_fab.array(); // cell-centered height z
827  auto mfx = mf_array(mfx_fab);
828  auto mfy = mf_array(mfy_fab);
829 
830  const Real two_dx = two * geomdata.CellSize(0);
831  const Real two_dy = two * geomdata.CellSize(1);
832 
833  // Collapse to i,j box (ignore vertical for now)
834  Box b2d = makeSlab(bx,2,0);
835 
836  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int ) noexcept
837  {
838  // Height of the ground: the bottom face of the column, where z_cc in the ghost cell
839  // below mirrors the bottom cell
840  const int klo = bx.smallEnd(2);
841  const Real z_sfc = myhalf * (z_arr(i,j,klo) + z_arr(i,j,klo-1));
842 
843  Real int_hel = Real(0.0);
844  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k)
845  {
846  // Height above the ground
847  Real z = z_arr(i,j,k) - z_sfc;
848 
849  // Helicity is defined as integral from 2km to 5km above the ground
850  if (z > Real(2000.0) && z < Real(5000.0)) {
851 
852  Real z_hi = myhalf * (z_arr(i,j,k) + z_arr(i,j,k+1));
853  Real z_lo = myhalf * (z_arr(i,j,k) + z_arr(i,j,k-1));
854  Real dz = z_hi - z_lo;
855 
856  Real vortz = cc_vort_z(i,j,k,dat,z_arr,mfx,mfy,two_dx,two_dy); // dv/dx - du/dy
857  Real w = dat(i,j,k,2); // vertical velocity
858 
859  int_hel += vortz * w * dz;
860  }
861  }
862 
863  // Store vertical integral into *all* levels for this (i,j)
864  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
865  dfab(i, j, k, dcomp) = int_hel;
866  }
867  });
868 }
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
const int klo
Definition: ERF_InitCustomPert_KE.H:9
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
@ dz
Definition: ERF_AdvanceWDM6.cpp:273

Referenced by ERF::compute_tag_field(), and ERF::FillPlot3DVars().

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

◆ erf_derKE() [1/2]

void derived::erf_derKE ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_derKE() [2/2]

void derived::erf_derKE ( const Box &  bx,
FArrayBox &  derfab,
int  ,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)

Function to define the kinetic energy KE by dividing (rho KE) by rho

@params[in] bx box on which to divide by density @params[out] derfab array of derived quantity – here it holds KE @params[in] datfab array of data used to construct derived quantity

458 {
459  erf_derrhodivide(bx, derfab, datfab, RhoKE_comp);
460 }
#define RhoKE_comp
Definition: ERF_IndexDefines.H:63
void erf_derrhodivide(const Box &bx, FArrayBox &derfab, const FArrayBox &datfab, const int scalar_index)
Definition: ERF_Derive.cpp:274

Referenced by ERF::FillPlot3DVars(), and ERF::WriteSubvolume().

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

◆ erf_derlocalhelicity() [1/2]

void derived::erf_derlocalhelicity ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level,
const amrex::FArrayBox *  mfx_fab = nullptr,
const amrex::FArrayBox *  mfy_fab = nullptr 
)

◆ erf_derlocalhelicity() [2/2]

void derived::erf_derlocalhelicity ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int  ,
const FArrayBox *  mfx_fab,
const FArrayBox *  mfy_fab 
)
742 {
743  AMREX_ALWAYS_ASSERT(dcomp == 0);
744 
745  auto const dat = datfab.array(); // cell-centered velocity
746  auto dfab = derfab.array(); // cell-centered local helicity
747  auto z_arr = zcc_fab.array(); // cell-centered height z
748  auto mfx = mf_array(mfx_fab);
749  auto mfy = mf_array(mfy_fab);
750 
751  const Real two_dx = Real(2.0)*geomdata.CellSize(0);
752  const Real two_dy = Real(2.0)*geomdata.CellSize(1);
753 
754  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
755  {
756  Real vortz = cc_vort_z(i,j,k,dat,z_arr,mfx,mfy,two_dx,two_dy); // dv/dx - du/dy
757  Real w = dat(i,j,k,2);
758 
759  // Helicity
760  dfab(i,j,k,dcomp) = vortz * w;
761  });
762 }

Referenced by ERF::FillPlot3DVars().

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

◆ erf_dermagvel() [1/2]

void derived::erf_dermagvel ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dermagvel() [2/2]

void derived::erf_dermagvel ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)
601 {
602  AMREX_ALWAYS_ASSERT(dcomp == 0);
603  AMREX_ALWAYS_ASSERT(ncomp == 1);
604 
605  auto const dat = datfab.array(); // cell-centered velocity
606  auto tfab = derfab.array(); // cell-centered magvel
607 
608  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
609  {
610  Real u = dat(i,j,k,0);
611  Real v = dat(i,j,k,1);
612  Real w = dat(i,j,k,2);
613  tfab(i,j,k,dcomp) = std::sqrt(u*u + v*v + w*w);
614  });
615 }

Referenced by ERF::compute_tag_field(), and ERF::FillPlot3DVars().

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

◆ erf_dermagvelsq() [1/2]

void derived::erf_dermagvelsq ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dermagvelsq() [2/2]

void derived::erf_dermagvelsq ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)
628 {
629  AMREX_ALWAYS_ASSERT(dcomp == 0);
630  AMREX_ALWAYS_ASSERT(ncomp == 1);
631 
632  auto const dat = datfab.array(); // cell-centered velocity
633  auto tfab = derfab.array(); // cell-centered magvel
634 
635  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
636  {
637  Real u = dat(i,j,k,0);
638  Real v = dat(i,j,k,1);
639  Real w = dat(i,j,k,2);
640  tfab(i,j,k,dcomp) = u*u + v*v + w*w;
641  });
642 }

Referenced by ERF::sum_derived_quantities().

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

◆ erf_dermaxreflectivity() [1/2]

void derived::erf_dermaxreflectivity ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dermaxreflectivity() [2/2]

void derived::erf_dermaxreflectivity ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int   
)
687 {
688  AMREX_ALWAYS_ASSERT(dcomp == 0);
689 
690  // This takes the max over the whole column, so the incoming box must span the column
691  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
692  "max_reflectivity requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
693 
694  auto const dat = datfab.array(); // cell-centered state vector
695  auto rfab = derfab.array(); // cell-centered max reflectivity
696 
697  // Collapse to i,j box (ignore vertical for now)
698  Box b2d = makeSlab(bx,2,0);
699 
700  Real l_bogus_large_value = bogus_large_value;
701 
702  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept
703  {
704  Real max_dbz = -l_bogus_large_value;
705 
706  // find max reflectivity over k
707  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
708 
709  Real rho = dat(i,j,k,Rho_comp);
710  Real qv = std::max(Real(0.0),dat(i,j,k,RhoQ1_comp)/rho);
711  Real qpr = std::max(Real(0.0),dat(i,j,k,RhoQ4_comp)/rho);
712  Real qps = std::max(Real(0.0),dat(i,j,k,RhoQ5_comp)/rho);
713  Real qpg = std::max(Real(0.0),dat(i,j,k,RhoQ6_comp)/rho);
714 
715  Real temp = getTgivenRandRTh(rho, dat(i,j,k,RhoTheta_comp), qv);
716 
717  Real dbz = compute_max_reflectivity_dbz(rho, temp, qpr, qps, qpg,
718  1, 1, 1, 1);
719  max_dbz = amrex::max(max_dbz, dbz);
720  }
721 
722  // Store max_dbz into *all* levels for this (i,j)
723  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
724  rfab(i, j, k, dcomp) = max_dbz;
725  }
726  });
727 }
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:19
for(int i=0;i< m_num_species;i++)
Definition: ERF_InitCustomPert_MultiSpeciesBubble.H:52

Referenced by ERF::compute_tag_field(), and ERF::FillPlot3DVars().

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

◆ erf_dermoisttemp() [1/2]

void derived::erf_dermoisttemp ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dermoisttemp() [2/2]

void derived::erf_dermoisttemp ( const Box &  bx,
FArrayBox &  derfab,
int  ,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)
382 {
383  auto const dat = datfab.array();
384  auto tfab = derfab.array();
385 
386  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
387  {
388  const Real rho = dat(i, j, k, Rho_comp);
389  const Real rhotheta = dat(i, j, k, RhoTheta_comp);
390  AMREX_ALWAYS_ASSERT(rhotheta > Real(0.0));
391  const Real qv = dat(i, j, k, RhoQ1_comp) / rho;
392  tfab(i,j,k) = getTgivenRandRTh(rho,rhotheta,qv);
393  });
394 }
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
#define Rho_comp
Definition: ERF_IndexDefines.H:61
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:62
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:78
@ rho
Definition: ERF_Kessler.H:25
@ qv
Definition: ERF_Kessler.H:31

Referenced by ERF::FillPlot3DVars(), WriteBndryPlanes::write_planes(), and ERF::WriteSubvolume().

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

◆ erf_dermucape() [1/2]

void derived::erf_dermucape ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dermucape() [2/2]

void derived::erf_dermucape ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int   
)
929 {
930  AMREX_ALWAYS_ASSERT(dcomp == 0);
931  AMREX_ALWAYS_ASSERT(ncomp == 1);
932 
933  // The parcel search and the buoyancy integration must run over the entire column,
934  // so the incoming box must span the column
935  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
936  "mucape requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
937 
938  // Take the vertical extent from the domain rather than from the incoming box so that
939  // this is a whole-column calculation even if the box is ever tiled in z again
940  const int klo_col = geomdata.Domain().smallEnd(2);
941  const int khi_col = geomdata.Domain().bigEnd(2);
942 
943  auto const dat = datfab.array();
944  auto dfab = derfab.array();
945  auto z_arr = zcc_fab.array();
946  const int ncons = datfab.nComp();
947 
948  Box b2d = bx;
949  b2d.setSmall(2,0);
950  b2d.setBig(2,0);
951 
952  ParallelFor(b2d, [=]
953  AMREX_GPU_DEVICE(int i, int j, int) noexcept
954  {
955  Real mucape = Real(0);
956  int klo = klo_col;
957  int khi = khi_col;
958 
959  if (ncons > RhoQ1_comp) {
960  Real p_sfc = Real(0);
961  for (int k = klo; k <= khi; ++k) {
962  Real rho = dat(i,j,k,Rho_comp);
963  if (rho <= Real(0)) { continue; }
964  Real qv = amrex::max(Real(0), dat(i,j,k,RhoQ1_comp) / rho);
965  p_sfc = amrex::max(p_sfc, getPgivenRTh(dat(i,j,k,RhoTheta_comp), qv));
966  }
967 
968  if (p_sfc > mucape_search_depth_pa()) {
969  Real p_search_min = p_sfc - mucape_search_depth_pa();
970 
971  for (int ks = klo; ks < khi; ++ks) {
972  Real rho_src = dat(i,j,ks,Rho_comp);
973  if (rho_src <= Real(0)) { continue; }
974 
975  Real qv_src = amrex::max(Real(0), dat(i,j,ks,RhoQ1_comp) / rho_src);
976  Real rt_src = dat(i,j,ks,RhoTheta_comp);
977  Real p_src = getPgivenRTh(rt_src, qv_src);
978 
979  if (p_src < p_search_min) { continue; }
980 
981  Real T_src = getTgivenRandRTh(rho_src, rt_src, qv_src);
982  if (T_src <= Real(0)) { continue; }
983 
984  Real Td_src = mucape_dewpoint_temperature(p_src, qv_src, T_src);
985  Real Tlcl = mucape_lcl_temperature(T_src, Td_src);
986  Real plcl = p_src * std::pow(Tlcl / T_src, CpoRd);
987  plcl = amrex::min(p_src, amrex::max(plcl, mucape_min_pressure_pa()));
988 
989  Real theta_src = getThgivenTandP(T_src, p_src, RdoCp);
990 
991  Real candidate_cape = Real(0);
992  Real z_prev = z_arr(i,j,ks);
993  Real b_prev = Real(0);
994 
995  bool saturated = false;
996  Real T_sat_prev = Tlcl;
997  Real p_sat_prev = plcl;
998 
999  for (int k = ks + 1; k <= khi; ++k) {
1000  Real rho_env = dat(i,j,k,Rho_comp);
1001  if (rho_env <= Real(0)) { continue; }
1002 
1003  Real qv_env = amrex::max(Real(0), dat(i,j,k,RhoQ1_comp) / rho_env);
1004  Real rt_env = dat(i,j,k,RhoTheta_comp);
1005  Real p_env = getPgivenRTh(rt_env, qv_env);
1006  Real T_env = getTgivenRandRTh(rho_env, rt_env, qv_env);
1007  Real Tv_env = mucape_virtual_temperature(T_env, qv_env);
1008  Real z_env = z_arr(i,j,k);
1009 
1010  Real T_parcel;
1011  Real qv_parcel;
1012 
1013  if (p_env >= plcl) {
1014  T_parcel = getTgivenPandTh(p_env, theta_src, RdoCp);
1015  qv_parcel = qv_src;
1016  } else {
1017  if (!saturated) {
1018  saturated = true;
1019  T_sat_prev = Tlcl;
1020  p_sat_prev = plcl;
1021  }
1022 
1023  if (p_env < p_sat_prev) {
1024  T_sat_prev = mucape_integrate_saturated_temperature(T_sat_prev, p_sat_prev, p_env);
1025  p_sat_prev = p_env;
1026  }
1027 
1028  T_parcel = T_sat_prev;
1029  qv_parcel = mucape_qsat(T_parcel, p_env);
1030  }
1031 
1032  Real Tv_parcel = mucape_virtual_temperature(T_parcel, qv_parcel);
1033  Real buoyancy = CONST_GRAV * (Tv_parcel - Tv_env) /
1034  amrex::max(Tv_env, mucape_min_temperature());
1035 
1036  candidate_cape += mucape_positive_area(b_prev, buoyancy, z_env - z_prev);
1037  b_prev = buoyancy;
1038  z_prev = z_env;
1039  }
1040 
1041  mucape = amrex::max(mucape, candidate_cape);
1042  }
1043  }
1044  }
1045 
1046  for (int k = klo; k <= khi; ++k) {
1047  dfab(i,j,k,dcomp) = mucape;
1048  }
1049  });
1050 }
constexpr amrex::Real CpoRd
Definition: ERF_Constants.H:58
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:72
constexpr amrex::Real RdoCp
Definition: ERF_Constants.H:57
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getThgivenTandP(const amrex::Real T, const amrex::Real P, const amrex::Real rdOcp)
Definition: ERF_EOS.H:18
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getPgivenRTh(const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:81
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
const int khi
Definition: ERF_InitCustomPert_Bubble.H:25
@ ks
Definition: ERF_SLM.H:76

Referenced by ERF::FillPlot3DVars(), and ERF::WriteSubvolume().

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

◆ erf_dernull() [1/2]

void derived::erf_dernull ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dernull() [2/2]

void derived::erf_dernull ( const Box &  ,
FArrayBox &  ,
int  ,
int  ,
const FArrayBox &  ,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)

Placeholder function that does nothing

305 { }

Referenced by ERF::FillPlot3DVars(), and ERF::WriteSubvolume().

Here is the caller graph for this function:

◆ erf_derprecipitable() [1/2]

void derived::erf_derprecipitable ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_derprecipitable() [2/2]

void derived::erf_derprecipitable ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int   
)
881 {
882  AMREX_ALWAYS_ASSERT(dcomp == 0);
883 
884  // This is a vertical integral, so the incoming box must span the column
885  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
886  "precipitable requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
887 
888  auto const dat = datfab.array(); // cell-centered state vector
889  auto dfab = derfab.array(); // integral of qv to define precipitable water
890 
891  // Collapse to i,j box (ignore vertical for now)
892  Box b2d = makeSlab(bx,2,0);
893 
894  auto z_arr = zcc_fab.array(); // cell-centered height z
895 
896  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept
897  {
898  Real integral_qv = Real(0.0);
899 
900  for (int k = 0; k <= bx.bigEnd(2); ++k)
901  {
902  Real z_hi = myhalf * (z_arr(i,j,k+1) + z_arr(i,j,k));
903  Real z_lo = myhalf * (z_arr(i,j,k-1) + z_arr(i,j,k));
904  Real dz = z_hi - z_lo;
905 
906  Real rhoQ1 = dat(i, j, k, RhoQ1_comp);
907 
908  integral_qv += rhoQ1 * dz;
909  }
910 
911  // Store vertical integral into *all* levels for this (i,j)
912  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
913  dfab(i, j, k, dcomp) = integral_qv;
914  }
915  });
916 }

Referenced by ERF::FillPlot3DVars(), and ERF::WriteSubvolume().

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

◆ erf_derreflectivity() [1/2]

void derived::erf_derreflectivity ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_derreflectivity() [2/2]

void derived::erf_derreflectivity ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)
655 {
656  AMREX_ALWAYS_ASSERT(dcomp == 0);
657 
658  auto const dat = datfab.array(); // cell-centered state vector
659  auto rfab = derfab.array(); // cell-centered reflectivity
660 
661  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
662  {
663  Real rho = dat(i,j,k,Rho_comp);
664  Real qv = std::max(Real(0.0),dat(i,j,k,RhoQ1_comp)/rho);
665  Real qpr = std::max(Real(0.0),dat(i,j,k,RhoQ4_comp)/rho);
666  Real qps = std::max(Real(0.0),dat(i,j,k,RhoQ5_comp)/rho);
667  Real qpg = std::max(Real(0.0),dat(i,j,k,RhoQ6_comp)/rho);
668 
669  Real temp = getTgivenRandRTh(rho, dat(i,j,k,RhoTheta_comp), qv);
670 
671  rfab(i, j, k, dcomp) = compute_max_reflectivity_dbz(rho, temp, qpr, qps, qpg,
672  1, 1, 1, 1);
673  });
674 }
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:81
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:83
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:82
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real compute_max_reflectivity_dbz(amrex::Real rho_air, amrex::Real tmk, amrex::Real qra, amrex::Real qsn, amrex::Real qgr, int in0r, int in0s, int in0g, int iliqskin)
Definition: ERF_StormDiagnostics.H:13
@ qpg
Definition: ERF_Morrison.H:44
@ qps
Definition: ERF_Morrison.H:43
@ qpr
Definition: ERF_Morrison.H:42

Referenced by ERF::FillPlot3DVars().

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

◆ erf_derrhodivide() [1/2]

void derived::erf_derrhodivide ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
const amrex::FArrayBox &  datfab,
const int  scalar_index 
)

◆ erf_derrhodivide() [2/2]

void derived::erf_derrhodivide ( const Box &  bx,
FArrayBox &  derfab,
const FArrayBox &  datfab,
const int  scalar_index 
)

Function to define a derived quantity by dividing by density (analogous to cons_to_prim)

@params[in] bx box on which to divide by density @params[out] derfab array of derived quantity @params[in] datfab array of data used to construct derived quantity @params[in] scalar_index index of quantity to be divided by density

278 {
279  // This routine divides any cell-centered conserved quantity by density
280  auto const dat = datfab.array();
281  auto primitive = derfab.array();
282 
283  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
284  {
285  const Real rho = dat(i, j, k, Rho_comp);
286  const Real conserved = dat(i, j, k, scalar_index);
287  primitive(i,j,k) = conserved / rho;
288  });
289 }

Referenced by erf_derKE(), erf_derscalar(), erf_dertheta(), and WriteBndryPlanes::write_planes().

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

◆ erf_derscalar() [1/2]

void derived::erf_derscalar ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_derscalar() [2/2]

void derived::erf_derscalar ( const Box &  bx,
FArrayBox &  derfab,
int  ,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)

Function to define a scalar s by dividing (rho s) by rho

@params[in] bx box on which to divide by density @params[out] derfab array of derived quantity – here it holds scalar s @params[in] datfab array of data used to construct derived quantity

436 {
437  erf_derrhodivide(bx, derfab, datfab, RhoScalar_comp);
438 }
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:65

Referenced by ERF::compute_tag_field(), ERF::FillPlot3DVars(), and ERF::WriteSubvolume().

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

◆ erf_dersoundspeed() [1/2]

void derived::erf_dersoundspeed ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dersoundspeed() [2/2]

void derived::erf_dersoundspeed ( const Box &  bx,
FArrayBox &  derfab,
int  ,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)

Function to define the sound speed by calling an EOS routine

@params[in] bx box on which to divide by density @params[out] derfab array of derived quantity – here it holds pressure @params[in] datfab array of data used to construct derived quantity

325 {
326  auto const dat = datfab.array();
327  auto cfab = derfab.array();
328 
329  // NOTE: we compute the soundspeed of dry air -- we do not account for any moisture effects here
330  Real qv = Real(0.0);
331 
332  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
333  {
334  const Real rhotheta = dat(i, j, k, RhoTheta_comp);
335  const Real rho = dat(i, j, k, Rho_comp);
336  AMREX_ALWAYS_ASSERT(rhotheta > 0);
337  cfab(i,j,k) = std::sqrt(Gamma * getPgivenRTh(rhotheta,qv) / rho);
338  });
339 }
constexpr amrex::Real Gamma
Definition: ERF_Constants.H:70

Referenced by ERF::FillPlot3DVars(), and ERF::WriteSubvolume().

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

◆ erf_dertemp() [1/2]

void derived::erf_dertemp ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dertemp() [2/2]

void derived::erf_dertemp ( const Box &  bx,
FArrayBox &  derfab,
int  ,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)

Function to define the temperature by calling an EOS routine

@params[in] bx box on which to divide by density @params[out] derfab array of derived quantity – here it holds pressure @params[in] datfab array of data used to construct derived quantity

359 {
360  auto const dat = datfab.array();
361  auto tfab = derfab.array();
362 
363  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
364  {
365  const Real rho = dat(i, j, k, Rho_comp);
366  const Real rhotheta = dat(i, j, k, RhoTheta_comp);
367  AMREX_ALWAYS_ASSERT(rhotheta > Real(0.0));
368  tfab(i,j,k) = getTgivenRandRTh(rho,rhotheta);
369  });
370 }

Referenced by ERF::FillPlot3DVars(), WriteBndryPlanes::write_planes(), and ERF::WriteSubvolume().

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

◆ erf_dertheta() [1/2]

void derived::erf_dertheta ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level 
)

◆ erf_dertheta() [2/2]

void derived::erf_dertheta ( const Box &  bx,
FArrayBox &  derfab,
int  ,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  ,
Real  ,
const int *  ,
const int   
)

Function to define the potential temperature by calling an EOS routine

@params[in] bx box on which to divide by density @params[out] derfab array of derived quantity – here it holds pressure @params[in] datfab array of data used to construct derived quantity

414 {
415  erf_derrhodivide(bx, derfab, datfab, RhoTheta_comp);
416 }

Referenced by ERF::compute_tag_field(), ERF::FillPlot3DVars(), and ERF::WriteSubvolume().

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

◆ erf_dervortstretching() [1/2]

void derived::erf_dervortstretching ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level,
const amrex::FArrayBox *  mfx_fab = nullptr,
const amrex::FArrayBox *  mfy_fab = nullptr 
)

◆ erf_dervortstretching() [2/2]

void derived::erf_dervortstretching ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int  ,
const FArrayBox *  mfx_fab,
const FArrayBox *  mfy_fab 
)
777 {
778  AMREX_ALWAYS_ASSERT(dcomp == 0);
779 
780  auto const dat = datfab.array(); // cell-centered velocity
781  auto dfab = derfab.array(); // cell-centered vorticity stretching
782  auto z_arr = zcc_fab.array(); // cell-centered height z
783  auto mfx = mf_array(mfx_fab);
784  auto mfy = mf_array(mfy_fab);
785 
786  const Real two_dx = two * geomdata.CellSize(0);
787  const Real two_dy = two * geomdata.CellSize(1);
788 
789  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
790  {
791  Real vortz = cc_vort_z(i,j,k,dat,z_arr,mfx,mfy,two_dx,two_dy); // dv/dx - du/dy
792 
793  // As in the vorticity components, the vertical derivative uses the
794  // physical heights of the cell centers so that it is correct on a
795  // vertically stretched mesh
796  Real two_dz = z_arr(i,j,k+1) - z_arr(i,j,k-1);
797  Real dwdz = (dat(i,j,k+1,2) - dat(i,j,k-1,2)) / two_dz;
798 
799  // Stretching term in the vertical vorticity equation
800  dfab(i,j,k,dcomp) = vortz * dwdz;
801  });
802 }

Referenced by ERF::FillPlot3DVars().

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

◆ erf_dervortx() [1/2]

void derived::erf_dervortx ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level,
const amrex::FArrayBox *  mfx_fab = nullptr,
const amrex::FArrayBox *  mfy_fab = nullptr 
)

◆ erf_dervortx() [2/2]

void derived::erf_dervortx ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int  ,
const FArrayBox *  ,
const FArrayBox *  mfy_fab 
)
475 {
476  AMREX_ALWAYS_ASSERT(dcomp == 0);
477  AMREX_ALWAYS_ASSERT(ncomp == 1);
478 
479  auto const dat = datfab.array(); // cell-centered velocity
480  auto tfab = derfab.array(); // cell-centered vorticity x-component
481  auto z_arr = zcc_fab.array(); // cell-centered height z
482  auto mfy = mf_array(mfy_fab);
483 
484  const Real two_dy = two * geomdata.CellSize(1);
485 
486  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
487  {
488  tfab(i,j,k,dcomp) = cc_vort_x(i,j,k,dat,z_arr,mfy,two_dy); // dw/dy - dv/dz
489  });
490 }

Referenced by ERF::FillPlot3DVars().

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

◆ erf_dervorty() [1/2]

void derived::erf_dervorty ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level,
const amrex::FArrayBox *  mfx_fab = nullptr,
const amrex::FArrayBox *  mfy_fab = nullptr 
)

◆ erf_dervorty() [2/2]

void derived::erf_dervorty ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int  ,
const FArrayBox *  mfx_fab,
const FArrayBox *   
)
505 {
506  AMREX_ALWAYS_ASSERT(dcomp == 0);
507  AMREX_ALWAYS_ASSERT(ncomp == 1);
508 
509  auto const dat = datfab.array(); // cell-centered velocity
510  auto tfab = derfab.array(); // cell-centered vorticity y-component
511  auto z_arr = zcc_fab.array(); // cell-centered height z
512  auto mfx = mf_array(mfx_fab);
513 
514  const Real two_dx = two * geomdata.CellSize(0);
515 
516  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
517  {
518  tfab(i,j,k,dcomp) = cc_vort_y(i,j,k,dat,z_arr,mfx,two_dx); // du/dz - dw/dx
519  });
520 }

Referenced by ERF::FillPlot3DVars().

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

◆ erf_dervortz() [1/2]

void derived::erf_dervortz ( const amrex::Box &  bx,
amrex::FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const amrex::FArrayBox &  datfab,
const amrex::FArrayBox &  zfab,
const amrex::Geometry &  geomdata,
amrex::Real  time,
const int *  bcrec,
const int  level,
const amrex::FArrayBox *  mfx_fab = nullptr,
const amrex::FArrayBox *  mfy_fab = nullptr 
)

◆ erf_dervortz() [2/2]

void derived::erf_dervortz ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  zcc_fab,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int  ,
const FArrayBox *  mfx_fab,
const FArrayBox *  mfy_fab 
)
535 {
536  AMREX_ALWAYS_ASSERT(dcomp == 0);
537  AMREX_ALWAYS_ASSERT(ncomp == 1);
538 
539  auto const dat = datfab.array(); // cell-centered velocity
540  auto tfab = derfab.array(); // cell-centered vorticity z-component
541  auto z_arr = zcc_fab.array(); // cell-centered height z
542  auto mfx = mf_array(mfx_fab);
543  auto mfy = mf_array(mfy_fab);
544 
545  const Real two_dx = two * geomdata.CellSize(0);
546  const Real two_dy = two * geomdata.CellSize(1);
547 
548  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
549  {
550  tfab(i,j,k,dcomp) = cc_vort_z(i,j,k,dat,z_arr,mfx,mfy,two_dx,two_dy); // dv/dx - du/dy
551  });
552 }

Referenced by ERF::compute_tag_field(), and ERF::FillPlot3DVars().

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