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_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_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   
)
467 {
468  AMREX_ALWAYS_ASSERT(dcomp == 0);
469  AMREX_ALWAYS_ASSERT(ncomp == 1);
470 
471  auto const dat = datfab.array(); // cell-centered velocity
472  auto tfab = derfab.array(); // cell-centered vorticity x-component
473  auto z_arr = zcc_fab.array(); // cell-centered height z
474 
475  const Real two_dx = two * geomdata.CellSize(0);
476  const Real two_dy = two * geomdata.CellSize(1);
477 
478  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
479  {
480  Real two_dz = z_arr(i,j,k+1) - z_arr(i,j,k-1);
481 
482  Real vortx = (dat(i,j+1,k,2) - dat(i,j-1,k,2)) / two_dy // dw/dy
483  -(dat(i,j,k+1,1) - dat(i,j,k-1,1)) / two_dz; // dv/dz
484  Real vorty = (dat(i,j,k+1,0) - dat(i,j,k-1,0)) / two_dz // du/dz
485  -(dat(i+1,j,k,2) - dat(i-1,j,k,2)) / two_dx; // dw/dx
486  Real vortz = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / two_dx // dv/dx
487  -(dat(i,j+1,k,0) - dat(i,j-1,k,0)) / two_dy; // du/dy
488 
489  tfab(i,j,k,dcomp) = vortx*vortx + vorty*vorty + vortz*vortz;
490  });
491 }
constexpr amrex::Real two
Definition: ERF_Constants.H:10
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);})
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   
)
674 {
675  AMREX_ALWAYS_ASSERT(dcomp == 0);
676 
677  // This is a vertical integral, so the incoming box must span the column
678  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
679  "helicity requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
680 
681  auto const dat = datfab.array(); // cell-centered velocity
682  auto dfab = derfab.array(); // integral of local helicity
683  auto z_arr = zcc_fab.array(); // cell-centered height z
684 
685  const Real dx = geomdata.CellSize(0);
686  const Real dy = geomdata.CellSize(1);
687 
688  // Collapse to i,j box (ignore vertical for now)
689  Box b2d = makeSlab(bx,2,0);
690 
691  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int ) noexcept
692  {
693  Real int_hel = Real(0.0);
694  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k)
695  {
696  Real z = z_arr(i,j,k);
697 
698  // Helicity is defined as integral from 2km to 5km in vertical
699  if (z > Real(2000.0) && z < Real(5000.0)) {
700 
701  Real z_hi = myhalf * (z_arr(i,j,k) + z_arr(i,j,k+1));
702  Real z_lo = myhalf * (z_arr(i,j,k) + z_arr(i,j,k-1));
703  Real dz = z_hi - z_lo;
704 
705  Real vortz = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / (two*dx) // dv/dx
706  - (dat(i,j+1,k,0) - dat(i,j-1,k,0)) / (two*dy); // du/dy
707  Real w = dat(i,j,k,2); // vertical velocity
708 
709  int_hel += vortz * w * dz;
710  }
711  }
712 
713  // Store vertical integral into *all* levels for this (i,j)
714  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
715  dfab(i, j, k, dcomp) = int_hel;
716  }
717  });
718 }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
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")
Real w
Definition: ERF_Plotfile2DInterpolator.cpp:22
@ dz
Definition: ERF_AdvanceWDM6.cpp:270

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

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

366 {
367  erf_derrhodivide(bx, derfab, datfab, RhoKE_comp);
368 }
#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:182

Referenced by ERF::Write3DPlotFile(), 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   
)
643 {
644  AMREX_ALWAYS_ASSERT(dcomp == 0);
645 
646  auto const dat = datfab.array(); // cell-centered velocity
647  auto dfab = derfab.array(); // cell-centered local helicity
648 
649  const Real two_dx = Real(2.0)*geomdata.CellSize(0);
650  const Real two_dy = Real(2.0)*geomdata.CellSize(1);
651 
652  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
653  {
654  Real vortz = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / two_dx // dv/dx
655  - (dat(i,j+1,k,0) - dat(i,j-1,k,0)) / two_dy; // du/dy
656  Real w = dat(i,j,k,2);
657 
658  // Helicity
659  dfab(i,j,k,dcomp) = vortz * w;
660  });
661 }

