ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPert_SquallLine.H File Reference

Go to the source code of this file.

Functions

 AMREX_ALWAYS_ASSERT (bx.length()[2]==khi+1)
 
Vector< Realh_r (khi+2)
 
Vector< Realh_p (khi+2)
 
Vector< Realh_t (khi+2)
 
Vector< Realh_q_v (khi+2)
 
Gpu::DeviceVector< Reald_r (khi+2)
 
Gpu::DeviceVector< Reald_p (khi+2)
 
Gpu::DeviceVector< Reald_t (khi+2)
 
Gpu::DeviceVector< Reald_q_v (khi+2)
 
ParmParse pp_prob ("prob")
 
pp_prob query ("qt_init", q_t)
 
pp_prob query ("eq_pot_temp", eq_pot_temp)
 
pp_prob query ("use_empirical_psat", use_empirical)
 
pp_prob query ("height", height)
 
pp_prob query ("z_tr", z_tr)
 
pp_prob query ("x_c", x_c)
 
pp_prob query ("z_c", z_c)
 
pp_prob query ("x_r", x_r)
 
pp_prob query ("z_r", z_r)
 
pp_prob query ("T_tr", T_tr)
 
pp_prob query ("theta_c", theta_c)
 
pp_prob query ("theta_0", theta_0)
 
pp_prob query ("theta_tr", theta_tr)
 
 ParallelFor (bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real z=prob_lo[2]+(k+0.5) *dx[2];const Real x=prob_lo[0]+(i+0.5) *dx[0];Real rad, delta_theta, theta_total, temperature, rho, RH, scalar;Real scaled_height=z/z_tr;int which_zone=-1;if(z<=height) { which_zone=1;} else if(z<=z_tr) { which_zone=2;} else { which_zone=3;} rad=std::pow(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2), 0.5);if(rad<=r_c){ delta_theta=theta_c *std::pow(cos(PI *rad/2.0), 2);scalar=std::pow(cos(PI *rad/2.0), 2);} else{ delta_theta=0.0;scalar=0.0;} theta_total=t[k]+delta_theta;temperature=getTgivenPandTh(p[k], theta_total,(R_d/Cp_d));Real T_b=getTgivenPandTh(p[k], t[k],(R_d/Cp_d));RH=HSEutils::compute_relative_humidity(p[k], T_b, use_empirical, which_zone, scaled_height);Real q_v_hot;if(z< height) { q_v_hot=0.014;} else { q_v_hot=HSEutils::vapor_mixing_ratio(p[k], T_b, RH, use_empirical, which_zone);} rho=p[k]/(R_d *temperature *(1.0+(R_v/R_d) *q_v_hot));Real temperature_back=getTgivenPandTh(p[k], t[k],(R_d/Cp_d));Real T_back=getTgivenPandTh(p[k], t[k],(R_d/Cp_d));Real RH_back=HSEutils::compute_relative_humidity(p[k], T_back, use_empirical, which_zone, scaled_height);Real q_v_back;if(z< height) { q_v_back=0.014;} else { q_v_back=HSEutils::vapor_mixing_ratio(p[k], T_back, RH_back, use_empirical, which_zone);} Real rho_back=p[k]/(R_d *temperature_back *(1.0+(R_v/R_d) *q_v_back));state_pert(i, j, k, RhoTheta_comp)=rho *theta_total - rho_back *t[k] *(1.0+(R_v/R_d) *q_v_back);state_pert(i, j, k, Rho_comp)=rho - rho_back *(1.0+q_v_back);state_pert(i, j, k, RhoScalar_comp)=rho *scalar;if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)=rho *q_v_hot;state_pert(i, j, k, RhoQ2_comp)=0.0;} })
 

Variables

const bool use_moisture = (sc.moisture_type != MoistureType::None)
 
const int khi = geomdata.Domain().bigEnd()[2]
 
const Realdz = geomdata.CellSize()[2]
 
Real q_t = 0.02
 
Real eq_pot_temp = 320.0
 
bool use_empirical = false
 
Real height = 1200.0
 
Real z_tr = 12000.0
 
Real x_c = 0.0
 
Real z_c = 1.5e3
 
Real x_r = 4.0e3
 
Real z_r = 1.5e3
 
Real T_tr = 213.0
 
Real theta_c = 3.0
 
Real theta_0 = 300.0
 
Real theta_tr = 343.0
 
Real r_c = 1.0
 
Realt = d_t.data()
 
Realp = d_p.data()
 

Function Documentation

◆ AMREX_ALWAYS_ASSERT()

AMREX_ALWAYS_ASSERT ( bx.  length()[2] = =khi+1)

◆ d_p()

Gpu::DeviceVector<Real> d_p ( khi 2)

Referenced by erf_init_dens_hse(), and if().

Here is the caller graph for this function:

◆ d_q_v()

Gpu::DeviceVector<Real> d_q_v ( khi 2)

Referenced by if().

Here is the caller graph for this function:

◆ d_r()

Gpu::DeviceVector<Real> d_r ( khi 2)

Referenced by erf_init_dens_hse(), erf_init_dens_hse_moist(), and if().

Here is the caller graph for this function:

◆ d_t()

Gpu::DeviceVector<Real> d_t ( khi 2)

Referenced by if().

Here is the caller graph for this function:

◆ h_p()

Vector<Real> h_p ( khi 2)

