Grid

Bathymetry

Pelagos.Bathymetry.load_bathymetry_ncMethod
load_bathymetry_nc(filename; lon_var="lon", lat_var="lat", depth_var="depth")
    -> (H, lon, lat)

Load bathymetry from a NetCDF file. Returns:

  • H : depth (nlon, nlat), m, positive downward; land = 0 or NaN
  • lon : longitude vector, degrees
  • lat : latitude vector, degrees
source
Pelagos.Bathymetry.smooth_bathymetryMethod
smooth_bathymetry(H_raw; n_passes=1) -> Matrix{Float64}

Smooth bathymetry by a 4-point nearest-neighbour kernel. Longitude is treated as periodic; northern and southern boundaries use the boundary value as the neighbour (zero-gradient).

The kernel averages the cell itself and its 4 cardinal neighbours (east, west, north, south), all with equal weight 1/5: H_smooth[i,j] = (H[i,j] + H[E] + H[W] + H[N] + H[S]) / 5

n_passes determines how many times the smoothing is applied. The paper uses one pass.

source

Masks

Pelagos.Masks.build_tracer_maskMethod
build_tracer_mask(ocean_mask) -> Matrix{Bool}

Build the mask used for tracer transport. Bering and Davis Straits remain open for tracer exchange even if closed for barotropic flow. Currently identical to ocean_mask; the distinction is maintained for architectural clarity.

source
Pelagos.Masks.build_velocity_maskMethod
build_velocity_mask(ocean_mask; closed_straits=Vector{Tuple{Int,Int}}[]) -> Matrix{Bool}

Build the mask used for barotropic flow. Optionally close specified grid cells (e.g., Bering Strait, Davis Strait) by setting them to land.

closed_straits is a vector of (i,j) index tuples to close.

source