Input / Output

NetCDF output

Pelagos.Output.write_snapshotMethod
write_snapshot(filename, state, grid_info, time_yr)

Write an ocean state snapshot to a NetCDF file.

Arguments

  • filename : output file path (.nc)
  • state : NamedTuple with fields: T, S, u, v, w, psi_bt, rho, pressure
  • grid_info : NamedTuple with: lon, lat, zcentres, zfaces
  • time_yr : model time in years (written as a coordinate)
source

Restarts

Pelagos.Restarts.bgrid_u_to_cgridMethod
bgrid_u_to_cgrid(u_B) -> u_C

Convert zonal velocity from CLIMBER-X B-grid corners (73, 37, nz) to Oceananigans C-grid east faces (73, 36, nz) by averaging adjacent φ values.

source
Pelagos.Restarts.bgrid_v_to_cgridMethod
bgrid_v_to_cgrid(v_B) -> v_C

Convert meridional velocity from CLIMBER-X B-grid corners (73, 37, nz) to Oceananigans C-grid north faces (72, 37, nz) by averaging adjacent λ values (periodic in longitude).

source
Pelagos.Restarts.bgrid_w_to_cgridMethod
bgrid_w_to_cgrid(w_B) -> w_C

Convert vertical velocity from CLIMBER-X B-grid corners (73, 37, nz) to Oceananigans C-grid vertical-face positions (72, 36, nz+1).

w_B[:,:,k] is interpreted as the upward velocity at the top face of layer k. The bottom face (k=0, bathymetry) is set to zero; the Oceananigans convention is w[:,:,1] at the bottom face of layer 1.

source
Pelagos.Restarts.load_climberx_forcingMethod
load_climberx_forcing(forcing_file) -> NamedTuple

Load monthly wind stress climatology from a CLIMBER-X atmospheric forcing file (e.g., climber-x/input/fake_clim_const_WFDEI-ERA_preind.nc).

Returned fields (Float64):

  • taux : (72, 36, 12) zonal wind stress, N m⁻²
  • tauy : (72, 36, 12) meridional wind stress, N m⁻²
source
Pelagos.Restarts.load_climberx_restartMethod
load_climberx_restart(restart_dir) -> NamedTuple

Load the CLIMBER-X ocean steady-state from <restart_dir>/ocn_restart.nc.

Returned fields (all Float64, bottom-to-top layer ordering):

  • T : temperature (72, 36, 23), °C
  • S : salinity (72, 36, 23), psu
  • u_B : zonal velocity on B-grid corners (73, 37, 23), m s⁻¹
  • v_B : meridional velocity on B-grid corners (73, 37, 23), m s⁻¹
  • w_B : vertical velocity on B-grid corners (73, 37, 23), m s⁻¹
  • f_ocn : ocean fraction mask (72, 36)
  • k1_pot: bottom layer index (72, 36)
  • zw : layer interfaces (24,), m, negative, bottom→top
source