mpas_tools.ocean.compute_barotropic_streamfunction

mpas_tools.ocean.compute_barotropic_streamfunction(ds_mesh, ds, logger=None, min_depth=None, max_depth=None, prefix='timeMonthly_avg_', time_index=None, include_bolus=False, include_submesoscale=False, quiet=False, horiz_chunk=10000, tmp_dir=None)[source]

Compute barotropic streamfunction

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

  • ds (xarray.Dataset) – A dataset containing MPAS output variables normalVelocity and layerThickness (possibly with a prefix)

  • logger (logging.Logger, optional) – A logger for the output if not stdout

  • min_depth (float, optional) – The minimum depth (positive up) to compute BSF over

  • max_depth (float, optional) – The maximum depth (positive up) to compute BSF over

  • prefix (str, optional) – The prefix on the normalVelocity and layerThickness variables

  • time_index (int, optional) – The time at which to index ds (if it has Time as a dimension)

  • include_bolus (bool, optional) – Whether to include the GM bolus velocity in the computation

  • include_submesoscale (bool, optional) – Whether to include the submesoscale velocity in the computation

  • quiet (bool, optional) – If True, suppress all logging output If False, log all output to the logger

  • horiz_chunk (int, optional) – The number of edges to chunk the dataset by when computing the vertically integrated velocity. This is useful for large datasets to avoid memory issues. Set this to None to disable chunking.

  • tmp_dir (str, optional) – A temporary directory to use for intermediate files. This is useful for large datasets to avoid memory issues. If None, no temporary directory is used.

Returns:

bsf_vertex (xarray.DataArray) – The barotropic streamfunction in Sv on vertices