From 2256ca233b2376d9031da02d7f77e4a1014884c3 Mon Sep 17 00:00:00 2001 From: Dhruv Balwada Date: Wed, 10 Oct 2018 11:28:31 -0400 Subject: [PATCH] Update baroclinic.py Had a mistake in previous pull request. --- oceanmodes/baroclinic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oceanmodes/baroclinic.py b/oceanmodes/baroclinic.py index c810b67..6cbd668 100644 --- a/oceanmodes/baroclinic.py +++ b/oceanmodes/baroclinic.py @@ -117,6 +117,8 @@ def _neutral_modes_from_N2_profile_raw(z, N2, f0, depth=None, **kwargs): # make sure z is increasing if not np.all(dzc > 0): raise ValueError('z should be monotonically increasing') + if z[0] == 0: + raise ValueError('z[0] should be non-zero, as it is a point where gradient quantity (N2) is defined') if depth is None: depth = z[-1] + dzc[-1]/2 else: @@ -582,4 +584,4 @@ def _instability_analysis_from_N2_profile_raw(zc, N2, f0, beta, k, l, zf, ubar, # return the first 'num' leading modes return zf, omega[:num], psi[:, :num] - \ No newline at end of file +