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)
 
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)
 
void erf_dervortz (const Box &bx, FArrayBox &derfab, int dcomp, int ncomp, const FArrayBox &datfab, const FArrayBox &, const Geometry &geomdata, Real, const int *, const int)
 
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)
 
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 &, const Geometry &geomdata, Real, const int *, const int)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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 
)

◆ 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   
)
468 {
469  AMREX_ALWAYS_ASSERT(dcomp == 0);
470  AMREX_ALWAYS_ASSERT(ncomp == 1);
471 
472  auto const dat = datfab.array(); // cell-centered velocity
473  auto tfab = derfab.array(); // cell-centered vorticity x-component
474  auto z_arr = zcc_fab.array(); // cell-centered height z
475 
476  const Real two_dx = two * geomdata.CellSize(0);
477  const Real two_dy = two * geomdata.CellSize(1);
478 
479  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
480  {
481  Real two_dz = z_arr(i,j,k+1) - z_arr(i,j,k-1);
482 
483  Real vortx = (dat(i,j+1,k,2) - dat(i,j-1,k,2)) / two_dy // dw/dy
484  -(dat(i,j,k+1,1) - dat(i,j,k-1,1)) / two_dz; // dv/dz
485  Real vorty = (dat(i,j,k+1,0) - dat(i,j,k-1,0)) / two_dz // du/dz
486  -(dat(i+1,j,k,2) - dat(i-1,j,k,2)) / two_dx; // dw/dx
487  Real vortz = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / two_dx // dv/dx
488  -(dat(i,j+1,k,0) - dat(i,j-1,k,0)) / two_dy; // du/dy
489 
490  tfab(i,j,k,dcomp) = vortx*vortx + vorty*vorty + vortz*vortz;
491  });
492 }
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:31
amrex::Real Real
Definition: ERF_ShocInterface.H:19

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 
)

◆ 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   
)
712 {
713  AMREX_ALWAYS_ASSERT(dcomp == 0);
714 
715  // This is a vertical integral, so the incoming box must span the column
716  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
717  "helicity requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
718 
719  auto const dat = datfab.array(); // cell-centered velocity
720  auto dfab = derfab.array(); // integral of local helicity
721  auto z_arr = zcc_fab.array(); // cell-centered height z
722 
723  const Real dx = geomdata.CellSize(0);
724  const Real dy = geomdata.CellSize(1);
725 
726  // Collapse to i,j box (ignore vertical for now)
727  Box b2d = makeSlab(bx,2,0);
728 
729  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int ) noexcept
730  {
731  Real int_hel = Real(0.0);
732  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k)
733  {
734  Real z = z_arr(i,j,k);
735 
736  // Helicity is defined as integral from 2km to 5km in vertical
737  if (z > Real(2000.0) && z < Real(5000.0)) {
738 
739  Real z_hi = myhalf * (z_arr(i,j,k) + z_arr(i,j,k+1));
740  Real z_lo = myhalf * (z_arr(i,j,k) + z_arr(i,j,k-1));
741  Real dz = z_hi - z_lo;
742 
743  Real vortz = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / (two*dx) // dv/dx
744  - (dat(i,j+1,k,0) - dat(i,j-1,k,0)) / (two*dy); // du/dy
745  Real w = dat(i,j,k,2); // vertical velocity
746 
747  int_hel += vortz * w * dz;
748  }
749  }
750 
751  // Store vertical integral into *all* levels for this (i,j)
752  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
753  dfab(i, j, k, dcomp) = int_hel;
754  }
755  });
756 }
const Real dy
Definition: ERF_InitCustomPert_ABL.H:45
const Real dx
Definition: ERF_InitCustomPert_ABL.H:44
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:34
Real w
Definition: ERF_Plotfile2DInterpolator.cpp:22
@ dz
Definition: ERF_AdvanceWDM6.cpp:272

Referenced by ERF::ErrorEst(), 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

367 {
368  erf_derrhodivide(bx, derfab, datfab, RhoKE_comp);
369 }
#define RhoKE_comp
Definition: ERF_IndexDefines.H:41
void erf_derrhodivide(const Box &bx, FArrayBox &derfab, const FArrayBox &datfab, const int scalar_index)
Definition: ERF_Derive.cpp:183

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 
)

◆ erf_derlocalhelicity() [2/2]

