From 34d17d337d45af3ea9198896ea4e290b10488288 Mon Sep 17 00:00:00 2001 From: yoctoyotta1024 <92624833+yoctoyotta1024@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:35:48 +0200 Subject: [PATCH] fix: missing (1+qv) factor in calculation of derivative of rho_d when accounting for water vapour rho_d(z) = rho(z) / (1 + qv(z)) therefore drho_d/dz = drho/dz / (1+ qv) - dqv/dz / (1 + qv)^2 _not_ drho_d/dz = drho/dz / (1+ qv) - dqv/dz / (1 + qv) --- examples/PyMPDATA_examples/Shipway_and_Hill_2012/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/PyMPDATA_examples/Shipway_and_Hill_2012/settings.py b/examples/PyMPDATA_examples/Shipway_and_Hill_2012/settings.py index 1490cfcb..bd451d28 100644 --- a/examples/PyMPDATA_examples/Shipway_and_Hill_2012/settings.py +++ b/examples/PyMPDATA_examples/Shipway_and_Hill_2012/settings.py @@ -54,7 +54,7 @@ def drhod_dz(z, rhod): if not apprx_drhod_dz: # to resolve issue #335 qv = self.qv(z) dqv_dz = Derivative(self.qv)(z) - drhod_dz = drhod_dz / (1 + qv) - rhod * dqv_dz / (1 + qv) + drhod_dz = drhod_dz / (1 + qv) - rhod * dqv_dz / (1 + qv)**2 return drhod_dz z_points = np.arange(0, self.z_max + self.dz / 2, self.dz / 2)