From fd8e067977d2933845ab411e6e70905cff28788b Mon Sep 17 00:00:00 2001 From: juckerj <39263956+jonasjucker@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:06:45 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Magdalena --- .../common/metrics/stencils/compute_wgtfacq_c.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/model/common/src/icon4py/model/common/metrics/stencils/compute_wgtfacq_c.py b/model/common/src/icon4py/model/common/metrics/stencils/compute_wgtfacq_c.py index 25bc3f2bba..7b59efeb1d 100644 --- a/model/common/src/icon4py/model/common/metrics/stencils/compute_wgtfacq_c.py +++ b/model/common/src/icon4py/model/common/metrics/stencils/compute_wgtfacq_c.py @@ -21,12 +21,12 @@ def compute_wgtfacq_c( nlev = nlevp1 - 1 wgtfacq_c = np.zeros(z_ifc.shape) - z1 = 0.5 * (z_ifc[:, nlev] - z_ifc[:, nlevp1]) - z2 = 0.5 * (z_ifc[:, nlev] + z_ifc[:, nlev - 1]) - z_ifc[:, nlevp1] - z3 = 0.5 * (z_ifc[:, nlev - 1] + z_ifc[:, nlev - 2]) - z_ifc[:, nlevp1] + z1 = 0.5 * (z_ifc[:, nlev-1] - z_ifc[:, nlev]) + z2 = 0.5 * (z_ifc[:, nlev-1] + z_ifc[:, nlev - 2]) - z_ifc[:, nlev] + z3 = 0.5 * (z_ifc[:, nlev - 2] + z_ifc[:, nlev - 3]) - z_ifc[:, nlev] - wgtfacq_c[:, 2] = z1 * z2 / (z2 - z3) / (z1 - z3) - wgtfacq_c[:, 1] = (z1 - wgtfacq_c[:, 2] * (z1 - z3)) / (z1 - z2) - wgtfacq_c[:, 0] = 1.0 - (wgtfacq_c[:, 1] + wgtfacq_c[:, 2]) + wgtfacq_c[:, nlev-3] = z1 * z2 / (z2 - z3) / (z1 - z3) + wgtfacq_c[:, nlev-2] = (z1 - wgtfacq_c[:, nlev-3] * (z1 - z3)) / (z1 - z2) + wgtfacq_c[:, nlev-1] = 1.0 - (wgtfacq_c[:, nlev-2] + wgtfacq_c[:, nlev-3]) return wgtfacq_c