Skip to content

Commit

Permalink
Correcting argument list
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahesh Natarajan committed Nov 29, 2023
1 parent f058575 commit c07e3f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Exec/SquallLine_2D/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ public:
AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE
amrex::Real compute_relative_humidity (const amrex::Real z,
const amrex::Real height,
const amrex::Real z_tr,
const amrex::Real p_b,
const amrex::Real T_b);

AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE
amrex::Real vapor_mixing_ratio (const amrex::Real z,
const amrex::Real height,
const amrex::Real p_b,
const amrex::Real T_b,
const amrex::Real RH);
Expand Down
20 changes: 8 additions & 12 deletions Exec/SquallLine_2D/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ Real compute_saturation_pressure (const Real T_b)

AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE
Real Problem::compute_relative_humidity (const Real z, const Real p_b, const Real T_b)
Real Problem::compute_relative_humidity (const Real z, const Real height, const Real z_tr, const Real p_b, const Real T_b)
{
Real height = parms.height;
Real z_tr = parms.z_tr;

Real p_s = compute_saturation_pressure(T_b);

Real q_s = 0.622*p_s/(p_b - p_s);
Expand All @@ -80,9 +77,8 @@ Real compute_vapor_pressure (const Real p_s, const Real RH)

AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE
Real Problem::vapor_mixing_ratio (const Real z, const Real p_b, const Real T_b, const Real RH)
Real Problem::vapor_mixing_ratio (const Real z, const Real height, const Real p_b, const Real T_b, const Real RH)
{
Real height = parms.height;
Real p_s = compute_saturation_pressure(T_b);
Real p_v = compute_vapor_pressure(p_s, RH);

Expand Down Expand Up @@ -123,8 +119,8 @@ void Problem::compute_rho (const Real& z, const Real& pressure, Real& theta, Rea

theta = compute_theta(z);
T_b = compute_temperature(pressure, theta);
Real RH = compute_relative_humidity(z, pressure, T_b);
q_v = vapor_mixing_ratio(z, pressure, T_b, RH);
Real RH = compute_relative_humidity(z, parms.height, parms.z_tr, pressure, T_b);
q_v = vapor_mixing_ratio(z, parms.height, pressure, T_b, RH);
rho = pressure/(R_d*T_b*(1.0 + (R_v/R_d)*q_v));
rho = rho*(1.0 + q_v);
T_dp = compute_dewpoint_temperature(T_b, RH);
Expand Down Expand Up @@ -362,15 +358,15 @@ Problem::init_custom_pert (
theta_total = t[k] + delta_theta;
temperature = compute_temperature(p[k], theta_total);
Real T_b = compute_temperature(p[k], t[k]);
RH = compute_relative_humidity(z, p[k], T_b);
Real q_v_hot = vapor_mixing_ratio(z, p[k], T_b, RH);
RH = compute_relative_humidity(z, parms.height, parms.z_tr, p[k], T_b);
Real q_v_hot = vapor_mixing_ratio(z, parms.height, p[k], T_b, RH);
rho = p[k]/(R_d*temperature*(1.0 + (R_v/R_d)*q_v_hot));

// Compute background quantities
Real temperature_back = compute_temperature(p[k], t[k]);
Real T_back = compute_temperature(p[k], t[k]);
Real RH_back = compute_relative_humidity(z, p[k], T_back);
Real q_v_back = vapor_mixing_ratio(z, p[k], T_back, RH_back);
Real RH_back = compute_relative_humidity(z, parms.height, parms.z_tr, p[k], T_back);
Real q_v_back = vapor_mixing_ratio(z, parms.height, p[k], T_back, RH_back);
Real rho_back = p[k]/(R_d*temperature_back*(1.0 + (R_v/R_d)*q_v_back));

// This version perturbs rho but not p
Expand Down

0 comments on commit c07e3f8

Please sign in to comment.