Skip to content

Commit

Permalink
fix oops in order of arguments (#1933)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Nov 6, 2024
1 parent 4bc4950 commit 18c66d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Exec/MoistRegTests/Bubble/ERF_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ Problem::init_custom_pert(
}

theta_total = theta_back[k]*(delta_theta/300.0 + 1);
Real T = getTgivenPandTh(theta_total, p_back[k], (R_d/Cp_d));
Real T = getTgivenPandTh(p_back[k], theta_total, (R_d/Cp_d));
rho = p_back[k]/(R_d*T*(1.0 + (R_v/R_d)*q_v_back[k]));
RH = compute_relative_humidity();
Real q_v_hot = vapor_mixing_ratio(p_back[k], T, RH);

// Compute background quantities
Real T_back = getTgivenPandTh(theta_back[k], p_back[k], (R_d/Cp_d));
Real T_back = getTgivenPandTh(p_back[k], theta_back[k], (R_d/Cp_d));
Real rho_back = p_back[k]/(R_d*T_back*(1.0 + (R_v/R_d)*q_v_back[k]));

// This version perturbs rho but not p
Expand Down
10 changes: 5 additions & 5 deletions Exec/MoistRegTests/SquallLine_2D/ERF_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Problem::compute_rho (const Real& z, const Real& pressure, Real& theta, Rea
{

theta = compute_theta(z);
T_b = getTgivenPandTh(theta, pressure, (R_d/Cp_d));
T_b = getTgivenPandTh(pressure, theta, (R_d/Cp_d));
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 = getRhogivenTandPress(T_b, pressure, q_v);
Expand Down Expand Up @@ -326,16 +326,16 @@ Problem::init_custom_pert (

theta_total = t[k] + delta_theta;

temperature = getTgivenPandTh(theta_total, p[k], (R_d/Cp_d));
Real T_b = getTgivenPandTh(t[k] , p[k], (R_d/Cp_d));
temperature = getTgivenPandTh(p[k], theta_total, (R_d/Cp_d));
Real T_b = getTgivenPandTh(p[k], t[k] , (R_d/Cp_d));

RH = compute_relative_humidity(z, height, z_tr, p[k], T_b);
Real q_v_hot = vapor_mixing_ratio(z, 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 = getTgivenPandTh(t[k], p[k], (R_d/Cp_d));
Real T_back = getTgivenPandTh(t[k], p[k], (R_d/Cp_d));
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 = compute_relative_humidity(z, height, z_tr, p[k], T_back);
Real q_v_back = vapor_mixing_ratio(z, height, p[k], T_back, RH_back);
Expand Down
10 changes: 5 additions & 5 deletions Exec/MoistRegTests/SuperCell_3D/ERF_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void Problem::compute_rho (const Real& z, const Real& pressure, Real& theta, Rea
{

theta = compute_theta(z);
T_b = getTgivenPandTh(theta, pressure, (R_d/Cp_d));
T_b = getTgivenPandTh(pressure, theta, (R_d/Cp_d));
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);

Expand Down Expand Up @@ -335,15 +335,15 @@ Problem::init_custom_pert (
}

theta_total = t[k] + delta_theta;
temperature = getTgivenPandTh(theta_total, p[k], (R_d/Cp_d));
Real T_b = getTgivenPandTh(t[k] , p[k], (R_d/Cp_d));
temperature = getTgivenPandTh(p[k], theta_total, (R_d/Cp_d));
Real T_b = getTgivenPandTh(p[k], t[k] , (R_d/Cp_d));
RH = compute_relative_humidity(z, height, z_tr, p[k], T_b);
Real q_v_hot = vapor_mixing_ratio(z, 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 = getTgivenPandTh(t[k], p[k], (R_d/Cp_d));
Real T_back = getTgivenPandTh(t[k], p[k], (R_d/Cp_d));
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 = compute_relative_humidity(z, height, z_tr, p[k], T_back);
Real q_v_back = vapor_mixing_ratio(z, height, p[k], T_back, RH_back);
Real rho_back = getRhogivenTandPress(temperature_back, p[k], q_v_back);
Expand Down

0 comments on commit 18c66d1

Please sign in to comment.