polaris.tasks.ocean.Ocean.open_model_dataset

Ocean.open_model_dataset(filename, config, mesh_filename=None, vert_filename=None, reconstruct_variables=None, coeffs_filename=None, reconstruct_method: Literal['RBF', 'LSTSQ'] = 'LSTSQ', tracer_convention=None, lon=None, lat=None, logger=None, **kwargs)[source]

Open the given dataset, mapping variable and dimension names from Omega to MPAS-Ocean names if appropriate

Parameters:
  • filename (str) – The path for the NetCDF file to open

  • config (polaris.config.PolarisConfigParser) – Configuration for the task; used when the model is Omega to compute geometric layer thickness from pseudo-thickness.

  • mesh_filename (str, optional) – Path to the mesh NetCDF file. Should contain the reconstruction weights if using the LSTSQ reconstruction method. It is also where the locations needed for a tracer conversion come from.

  • reconstruct_variables (list of str, optional) – List of variable names to reconstruct in the dataset.

  • coeffs_filename (str, optional) – Path to the coefficients NetCDF file.

  • reonstruct_method ({'RBF', 'LSTSQ'}, optional) – Method to use for reconstructing vector variables. RBF: Radial Basis Function; approach used in MPAS-Ocean. LSTSQ: Least-squares reconstruction; new approach in Omega

  • tracer_convention ({'teos-10', 'mpas-ocean'}, optional) – The convention of temperature and salinity in the dataset that is returned. The default is to leave the tracers in the convention the ocean model wrote them in: 'teos-10' (conservative temperature and absolute salinity) for Omega and 'mpas-ocean' (potential temperature and practical salinity) for MPAS-Ocean. The two conventions are indistinguishable unless the eos_type config option is teos-10, so this is a no-op for any other equation of state.

  • lon (float or xarray.DataArray, optional) – The longitude(s) in degrees at which to convert tracers, if not the location implied by the mesh

  • lat (float or xarray.DataArray, optional) – The latitude(s) in degrees at which to convert tracers, as for lon

  • logger (logging.Logger, optional) – A logger for logging EOS iteration information if a pressure needs to be computed for the tracer conversion

  • kwargs – keyword arguments passed to xarray.open_dataset()

Returns:

ds (xarray.Dataset) – The dataset with variables named as expected in MPAS-Ocean