Skip to content
Closed
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
15 changes: 7 additions & 8 deletions external_tidal_generation/generate_bottom_roughness_regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ def fill_missing_data_laplace(
This implementation otherwise assumes a regular lat/lon grid (WOA),
hence tripolar topology is intentionally not handled here.

Periodic boundary conditions are supported in longitude only (global configuration).

For regional configurations, set periodic_lon_laplace=False is not implemented yet.
Both periodic and non-periodic longitude boundary conditions are supported
and controlled by the periodic_lon_laplace flag.
"""
nj, ni = field.shape
# Find the missing points to fill (nan in field but mask > 0)
Expand Down Expand Up @@ -118,11 +117,11 @@ def _process_neighbour(n: int, jn: int, in_: int) -> None:
_process_neighbour(n, j, im1)
_process_neighbour(n, j, ip1)
else:
# TODO handle non-periodic case if needed
raise NotImplementedError(
"Non-periodic longitude is not implemented yet. "
"Set periodic_lon_laplace=True for global grids."
)
# no wrap in longitude, so only consider valid neighbours within bounds
if i > 0:
_process_neighbour(n, j, i - 1) # west
if i < ni - 1:
_process_neighbour(n, j, i + 1) # east

if j > 0:
_process_neighbour(n, j - 1, i) # south
Expand Down