Referenced by erf_init_dens_hse(), erf_init_dens_hse_moist(), and if().

Here is the caller graph for this function:

◆ h_q_v()

Vector<Real> h_q_v ( khi 2)

Referenced by erf_init_dens_hse_moist(), and if().

Here is the caller graph for this function:

◆ h_r()

Vector<Real> h_r ( khi 2)

Referenced by erf_init_dens_hse(), erf_init_dens_hse_moist(), and if().

Here is the caller graph for this function:

◆ h_t()

Vector<Real> h_t ( khi 2)

Referenced by erf_init_dens_hse_moist(), and if().

Here is the caller graph for this function:

◆ ParallelFor()

ParallelFor ( bx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real z=prob_lo[2]+(k+0.5) *dx[2];const Real x=prob_lo[0]+(i+0.5) *dx[0];Real rad, delta_theta, theta_total, temperature, rho, RH, scalar;Real scaled_height=z/z_tr;int which_zone=-1;if(z<=height) { which_zone=1;} else if(z<=z_tr) { which_zone=2;} else { which_zone=3;} rad=std::pow(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2), 0.5);if(rad<=r_c){ delta_theta=theta_c *std::pow(cos(PI *rad/2.0), 2);scalar=std::pow(cos(PI *rad/2.0), 2);} else{ delta_theta=0.0;scalar=0.0;} theta_total=t[k]+delta_theta;temperature=getTgivenPandTh(p[k], theta_total,(R_d/Cp_d));Real T_b=getTgivenPandTh(p[k], t[k],(R_d/Cp_d));RH=HSEutils::compute_relative_humidity(p[k], T_b, use_empirical, which_zone, scaled_height);Real q_v_hot;if(z< height) { q_v_hot=0.014;} else { q_v_hot=HSEutils::vapor_mixing_ratio(p[k], T_b, RH, use_empirical, which_zone);} rho=p[k]/(R_d *temperature *(1.0+(R_v/R_d) *q_v_hot));Real temperature_back=getTgivenPandTh(p[k], t[k],(R_d/Cp_d));Real T_back=getTgivenPandTh(p[k], t[k],(R_d/Cp_d));Real RH_back=HSEutils::compute_relative_humidity(p[k], T_back, use_empirical, which_zone, scaled_height);Real q_v_back;if(z< height) { q_v_back=0.014;} else { q_v_back=HSEutils::vapor_mixing_ratio(p[k], T_back, RH_back, use_empirical, which_zone);} Real rho_back=p[k]/(R_d *temperature_back *(1.0+(R_v/R_d) *q_v_back));state_pert(i, j, k, RhoTheta_comp)=rho *theta_total - rho_back *t[k] *(1.0+(R_v/R_d) *q_v_back);state_pert(i, j, k, Rho_comp)=rho - rho_back *(1.0+q_v_back);state_pert(i, j, k, RhoScalar_comp)=rho *scalar;if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)=rho *q_v_hot;state_pert(i, j, k, RhoQ2_comp)=0.0;} }   
)
Here is the call graph for this function:

◆ pp_prob()

ParmParse pp_prob ( "prob"  )

◆ query() [1/13]

pp_prob query ( "eq_pot_temp"  ,
eq_pot_temp   
)

◆ query() [2/13]

pp_prob query ( "height"  ,
height   
)

◆ query() [3/13]

pp_prob query ( "qt_init"  ,
q_t   
)

◆ query() [4/13]

pp_prob query ( "T_tr"  ,
T_tr   
)

◆ query() [5/13]

pp_prob query ( "theta_0"  ,
theta_0   
)

◆ query() [6/13]

pp_prob query ( "theta_c"  ,
theta_c   
)

◆ query() [7/13]

pp_prob query ( "theta_tr"  ,
theta_tr   
)

◆ query() [8/13]

pp_prob query ( "use_empirical_psat"  ,
use_empirical   
)

◆ query() [9/13]

pp_prob query ( "x_c"  ,
x_c   
)

◆ query() [10/13]

pp_prob query ( "x_r"  ,
x_r   
)

◆ query() [11/13]

pp_prob query ( "z_c"  ,
z_c   
)

◆ query() [12/13]

pp_prob query ( "z_r"  ,
z_r   
)

◆ query() [13/13]

pp_prob query ( "z_tr"  ,
z_tr   
)

Variable Documentation

◆ dz

const Real& dz = geomdata.CellSize()[2]

◆ eq_pot_temp

Real eq_pot_temp = 320.0

◆ height

Real height = 1200.0

◆ khi

const int khi = geomdata.Domain().bigEnd()[2]

◆ p

◆ q_t

◆ r_c

Real r_c = 1.0

Referenced by ParallelFor().

◆ t

◆ T_tr

◆ theta_0

◆ theta_c

Real theta_c = 3.0

Referenced by ParallelFor().

◆ theta_tr

◆ use_empirical

bool use_empirical = false

Referenced by ParallelFor().

◆ use_moisture

const bool use_moisture = (sc.moisture_type != MoistureType::None)

Referenced by ParallelFor().

◆ x_c

Real x_c = 0.0

Referenced by ParallelFor().

◆ x_r

Real x_r = 4.0e3

Referenced by ParallelFor().

◆ z_c

Real z_c = 1.5e3

Referenced by ParallelFor().

◆ z_r

Real z_r = 1.5e3

Referenced by ParallelFor().

◆ z_tr