void derived::erf_derlocalhelicity ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int   
)
644 {
645  AMREX_ALWAYS_ASSERT(dcomp == 0);
646 
647  auto const dat = datfab.array(); // cell-centered velocity
648  auto dfab = derfab.array(); // cell-centered local helicity
649 
650  const Real two_dx = Real(2.0)*geomdata.CellSize(0);
651  const Real two_dy = Real(2.0)*geomdata.CellSize(1);
652 
653  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
654  {
655  Real vortz = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / two_dx // dv/dx
656  - (dat(i,j+1,k,0) - dat(i,j-1,k,0)) / two_dy; // du/dy
657  Real w = dat(i,j,k,2);
658 
659  // Helicity
660  dfab(i,j,k,dcomp) = vortz * w;
661  });
662 }

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   
)
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 magvel
511 
512  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
513  {
514  Real u = dat(i,j,k,0);
515  Real v = dat(i,j,k,1);
516  Real w = dat(i,j,k,2);
517  tfab(i,j,k,dcomp) = std::sqrt(u*u + v*v + w*w);
518  });
519 }

Referenced by ERF::ErrorEst(), 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   
)
532 {
533  AMREX_ALWAYS_ASSERT(dcomp == 0);
534  AMREX_ALWAYS_ASSERT(ncomp == 1);
535 
536  auto const dat = datfab.array(); // cell-centered velocity
537  auto tfab = derfab.array(); // cell-centered magvel
538 
539  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
540  {
541  Real u = dat(i,j,k,0);
542  Real v = dat(i,j,k,1);
543  Real w = dat(i,j,k,2);
544  tfab(i,j,k,dcomp) = u*u + v*v + w*w;
545  });
546 }

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   
)
591 {
592  AMREX_ALWAYS_ASSERT(dcomp == 0);
593 
594  // This takes the max over the whole column, so the incoming box must span the column
595  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
596  "max_reflectivity requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
597 
598  auto const dat = datfab.array(); // cell-centered state vector
599  auto rfab = derfab.array(); // cell-centered max reflectivity
600 
601  // Collapse to i,j box (ignore vertical for now)
602  Box b2d = makeSlab(bx,2,0);
603 
604  Real l_bogus_large_value = bogus_large_value;
605 
606  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept
607  {
608  Real max_dbz = -l_bogus_large_value;
609 
610  // find max reflectivity over k
611  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
612 
613  Real rho = dat(i,j,k,Rho_comp);
614  Real qv = std::max(Real(0.0),dat(i,j,k,RhoQ1_comp)/rho);
615  Real qpr = std::max(Real(0.0),dat(i,j,k,RhoQ4_comp)/rho);
616  Real qps = std::max(Real(0.0),dat(i,j,k,RhoQ5_comp)/rho);
617  Real qpg = std::max(Real(0.0),dat(i,j,k,RhoQ6_comp)/rho);
618 
619  Real temp = getTgivenRandRTh(rho, dat(i,j,k,RhoTheta_comp), qv);
620 
621  Real dbz = compute_max_reflectivity_dbz(rho, temp, qpr, qps, qpg,
622  1, 1, 1, 1);
623  max_dbz = amrex::max(max_dbz, dbz);
624  }
625 
626  // Store max_dbz into *all* levels for this (i,j)
627  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
628  rfab(i, j, k, dcomp) = max_dbz;
629  }
630  });
631 }
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:17
for(int i=0;i< m_num_species;i++)
Definition: ERF_InitCustomPert_MultiSpeciesBubble.H:48

