From d5703c5f7475035b8534dbc2f0abde195f1edd36 Mon Sep 17 00:00:00 2001 From: tomsail Date: Tue, 19 Dec 2023 15:23:33 +0100 Subject: [PATCH] added north pole fix --- pyposeidon/moceanmesh.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyposeidon/moceanmesh.py b/pyposeidon/moceanmesh.py index a31f91b9..e3de330f 100644 --- a/pyposeidon/moceanmesh.py +++ b/pyposeidon/moceanmesh.py @@ -639,6 +639,9 @@ def make_oceanmesh_global(df, **kwargs): # stereo shoreline shoreline_stereo = om.Shoreline(shp=fshp_ste, bbox=extent.bbox, h0=res_min, crs=crs, stereo=True) domain = om.signed_distance_function(shoreline_stereo) + # add north pole in the mesh to avoid triangle over the north pole + if domain.eval([[0, 0]]): + pfix = np.append(pfix, [[0, 0]], axis=0) else: raise ValueError("Not implemented: bgmesh must be 'om' or None") dh = xr.open_dataset(bgmesh)