Referenced by ERF::Write3DPlotFile().

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   
)
504 {
505  AMREX_ALWAYS_ASSERT(dcomp == 0);
506  AMREX_ALWAYS_ASSERT(ncomp == 1);
507 
508  auto const dat = datfab.array(); // cell-centered velocity
509  auto tfab = derfab.array(); // cell-centered magvel
510 
511  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
512  {
513  Real u = dat(i,j,k,0);
514  Real v = dat(i,j,k,1);
515  Real w = dat(i,j,k,2);
516  tfab(i,j,k,dcomp) = std::sqrt(u*u + v*v + w*w);
517  });
518 }

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

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

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

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

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   
)
290 {
291  auto const dat = datfab.array();
292  auto tfab = derfab.array();
293 
294  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
295  {
296  const Real rho = dat(i, j, k, Rho_comp);
297  const Real rhotheta = dat(i, j, k, RhoTheta_comp);
298  AMREX_ALWAYS_ASSERT(rhotheta > Real(0.0));
299  const Real qv = dat(i, j, k, RhoQ1_comp) / rho;
300  tfab(i,j,k) = getTgivenRandRTh(rho,rhotheta,qv);
301  });
302 }
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:24
@ qv
Definition: ERF_Kessler.H:30

Referenced by ERF::Write3DPlotFile(), 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   
)
779 {
780  AMREX_ALWAYS_ASSERT(dcomp == 0);
781  AMREX_ALWAYS_ASSERT(ncomp == 1);
782 
783  // The parcel search and the buoyancy integration must run over the entire column,
784  // so the incoming box must span the column
785  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
786  "mucape requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
787 
788  // Take the vertical extent from the domain rather than from the incoming box so that
789  // this is a whole-column calculation even if the box is ever tiled in z again
790  const int klo_col = geomdata.Domain().smallEnd(2);
791  const int khi_col = geomdata.Domain().bigEnd(2);
792 
793  auto const dat = datfab.array();
794  auto dfab = derfab.array();
795  auto z_arr = zcc_fab.array();
796  const int ncons = datfab.nComp();
797 
798  Box b2d = bx;
799  b2d.setSmall(2,0);
800  b2d.setBig(2,0);
801 
802  ParallelFor(b2d, [=]
803  AMREX_GPU_DEVICE(int i, int j, int) noexcept
804  {
805  Real mucape = Real(0);
806  int klo = klo_col;
807  int khi = khi_col;
808 
809  if (ncons > RhoQ1_comp) {
810  Real p_sfc = Real(0);
811  for (int k = klo; k <= khi; ++k) {
812  Real rho = dat(i,j,k,Rho_comp);
813  if (rho <= Real(0)) { continue; }
814  Real qv = amrex::max(Real(0), dat(i,j,k,RhoQ1_comp) / rho);
815  p_sfc = amrex::max(p_sfc, getPgivenRTh(dat(i,j,k,RhoTheta_comp), qv));
816  }
817 
818  if (p_sfc > mucape_search_depth_pa()) {
819  Real p_search_min = p_sfc - mucape_search_depth_pa();
820 
821  for (int ks = klo; ks < khi; ++ks) {
822  Real rho_src = dat(i,j,ks,Rho_comp);
823  if (rho_src <= Real(0)) { continue; }
824 
825  Real qv_src = amrex::max(Real(0), dat(i,j,ks,RhoQ1_comp) / rho_src);
826  Real rt_src = dat(i,j,ks,RhoTheta_comp);
827  Real p_src = getPgivenRTh(rt_src, qv_src);
828 
829  if (p_src < p_search_min) { continue; }
830 
831  Real T_src = getTgivenRandRTh(rho_src, rt_src, qv_src);
832  if (T_src <= Real(0)) { continue; }
833 
834  Real Td_src = mucape_dewpoint_temperature(p_src, qv_src, T_src);
835  Real Tlcl = mucape_lcl_temperature(T_src, Td_src);
836  Real plcl = p_src * std::pow(Tlcl / T_src, CpoRd);
837  plcl = amrex::min(p_src, amrex::max(plcl, mucape_min_pressure_pa()));
838 
839  Real theta_src = getThgivenTandP(T_src, p_src, RdoCp);
840 
841  Real candidate_cape = Real(0);
842  Real z_prev = z_arr(i,j,ks);
843  Real b_prev = Real(0);
844 
845  bool saturated = false;
846  Real T_sat_prev = Tlcl;
847  Real p_sat_prev = plcl;
848 
849  for (int k = ks + 1; k <= khi; ++k) {
850  Real rho_env = dat(i,j,k,Rho_comp);
851  if (rho_env <= Real(0)) { continue; }
852 
853  Real qv_env = amrex::max(Real(0), dat(i,j,k,RhoQ1_comp) / rho_env);
854  Real rt_env = dat(i,j,k,RhoTheta_comp);
855  Real p_env = getPgivenRTh(rt_env, qv_env);
856  Real T_env = getTgivenRandRTh(rho_env, rt_env, qv_env);
857  Real Tv_env = mucape_virtual_temperature(T_env, qv_env);
858  Real z_env = z_arr(i,j,k);
859 
860  Real T_parcel;
861  Real qv_parcel;
862 
863  if (p_env >= plcl) {
864  T_parcel = getTgivenPandTh(p_env, theta_src, RdoCp);
865  qv_parcel = qv_src;
866  } else {
867  if (!saturated) {
868  saturated = true;
869  T_sat_prev = Tlcl;
870  p_sat_prev = plcl;
871  }
872 
873  if (p_env < p_sat_prev) {
874  T_sat_prev = mucape_integrate_saturated_temperature(T_sat_prev, p_sat_prev, p_env);
875  p_sat_prev = p_env;
876  }
877 
878  T_parcel = T_sat_prev;
879  qv_parcel = mucape_qsat(T_parcel, p_env);
880  }
881 
882  Real Tv_parcel = mucape_virtual_temperature(T_parcel, qv_parcel);
883  Real buoyancy = CONST_GRAV * (Tv_parcel - Tv_env) /
884  amrex::max(Tv_env, mucape_min_temperature());
885 
886  candidate_cape += mucape_positive_area(b_prev, buoyancy, z_env - z_prev);
887  b_prev = buoyancy;
888  z_prev = z_env;
889  }
890 
891  mucape = amrex::max(mucape, candidate_cape);
892  }
893  }
894  }
895 
896  for (int k = klo; k <= khi; ++k) {
897  dfab(i,j,k,dcomp) = mucape;
898  }
899  });
900 }
constexpr amrex::Real CpoRd
Definition: ERF_Constants.H:55
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:64
constexpr amrex::Real RdoCp
Definition: ERF_Constants.H:54
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:21

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

