Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion oceanmodes/baroclinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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]