polaris.tasks.ocean.Ocean.open_model_dataset

Ocean.open_model_dataset(filename, config, mesh_filename=None, reconstruct_variables=None, 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

For Omega, layerThickness is added from GeomLayerThickness, or from PseudoThickness and SpecVol when both are present. Nothing that needs an equation of state is derived. Callers that need SpecVol or vertVelocityTop from Omega output that lacks them should call polaris.ocean.vertical.diagnostics.spec_vol_from_ds() or polaris.ocean.vertical.diagnostics.vert_velocity_top_from_ds() on the result.

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. It must contain the least-squares reconstruction weights if anything is to be reconstructed, and 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. A variable whose zonal and meridional components are already in the dataset (as they are in MPAS-Ocean output, which the model reconstructs itself) is skipped, and nothing is reconstructed if that is true of all of them.

  • 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