Referenced by ERF::ErrorEst(), 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   
)
291 {
292  auto const dat = datfab.array();
293  auto tfab = derfab.array();
294 
295  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
296  {
297  const Real rho = dat(i, j, k, Rho_comp);
298  const Real rhotheta = dat(i, j, k, RhoTheta_comp);
299  AMREX_ALWAYS_ASSERT(rhotheta > Real(0.0));
300  const Real qv = dat(i, j, k, RhoQ1_comp) / rho;
301  tfab(i,j,k) = getTgivenRandRTh(rho,rhotheta,qv);
302  });
303 }
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:39
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:40
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
@ 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   
)
817 {
818  AMREX_ALWAYS_ASSERT(dcomp == 0);
819  AMREX_ALWAYS_ASSERT(ncomp == 1);
820 
821  // The parcel search and the buoyancy integration must run over the entire column,
822  // so the incoming box must span the column
823  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
824  "mucape requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
825 
826  // Take the vertical extent from the domain rather than from the incoming box so that
827  // this is a whole-column calculation even if the box is ever tiled in z again
828  const int klo_col = geomdata.Domain().smallEnd(2);
829  const int khi_col = geomdata.Domain().bigEnd(2);
830 
831  auto const dat = datfab.array();
832  auto dfab = derfab.array();
833  auto z_arr = zcc_fab.array();
834  const int ncons = datfab.nComp();
835 
836  Box b2d = bx;
837  b2d.setSmall(2,0);
838  b2d.setBig(2,0);
839 
840  ParallelFor(b2d, [=]
841  AMREX_GPU_DEVICE(int i, int j, int) noexcept
842  {
843  Real mucape = Real(0);
844  int klo = klo_col;
845  int khi = khi_col;
846 
847  if (ncons > RhoQ1_comp) {
848  Real p_sfc = Real(0);
849  for (int k = klo; k <= khi; ++k) {
850  Real rho = dat(i,j,k,Rho_comp);
851  if (rho <= Real(0)) { continue; }
852  Real qv = amrex::max(Real(0), dat(i,j,k,RhoQ1_comp) / rho);
853  p_sfc = amrex::max(p_sfc, getPgivenRTh(dat(i,j,k,RhoTheta_comp), qv));
854  }
855 
856  if (p_sfc > mucape_search_depth_pa()) {
857  Real p_search_min = p_sfc - mucape_search_depth_pa();
858 
859  for (int ks = klo; ks < khi; ++ks) {
860  Real rho_src = dat(i,j,ks,Rho_comp);
861  if (rho_src <= Real(0)) { continue; }
862 
863  Real qv_src = amrex::max(Real(0), dat(i,j,ks,RhoQ1_comp) / rho_src);
864  Real rt_src = dat(i,j,ks,RhoTheta_comp);
865  Real p_src = getPgivenRTh(rt_src, qv_src);
866 
867  if (p_src < p_search_min) { continue; }
868 
869  Real T_src = getTgivenRandRTh(rho_src, rt_src, qv_src);
870  if (T_src <= Real(0)) { continue; }
871 
872  Real Td_src = mucape_dewpoint_temperature(p_src, qv_src, T_src);
873  Real Tlcl = mucape_lcl_temperature(T_src, Td_src);
874  Real plcl = p_src * std::pow(Tlcl / T_src, CpoRd);
875  plcl = amrex::min(p_src, amrex::max(plcl, mucape_min_pressure_pa()));
876 
877  Real theta_src = getThgivenTandP(T_src, p_src, RdoCp);
878 
879  Real candidate_cape = Real(0);
880  Real z_prev = z_arr(i,j,ks);
881  Real b_prev = Real(0);
882 
883  bool saturated = false;
884  Real T_sat_prev = Tlcl;
885  Real p_sat_prev = plcl;
886 
887  for (int k = ks + 1; k <= khi; ++k) {
888  Real rho_env = dat(i,j,k,Rho_comp);
889  if (rho_env <= Real(0)) { continue; }
890 
891  Real qv_env = amrex::max(Real(0), dat(i,j,k,RhoQ1_comp) / rho_env);
892  Real rt_env = dat(i,j,k,RhoTheta_comp);
893  Real p_env = getPgivenRTh(rt_env, qv_env);
894  Real T_env = getTgivenRandRTh(rho_env, rt_env, qv_env);
895  Real Tv_env = mucape_virtual_temperature(T_env, qv_env);
896  Real z_env = z_arr(i,j,k);
897 
898  Real T_parcel;
899  Real qv_parcel;
900 
901  if (p_env >= plcl) {
902  T_parcel = getTgivenPandTh(p_env, theta_src, RdoCp);
903  qv_parcel = qv_src;
904  } else {
905  if (!saturated) {
906  saturated = true;
907  T_sat_prev = Tlcl;
908  p_sat_prev = plcl;
909  }
910 
911  if (p_env < p_sat_prev) {
912  T_sat_prev = mucape_integrate_saturated_temperature(T_sat_prev, p_sat_prev, p_env);
913  p_sat_prev = p_env;
914  }
915 
916  T_parcel = T_sat_prev;
917  qv_parcel = mucape_qsat(T_parcel, p_env);
918  }
919 
920  Real Tv_parcel = mucape_virtual_temperature(T_parcel, qv_parcel);
921  Real buoyancy = CONST_GRAV * (Tv_parcel - Tv_env) /
922  amrex::max(Tv_env, mucape_min_temperature());
923 
924  candidate_cape += mucape_positive_area(b_prev, buoyancy, z_env - z_prev);
925  b_prev = buoyancy;
926  z_prev = z_env;
927  }
928 
929  mucape = amrex::max(mucape, candidate_cape);
930  }
931  }
932  }
933 
934  for (int k = klo; k <= khi; ++k) {
935  dfab(i,j,k,dcomp) = mucape;
936  }
937  });
938 }
constexpr amrex::Real CpoRd
Definition: ERF_Constants.H:42
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:56
constexpr amrex::Real RdoCp
Definition: ERF_Constants.H:41
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 klo
Definition: ERF_InitCustomPert_ABL.H:75
const int khi
Definition: ERF_InitCustomPert_Bubble.H:21

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

