polaris.ocean.vertical.diagnostics.location_for_field

polaris.ocean.vertical.diagnostics.location_for_field(var, field_name=None)[source]

The variable location of var to look up its vertical coordinate

A field on nVertLevelsP1 is defined at layer interfaces — the top of each layer, plus one more for the bottom of the column. A field listed under variables_at_layer_tops in variables.yaml is defined at the top of each layer but written on nVertLevels. Everything else is a layer quantity, defined at layer midpoints.

Parameters:
  • var (xarray.DataArray) – The field to plot or analyze

  • field_name (str, optional) – The name of var in its dataset, used to check whether it is a layer-top field

Returns:

location ({‘cell-center’, ‘cell-interfaces’, ‘cell-top’}) – The variable location suitable for vertical_coord_from_location()