Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Magdalena <[email protected]>
  • Loading branch information
jonasjucker and halungge authored Feb 26, 2024
1 parent 00f9f5e commit fd8e067
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fd8e067

Please sign in to comment.