polaris.tasks.ocean.Ocean.write_forcing_dataset

Ocean.write_forcing_dataset(ds, filename, config)[source]

Write a surface forcing dataset for Omega’s Forcing stream or MPAS-Ocean’s forcing_data stream.

The two models disagree about the time dimension. Omega’s SfcStressForcingVars registers 1-D fields on NCells, while MPAS-Ocean’s Registry declares dimensions="nCells Time". A Time dimension of length one is therefore added for MPAS-Ocean and omitted for Omega.

Parameters:
  • ds (xarray.Dataset) – A dataset containing MPAS-Ocean or native model variable names, including the forcing variables

  • filename (str) – The path for the NetCDF file to write

  • config (polaris.config.PolarisConfigParser) – Configuration for the task (unused for now, accepted so the signature matches the other write_*_dataset helpers)