214 { }

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   
)
769 {
770  AMREX_ALWAYS_ASSERT(dcomp == 0);
771 
772  // This is a vertical integral, so the incoming box must span the column
773  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
774  "precipitable requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
775 
776  auto const dat = datfab.array(); // cell-centered state vector
777  auto dfab = derfab.array(); // integral of qv to define precipitable water
778 
779  // Collapse to i,j box (ignore vertical for now)
780  Box b2d = makeSlab(bx,2,0);
781 
782  auto z_arr = zcc_fab.array(); // cell-centered height z
783 
784  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept
785  {
786  Real integral_qv = Real(0.0);
787 
788  for (int k = 0; k <= bx.bigEnd(2); ++k)
789  {
790  Real z_hi = myhalf * (z_arr(i,j,k+1) + z_arr(i,j,k));
791  Real z_lo = myhalf * (z_arr(i,j,k-1) + z_arr(i,j,k));
792  Real dz = z_hi - z_lo;
793 
794  Real rhoQ1 = dat(i, j, k, RhoQ1_comp);
795 
796  integral_qv += rhoQ1 * dz;
797  }
798 
799  // Store vertical integral into *all* levels for this (i,j)
800  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
801  dfab(i, j, k, dcomp) = integral_qv;
802  }
803  });
804 }

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   
)
559 {
560  AMREX_ALWAYS_ASSERT(dcomp == 0);
561 
562  auto const dat = datfab.array(); // cell-centered state vector
563  auto rfab = derfab.array(); // cell-centered reflectivity
564 
565  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
566  {
567  Real rho = dat(i,j,k,Rho_comp);
568  Real qv = std::max(Real(0.0),dat(i,j,k,RhoQ1_comp)/rho);
569  Real qpr = std::max(Real(0.0),dat(i,j,k,RhoQ4_comp)/rho);
570  Real qps = std::max(Real(0.0),dat(i,j,k,RhoQ5_comp)/rho);
571  Real qpg = std::max(Real(0.0),dat(i,j,k,RhoQ6_comp)/rho);
572 
573  Real temp = getTgivenRandRTh(rho, dat(i,j,k,RhoTheta_comp), qv);
574 
575  rfab(i, j, k, dcomp) = compute_max_reflectivity_dbz(rho, temp, qpr, qps, qpg,
576  1, 1, 1, 1);
577  });
578 }
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:48
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:50
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:49
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:43
@ qps
Definition: ERF_Morrison.H:42
@ qpr
Definition: ERF_Morrison.H:41

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

187 {
188  // This routine divides any cell-centered conserved quantity by density
189  auto const dat = datfab.array();
190  auto primitive = derfab.array();
191 
192  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
193  {
194  const Real rho = dat(i, j, k, Rho_comp);
195  const Real conserved = dat(i, j, k, scalar_index);
196  primitive(i,j,k) = conserved / rho;
197  });
198 }

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

345 {
346  erf_derrhodivide(bx, derfab, datfab, RhoScalar_comp);
347 }
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:43

Referenced by ERF::ErrorEst(), 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

234 {
235  auto const dat = datfab.array();
236  auto cfab = derfab.array();
237 
238  // NOTE: we compute the soundspeed of dry air -- we do not account for any moisture effects here
239  Real qv = Real(0.0);
240 
241  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
242  {
243  const Real rhotheta = dat(i, j, k, RhoTheta_comp);
244  const Real rho = dat(i, j, k, Rho_comp);
245  AMREX_ALWAYS_ASSERT(rhotheta > 0);
246  cfab(i,j,k) = std::sqrt(Gamma * getPgivenRTh(rhotheta,qv) / rho);
247  });
248 }
constexpr amrex::Real Gamma
Definition: ERF_Constants.H:54

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

