Commit e39cb777 authored by Sævik Pål Næverlid's avatar Sævik Pål Næverlid
Browse files

Add function for nearest sea cell to forcing class

parent 0428acef
......@@ -218,6 +218,13 @@ class Grid:
Y, X = bilin_inv(lon, lat, self.lon, self.lat)
return X + self.i0, Y + self.j0
def nearest_sea(self, X, Y):
I = X - self.i0
J = Y - self.j0
i_new, j_new = nearest_unmasked(np.logical_not(self.M), I, J)
return i_new, j_new
# -----------------------------------------------
# The Forcing class from the old forcing module
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment