polaris.ocean.tasks.barotropic_gyre.analysis.Analysis.compute_error

Analysis.compute_error(ds_mesh, ds_out, variable_name, error_type='l2', loc='Vertex', boundary_condition='free slip')[source]

Compute the error for a given resolution

Parameters:
  • ds_mesh (xarray.Dataset) – the mesh dataset

  • ds_out (xarray.Dataset) – the output dataset

  • variable_name (str) – The variable name of which to evaluate error with respect to the exact solution

  • zidx (int, optional) – The z index to use to slice the field given by variable name

  • error_type ({'l2', 'inf'}, optional) – The type of error to compute

Returns:

error (float) – The error of the variable given by variable_name