pyfvcom2.obc module

class pyfvcom2.obc.OBCManager(grid: Grid)

Bases: object

Manager for FVCOM open boundary tidal elevation forcing.

Predicts tidal elevation at open boundary nodes using a TideManager and writes an FVCOM-format OBC elevation forcing file suitable for driving a tide-only model run. The resulting file is typically used to generate a tidal harmonics file, which is then used alongside a nest forcing file in a full baroclinic run.

Variables:

grid – Grid instance containing the open boundaries.

add_tidal_data(tide_manager: TideManager) → None

Predict tidal elevation at all OBC nodes.

Parameters:

tide_manager – TideManager with an interpolator registered for ‘zeta’. Call tide_manager.add_interpolator(‘zeta’, …) first.

create_forcing_file(output_path: str, format: str = 'NETCDF4', **kwargs) → None

Write the OBC tidal elevation forcing file.

Parameters:
  • output_path – Path to the output NetCDF file.

  • format – NetCDF format string. Defaults to ‘NETCDF4’.

  • **kwargs – Additional keyword arguments passed to FVCOMWriter. Pass ncopts (dict) to control compression etc.

set_dates(dates: list[datetime]) → None

Set the dates for which to generate forcing.

Parameters:

dates – List of datetime objects.