From 02aae7a22603f15e9ecb4c743eb5dda821cc3790 Mon Sep 17 00:00:00 2001 From: Emmanuel Romero Date: Sun, 22 Feb 2026 06:55:45 -0700 Subject: [PATCH] Fix constant integration offset in geo_strf_dyn_height --- gsw/geostrophy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gsw/geostrophy.py b/gsw/geostrophy.py index ac0c2dc..977c55d 100644 --- a/gsw/geostrophy.py +++ b/gsw/geostrophy.py @@ -98,6 +98,10 @@ def geo_strf_dyn_height(SA, CT, p, p_ref=0, axis=0, max_dp=1.0, dh_all = _gsw_ufuncs.geo_strf_dyn_height_1( sa, ct, pgood, p_ref, max_dp, interp_methods[interp_method]) + # Force dynamic height to be exactly zero at the reference pressure + iref = np.where(np.isclose(pgood, p_ref))[0] + if len(iref) > 0: + dh_all = dh_all - dh_all[iref[0]] if ntop > 0: dh[ind][igood] = dh_all[ntop:] else: