Skip to content

Commit cd245e5

Browse files
committed
Add shift_barotropic_streamfunction() to the docs
1 parent ec22710 commit cd245e5

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

conda_package/docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ Ocean Tools
227227
depth.compute_zmid
228228

229229
compute_barotropic_streamfunction
230+
shift_barotropic_streamfunction
230231

231232
.. currentmodule:: mpas_tools.ocean.inject_bathymetry
232233

conda_package/docs/ocean/streamfunction.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,18 @@ For large meshes, performance and memory usage can be improved by specifying
2222
the ``horiz_chunk`` argument to control the number of edges processed at once,
2323
and by providing a ``tmp_dir`` argument to use a temporary directory for
2424
intermediate files.
25+
26+
Shifting the barotropic streamfunction
27+
--------------------------------------
28+
29+
The function :py:func:`mpas_tools.ocean.shift_barotropic_streamfunction()`
30+
can be used to shift the barotropic streamfunction so that its mean value is
31+
zero on the boundary within a specified latitude range. This is useful for
32+
setting a consistent reference for the streamfunction, especially when
33+
comparing results across different regions or simulations.
34+
35+
The function takes as input the barotropic streamfunction on vertices,
36+
a latitude range (in degrees), the ``cellsOnVertex`` and ``latVertex``
37+
arrays from the mesh, and optionally a logger. It returns a shifted
38+
streamfunction with the mean value on the boundary (within the latitude
39+
range) subtracted.

conda_package/mpas_tools/ocean/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
from mpas_tools.ocean.streamfunction.barotropic import (
2323
compute_barotropic_streamfunction as compute_barotropic_streamfunction,
2424
)
25+
from mpas_tools.ocean.streamfunction.barotropic import (
26+
shift_barotropic_streamfunction as shift_barotropic_streamfunction,
27+
)

0 commit comments

Comments
 (0)