pyfvcom2.obc module

class pyfvcom2.obc.OBCManager(grid: Grid)[source]

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.

Attributes:

grid: Grid instance containing the open boundaries.

add_tidal_data(tide_manager: TideManager) None[source]

Predict tidal elevation at all OBC nodes.

Args:
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[source]

Write the OBC tidal elevation forcing file.

Args:

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[source]

Set the dates for which to generate forcing.

Args:

dates: List of datetime objects.