Grid
Bathymetry
Pelagos.Bathymetry.load_bathymetry_nc — Method
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 NaNlon: longitude vector, degreeslat: latitude vector, degrees
Pelagos.Bathymetry.smooth_bathymetry — Method
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.
Masks
Pelagos.Masks.build_ocean_mask — Method
build_ocean_mask(H) -> Matrix{Bool}Derive the ocean mask from the bathymetry depth field. Cells with H > 0 are ocean.
Pelagos.Masks.build_tracer_mask — Method
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.
Pelagos.Masks.build_velocity_mask — Method
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.