From c07e3f8f445435f7a6d51ee035b14f9562e8fbb9 Mon Sep 17 00:00:00 2001 From: Mahesh Natarajan Date: Wed, 29 Nov 2023 09:53:32 -0800 Subject: [PATCH] Correcting argument list --- Exec/SquallLine_2D/prob.H | 3 +++ Exec/SquallLine_2D/prob.cpp | 20 ++++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Exec/SquallLine_2D/prob.H b/Exec/SquallLine_2D/prob.H index 0d7a7809d..cd4556b6b 100644 --- a/Exec/SquallLine_2D/prob.H +++ b/Exec/SquallLine_2D/prob.H @@ -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); diff --git a/Exec/SquallLine_2D/prob.cpp b/Exec/SquallLine_2D/prob.cpp index a8b3a8f54..23e43a241 100644 --- a/Exec/SquallLine_2D/prob.cpp +++ b/Exec/SquallLine_2D/prob.cpp @@ -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); @@ -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); @@ -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); @@ -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