213 { }

Referenced by ERF::Write3DPlotFile(), 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   
)
731 {
732  AMREX_ALWAYS_ASSERT(dcomp == 0);
733 
734  // This is a vertical integral, so the incoming box must span the column
735  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(spans_full_column(bx,geomdata),
736  "precipitable requires boxes spanning the full column: use TileNoZ() at the call site and do not decompose the grid in z");
737 
738  auto const dat = datfab.array(); // cell-centered state vector
739  auto dfab = derfab.array(); // integral of qv to define precipitable water
740 
741  // Collapse to i,j box (ignore vertical for now)
742  Box b2d = makeSlab(bx,2,0);
743 
744  auto z_arr = zcc_fab.array(); // cell-centered height z
745 
746  ParallelFor(b2d, [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept
747  {
748  Real integral_qv = Real(0.0);
749 
750  for (int k = 0; k <= bx.bigEnd(2); ++k)
751  {
752  Real z_hi = myhalf * (z_arr(i,j,k+1) + z_arr(i,j,k));
753  Real z_lo = myhalf * (z_arr(i,j,k-1) + z_arr(i,j,k));
754  Real dz = z_hi - z_lo;
755 
756  Real rhoQ1 = dat(i, j, k, RhoQ1_comp);
757 
758  integral_qv += rhoQ1 * dz;
759  }
760 
761  // Store vertical integral into *all* levels for this (i,j)
762  for (int k = bx.smallEnd(2); k <= bx.bigEnd(2); ++k) {
763  dfab(i, j, k, dcomp) = integral_qv;
764  }
765  });
766 }

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

Referenced by ERF::Write3DPlotFile().

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

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

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

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

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

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

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

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

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

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

Referenced by ERF::ErrorEst(), ERF::Write3DPlotFile(), and ERF::WriteSubvolume().

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

Referenced by ERF::Write3DPlotFile().

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

Referenced by ERF::Write3DPlotFile().

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   
)
439 {
440  AMREX_ALWAYS_ASSERT(dcomp == 0);
441  AMREX_ALWAYS_ASSERT(ncomp == 1);
442 
443  auto const dat = datfab.array(); // cell-centered velocity
444  auto tfab = derfab.array(); // cell-centered vorticity z-component
445 
446  const Real dx = geomdata.CellSize(0);
447  const Real dy = geomdata.CellSize(1);
448 
449  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
450  {
451  tfab(i,j,k,dcomp) = (dat(i+1,j,k,1) - dat(i-1,j,k,1)) / (two*dx) // dv/dx
452  - (dat(i,j+1,k,0) - dat(i,j-1,k,0)) / (two*dy); // du/dy
453  });
454 }

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

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