268 {
269  auto const dat = datfab.array();
270  auto tfab = derfab.array();
271 
272  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
273  {
274  const Real rho = dat(i, j, k, Rho_comp);
275  const Real rhotheta = dat(i, j, k, RhoTheta_comp);
276  AMREX_ALWAYS_ASSERT(rhotheta > Real(0.0));
277  tfab(i,j,k) = getTgivenRandRTh(rho,rhotheta);
278  });
279 }

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

323 {
324  erf_derrhodivide(bx, derfab, datfab, RhoTheta_comp);
325 }

Referenced by ERF::ErrorEst(), 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 
)

◆ 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   
)
675 {
676  AMREX_ALWAYS_ASSERT(dcomp == 0);
677 
678  auto const dat = datfab.array(); // cell-centered velocity
679  auto dfab = derfab.array(); // cell-centered vorticity stretching
680  auto z_arr = zcc_fab.array(); // cell-centered height z
681 
682  const Real two_dx = two * geomdata.CellSize(0);
683  const Real two_dy = two * geomdata.CellSize(1);
684 
685  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
686  {
687  Real vortz = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / two_dx // dv/dx
688  - (dat(i,j+1,k,0) - dat(i,j-1,k,0)) / two_dy; // du/dy
689 
690  // As in the vorticity components, the vertical derivative uses the
691  // physical heights of the cell centers so that it is correct on a
692  // vertically stretched mesh
693  Real two_dz = z_arr(i,j,k+1) - z_arr(i,j,k-1);
694  Real dwdz = (dat(i,j,k+1,2) - dat(i,j,k-1,2)) / two_dz;
695 
696  // Stretching term in the vertical vorticity equation
697  dfab(i,j,k,dcomp) = vortz * dwdz;
698  });
699 }

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 
)

◆ 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   
)
382 {
383  AMREX_ALWAYS_ASSERT(dcomp == 0);
384  AMREX_ALWAYS_ASSERT(ncomp == 1);
385 
386  auto const dat = datfab.array(); // cell-centered velocity
387  auto tfab = derfab.array(); // cell-centered vorticity x-component
388  auto z_arr = zcc_fab.array(); // cell-centered height z
389 
390  const Real two_dy = two * geomdata.CellSize(1);
391 
392  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
393  {
394  Real two_dz = z_arr(i,j,k+1) - z_arr(i,j,k-1);
395  tfab(i,j,k,dcomp) = (dat(i,j+1,k,2) - dat(i,j-1,k,2)) / two_dy // dw/dy
396  - (dat(i,j,k+1,1) - dat(i,j,k-1,1)) / two_dz; // dv/dz
397  });
398 }

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 
)

◆ 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   
)
411 {
412  AMREX_ALWAYS_ASSERT(dcomp == 0);
413  AMREX_ALWAYS_ASSERT(ncomp == 1);
414 
415  auto const dat = datfab.array(); // cell-centered velocity
416  auto tfab = derfab.array(); // cell-centered vorticity y-component
417  auto z_arr = zcc_fab.array(); // cell-centered height z
418 
419  const Real two_dx = two * geomdata.CellSize(0);
420 
421  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
422  {
423  Real two_dz = z_arr(i,j,k+1) - z_arr(i,j,k-1);
424  tfab(i,j,k,dcomp) = (dat(i,j,k+1,0) - dat(i,j,k-1,0)) / two_dz // du/dz
425  - (dat(i+1,j,k,2) - dat(i-1,j,k,2)) / two_dx; // dw/dx
426  });
427 }

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 
)

◆ erf_dervortz() [2/2]

void derived::erf_dervortz ( const Box &  bx,
FArrayBox &  derfab,
int  dcomp,
int  ncomp,
const FArrayBox &  datfab,
const FArrayBox &  ,
const Geometry &  geomdata,
Real  ,
const int *  ,
const int   
)
440 {
441  AMREX_ALWAYS_ASSERT(dcomp == 0);
442  AMREX_ALWAYS_ASSERT(ncomp == 1);
443 
444  auto const dat = datfab.array(); // cell-centered velocity
445  auto tfab = derfab.array(); // cell-centered vorticity z-component
446 
447  const Real dx = geomdata.CellSize(0);
448  const Real dy = geomdata.CellSize(1);
449 
450  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
451  {
452  tfab(i,j,k,dcomp) = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / (two*dx) // dv/dx
453  - (dat(i,j+1,k,0) - dat(i,j-1,k,0)) / (two*dy); // du/dy
454  });
455 }

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

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