@@ -694,53 +694,9 @@ def add_periodic_halo(self, zonal, meridional, halosize=5):
694694 halosize : int
695695 size of the halo (in grid points). Default is 5 grid points
696696 """
697- if zonal :
698- lonshift = self .lon [:, - 1 ] - 2 * self .lon [:, 0 ] + self .lon [:, 1 ]
699- if not np .allclose (self .lon [:, 1 ] - self .lon [:, 0 ], self .lon [:, - 1 ] - self .lon [:, - 2 ]):
700- warnings .warn (
701- "The zonal halo is located at the east and west of current grid, "
702- "with a dx = lon[1]-lon[0] between the last nodes of the original grid and the first ones of the halo. "
703- "In your grid, lon[1]-lon[0] != lon[-1]-lon[-2]. Is the halo computed as you expect?" ,
704- FieldSetWarning ,
705- stacklevel = 2 ,
706- )
707- self ._lon = np .concatenate (
708- (
709- self .lon [:, - halosize :] - lonshift [:, np .newaxis ],
710- self .lon ,
711- self .lon [:, 0 :halosize ] + lonshift [:, np .newaxis ],
712- ),
713- axis = len (self .lon .shape ) - 1 ,
714- )
715- self ._lat = np .concatenate (
716- (self .lat [:, - halosize :], self .lat , self .lat [:, 0 :halosize ]), axis = len (self .lat .shape ) - 1
717- )
718- self ._zonal_periodic = True
719- self ._zonal_halo = halosize
720- if meridional :
721- if not np .allclose (self .lat [1 , :] - self .lat [0 , :], self .lat [- 1 , :] - self .lat [- 2 , :]):
722- warnings .warn (
723- "The meridional halo is located at the north and south of current grid, "
724- "with a dy = lat[1]-lat[0] between the last nodes of the original grid and the first ones of the halo. "
725- "In your grid, lat[1]-lat[0] != lat[-1]-lat[-2]. Is the halo computed as you expect?" ,
726- FieldSetWarning ,
727- stacklevel = 2 ,
728- )
729- latshift = self .lat [- 1 , :] - 2 * self .lat [0 , :] + self .lat [1 , :]
730- self ._lat = np .concatenate (
731- (
732- self .lat [- halosize :, :] - latshift [np .newaxis , :],
733- self .lat ,
734- self .lat [0 :halosize , :] + latshift [np .newaxis , :],
735- ),
736- axis = len (self .lat .shape ) - 2 ,
737- )
738- self ._lon = np .concatenate (
739- (self .lon [- halosize :, :], self .lon , self .lon [0 :halosize , :]), axis = len (self .lon .shape ) - 2
740- )
741- self ._meridional_halo = halosize
742- if isinstance (self , CurvilinearSGrid ):
743- self ._add_Sdepth_periodic_halo (zonal , meridional , halosize )
697+ raise NotImplementedError (
698+ "CurvilinearGrid does not support add_periodic_halo. See https://github.com/OceanParcels/Parcels/pull/1811"
699+ )
744700
745701
746702class CurvilinearZGrid (CurvilinearGrid ):
0 commit comments