Initialize density in hydrostatic equilibrium for dry cases.
36 if (!is_constant_dz && !is_stretched_dz) {
38 const int domlo_z = geom.Domain().smallEnd(2);
39 const int domhi_z = geom.Domain().bigEnd(2);
40 if (domhi_z > 255) amrex::Abort(
"1D Arrays are hard-wired to only 256 high");
50 const amrex::Vector<int> bands =
column_bands(rho_hse.boxArray());
52 for (
const int klo_band : bands)
54 if (klo_band != bands[0]) {
58 for ( amrex::MFIter mfi(rho_hse,
TileNoZ()); mfi.isValid(); ++mfi )
60 amrex::Array4<amrex::Real >
rho_arr = rho_hse.array(mfi);
61 amrex::Array4<amrex::Real const> z_cc_arr = z_phys_cc->const_array(mfi);
64 const amrex::Box& tbz = mfi.nodaltilebox(2);
66 b2d.grow(0,1); b2d.grow(1,1);
69 const int klo = tbz.smallEnd(2);
70 const int khi = tbz.bigEnd(2)-1;
72 if (
klo != klo_band) {
continue; }
91 amrex::Array1D<amrex::Real,0,255> r;
92 amrex::Array1D<amrex::Real,0,255>
p;
95 for (
int k =
klo; k <=
khi; k++) {
100 if (
klo == domlo_z) {
103 if (
khi == domhi_z) {
116 const int klo = geom.Domain().smallEnd(2);
117 const int khi = geom.Domain().bigEnd(2);
120 amrex::Vector<amrex::Real>
h_r(
khi+2);
121 amrex::Vector<amrex::Real>
h_p(
khi+2);
123 amrex::Gpu::DeviceVector<amrex::Real>
d_r(
khi+2);
124 amrex::Gpu::DeviceVector<amrex::Real>
d_p(
khi+2);
126 if (is_constant_dz) {
133 amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice,
h_r.begin(),
h_r.end(),
d_r.begin());
134 amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice,
h_p.begin(),
h_p.end(),
d_p.begin());
139 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
141 for ( amrex::MFIter mfi(rho_hse, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi )
143 const amrex::Box& bx = mfi.growntilebox(1);
144 const amrex::Array4<amrex::Real> rho_hse_arr = rho_hse[mfi].array();
147 int kk = std::max(k,0);
148 rho_hse_arr(i,j,k) = r[kk];
Vector< int > column_bands(const BoxArray &ba)
Definition: ERF_ColumnBands.cpp:13
void fill_below_band(MultiFab &mf, int icomp, int ncomp, int klo_band, const IntVect &lateral_ng, const Geometry &geom)
Definition: ERF_ColumnBands.cpp:23
constexpr amrex::Real p_0
Definition: ERF_Constants.H:53
constexpr amrex::Real R_d
Definition: ERF_Constants.H:34
const int klo
Definition: ERF_InitCustomPert_ABL.H:75
const int khi
Definition: ERF_InitCustomPert_Bubble.H:21
Gpu::DeviceVector< Real > d_p(khi+2)
Vector< Real > h_r(khi+2)
Vector< Real > h_p(khi+2)
Gpu::DeviceVector< Real > d_r(khi+2)
AMREX_FORCE_INLINE amrex::IntVect TileNoZ()
Definition: ERF_TileNoZ.H:11
auto rho_arr
Definition: ERF_UpdateWSubsidence_SineMassFlux.H:3
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void init_isentropic_hse_stretched_dz(const amrex::Real &r_sfc, const amrex::Real &theta, amrex::Real *r, amrex::Real *p, const amrex::Real *stretched_dz, const int klo, const int khi)
Definition: ERF_HSEUtils.H:221
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void init_isentropic_hse_constant_dz(const amrex::Real &r_sfc, const amrex::Real &theta, amrex::Real *r, amrex::Real *p, const amrex::Real &dz, const int klo, const int khi)
Definition: ERF_HSEUtils.H:111
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void init_isentropic_hse_terrain(int i, int j, const amrex::Real &r_sfc, const amrex::Real &theta, amrex::Real *r, amrex::Real *p, const amrex::Array4< amrex::Real const > z_cc, const int &klo, const int &khi)
Definition: ERF_HSEUtils.H:333
@ dz
Definition: ERF_AdvanceWDM6.cpp:272
@ p
Definition: ERF_WSM6.H:280