Skip to content

Commit 02aae7a

Browse files
committed
Fix constant integration offset in geo_strf_dyn_height
1 parent d445ad6 commit 02aae7a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

gsw/geostrophy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def geo_strf_dyn_height(SA, CT, p, p_ref=0, axis=0, max_dp=1.0,
9898
dh_all = _gsw_ufuncs.geo_strf_dyn_height_1(
9999
sa, ct, pgood, p_ref, max_dp,
100100
interp_methods[interp_method])
101+
# Force dynamic height to be exactly zero at the reference pressure
102+
iref = np.where(np.isclose(pgood, p_ref))[0]
103+
if len(iref) > 0:
104+
dh_all = dh_all - dh_all[iref[0]]
101105
if ntop > 0:
102106
dh[ind][igood] = dh_all[ntop:]
103107
else:

0 commit comments

Comments
 (0)