Initialize density in hydrostatic equilibrium for dry cases.
126 const amrex::Real T_sfc = amrex::Real(300.);
127 const amrex::Real rho_sfc =
p_0 / (
R_d*T_sfc);
128 const amrex::Real Thetabar = T_sfc;
130 if (!is_constant_dz && !is_stretched_dz) {
133 if (geom.Domain().bigEnd(2) > 255) {
134 hse_terrain_columns<512>(rho_hse, *z_phys_cc, geom, rho_sfc, Thetabar);
136 hse_terrain_columns<256>(rho_hse, *z_phys_cc, geom, rho_sfc, Thetabar);
146 const int klo = geom.Domain().smallEnd(2);
147 const int khi = geom.Domain().bigEnd(2);
150 amrex::Vector<amrex::Real>
h_r(
khi+2);
151 amrex::Vector<amrex::Real>
h_p(
khi+2);
153 amrex::Gpu::DeviceVector<amrex::Real>
d_r(
khi+2);
154 amrex::Gpu::DeviceVector<amrex::Real>
d_p(
khi+2);
156 if (is_constant_dz) {
157 const amrex::Real
dz = geom.CellSize()[2];
163 amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice,
h_r.begin(),
h_r.end(),
d_r.begin());
164 amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice,
h_p.begin(),
h_p.end(),
d_p.begin());
166 amrex::Real* r =
d_r.data();
169 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
171 for ( amrex::MFIter mfi(rho_hse, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi )
173 const amrex::Box& bx = mfi.growntilebox(1);
174 const amrex::Array4<amrex::Real> rho_hse_arr = rho_hse[mfi].array();
177 int kk = std::max(k,0);
178 rho_hse_arr(i,j,k) = r[kk];
183 amrex::Gpu::streamSynchronize();
constexpr amrex::Real p_0
Definition: ERF_Constants.H:69
constexpr amrex::Real R_d
Definition: ERF_Constants.H:49
const int khi
Definition: ERF_InitCustomPert_Bubble.H:25
const int klo
Definition: ERF_InitCustomPert_KE.H:9
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_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 amrex::Real &z_bot, const int klo, const int khi)
Definition: ERF_HSEUtils.H:112
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 amrex::Real &z_bot, const int klo, const int khi)
Definition: ERF_HSEUtils.H:226
@ dz
Definition: ERF_AdvanceWDM6.cpp:273