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,
layerThicknessis added fromGeomLayerThickness, or fromPseudoThicknessandSpecVolwhen both are present. Nothing that needs an equation of state is derived. Callers that needSpecVolorvertVelocityTopfrom Omega output that lacks them should callpolaris.ocean.vertical.diagnostics.spec_vol_from_ds()orpolaris.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
temperatureandsalinityin 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 theeos_typeconfig option isteos-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
lonlogger (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