polaris.ocean.rpe.compute_rpe

polaris.ocean.rpe.compute_rpe(ds_mesh, ds_init, ds_outputs, config=None, ds_vert_coord=None)[source]

Computes the reference (resting) potential energy for the whole domain

Parameters:
  • ds_mesh (xarray.Dataset) – Dataset containing MPAS horizontal mesh variables

  • ds_init (xarray.Dataset) – Dataset containing the initial state

  • ds_outputs (list of xarray.Dataset) – Datasets containing output of forward steps

  • config (polaris.config.PolarisConfigParser, optional) – Configuration for the task

  • ds_vert_coord (xarray.Dataset, optional) – Dataset containing vertical-coordinate variables (bottomDepth, minLevelCell, maxLevelCell). For Omega this is the separate vert_coord.nc dataset opened via open_vert_coord_dataset(). Defaults to ds_init when not provided (correct for MPAS-Ocean).

Returns:

rpe (numpy.ndarray) – the reference potential energy of size len(output_files) x Time