CVMix Interface

Community Vertical Mixing (CVMix, http://cvmix.github.io) library interface. Provides an optional alternative to the native GOTM two-equation closures for ocean models that use CVMix as their mixing library.

Mixing parameterisations available through CVMix:

  • Surface boundary layer (parabolic KPP-style)

  • Bottom boundary layer

  • Interior non-convective mixing (background diffusivity; PP or KPP shear scheme)

  • Interior convective mixing

CVMix community vertical-mixing library interface.

Provides CVMixState — the state container for the Community Vertical Mixing (CVMix) parameterisations. CVMix is an optional alternative to the GOTM two-equation closures, intended for use in ocean general circulation models that use CVMix as their mixing library.

class pygotm.cvmix.CVMixState(zsbl=0.0, zbbl=0.0, cvmix_g=9.81, cvmix_rho0=1027.0, cvmix_gorho0=0.00955209347614411, use_surface_layer=True, use_interior=False, use_bottom_layer=False, use_background=False, use_shear=False, use_convection=False, use_tidal_mixing=False, use_double_diffusion=False, sbl_langmuir_method=0, background_diffusivity=1e-05, background_viscosity=0.0001, shear_mix_scheme=2, shear_num_smooth_Ri=1, shear_PP_nu_zero=0.005, shear_PP_alpha=5.0, shear_PP_exp=2.0, shear_KPP_nu_zero=0.005, shear_KPP_Ri_zero=0.7, shear_KPP_exp=3.0, convection_diffusivity=1.0, convection_viscosity=1.0, convection_basedOnBVF=True, convection_triggerBVF=0.0, z_w=None, z_r=None, h_r=None)[source]

Bases: object

Python-side CVMix interface state.

Parameters:
background_diffusivity: float = 1e-05
background_viscosity: float = 0.0001
convection_basedOnBVF: bool = True
convection_diffusivity: float = 1.0
convection_triggerBVF: float = 0.0
convection_viscosity: float = 1.0
cvmix_g: float = 9.81
cvmix_gorho0: float = 0.00955209347614411
cvmix_rho0: float = 1027.0
h_r: ndarray | None = None
sbl_langmuir_method: int = 0
shear_KPP_Ri_zero: float = 0.7
shear_KPP_exp: float = 3.0
shear_KPP_nu_zero: float = 0.005
shear_PP_alpha: float = 5.0
shear_PP_exp: float = 2.0
shear_PP_nu_zero: float = 0.005
shear_mix_scheme: int = 2
shear_num_smooth_Ri: int = 1
use_background: bool = False
use_bottom_layer: bool = False
use_convection: bool = False
use_double_diffusion: bool = False
use_interior: bool = False
use_shear: bool = False
use_surface_layer: bool = True
use_tidal_mixing: bool = False
z_r: ndarray | None = None
z_w: ndarray | None = None
zbbl: float = 0.0
zsbl: float = 0.0

CVMix interface — translation of gotm_cvmix.F90.

Provides an interface to the Community Ocean Vertical Mixing Project (CVMix, http://cvmix.github.io) in the General Ocean Turbulence Model. CVMix is an optional alternative to the native GOTM two-equation closures for ocean models that use CVMix as their mixing library.

Fortran CVMix library modules (cvmix_background, cvmix_convection, cvmix_kpp, cvmix_shear, cvmix_tidal, cvmix_ddiff) are encapsulated by the Python mixing routines below. All configuration and state are held in CVMixState.

Mixing parameterisations:

Public interface: init_cvmix(), init_cvmix_yaml(), post_init_cvmix(), do_cvmix(), clean_cvmix(), surface_layer(), bottom_layer(), interior_nonconv(), interior_conv(), CVMixState.

Original FORTRAN authors: Lars Umlauf; adapted for CVMix by Qing Li.

class pygotm.cvmix.gotm_cvmix.CVMixState(zsbl=0.0, zbbl=0.0, cvmix_g=9.81, cvmix_rho0=1027.0, cvmix_gorho0=0.00955209347614411, use_surface_layer=True, use_interior=False, use_bottom_layer=False, use_background=False, use_shear=False, use_convection=False, use_tidal_mixing=False, use_double_diffusion=False, sbl_langmuir_method=0, background_diffusivity=1e-05, background_viscosity=0.0001, shear_mix_scheme=2, shear_num_smooth_Ri=1, shear_PP_nu_zero=0.005, shear_PP_alpha=5.0, shear_PP_exp=2.0, shear_KPP_nu_zero=0.005, shear_KPP_Ri_zero=0.7, shear_KPP_exp=3.0, convection_diffusivity=1.0, convection_viscosity=1.0, convection_basedOnBVF=True, convection_triggerBVF=0.0, z_w=None, z_r=None, h_r=None)[source]

Bases: object

Python-side CVMix interface state.

Parameters:
zsbl: float = 0.0
zbbl: float = 0.0
cvmix_g: float = 9.81
cvmix_rho0: float = 1027.0
cvmix_gorho0: float = 0.00955209347614411
use_surface_layer: bool = True
use_interior: bool = False
use_bottom_layer: bool = False
use_background: bool = False
use_shear: bool = False
use_convection: bool = False
use_tidal_mixing: bool = False
use_double_diffusion: bool = False
sbl_langmuir_method: int = 0
background_diffusivity: float = 1e-05
background_viscosity: float = 0.0001
shear_mix_scheme: int = 2
shear_num_smooth_Ri: int = 1
shear_PP_nu_zero: float = 0.005
shear_PP_alpha: float = 5.0
shear_PP_exp: float = 2.0
shear_KPP_nu_zero: float = 0.005
shear_KPP_Ri_zero: float = 0.7
shear_KPP_exp: float = 3.0
convection_diffusivity: float = 1.0
convection_viscosity: float = 1.0
convection_basedOnBVF: bool = True
convection_triggerBVF: float = 0.0
z_w: ndarray | None = None
z_r: ndarray | None = None
h_r: ndarray | None = None
pygotm.cvmix.gotm_cvmix.bottom_layer(state, nlev, h, num, nuh, *, u_taub, hbl)[source]

Simple parabolic bottom boundary-layer enhancement.

Return type:

None

Parameters:
pygotm.cvmix.gotm_cvmix.clean_cvmix(state)[source]

Release CVMix work arrays.

Return type:

None

Parameters:

state (CVMixState)

pygotm.cvmix.gotm_cvmix.do_cvmix(state, nlev, h0, h, rho, u, v, NN, NNT, NNS, SS, u_taus, u_taub, num, nuh, nus, Rig)[source]

Dispatch CVMix contributions into GOTM diffusivity arrays.

Return type:

None

Parameters:
pygotm.cvmix.gotm_cvmix.init_cvmix(state=None, branch=None)[source]

Initialise CVMix state from an optional YAML-like branch.

Return type:

CVMixState

Parameters:
pygotm.cvmix.gotm_cvmix.init_cvmix_yaml(state, branch)[source]

Apply CVMix YAML options.

Return type:

None

Parameters:
pygotm.cvmix.gotm_cvmix.interior_conv(state, nlev, NN, num, nuh, nus)[source]

Apply convective interior mixing where the water column is unstable.

Return type:

None

Parameters:
pygotm.cvmix.gotm_cvmix.interior_nonconv(state, nlev, NN, NNT, NNS, SS, num, nuh, nus, Rig)[source]

Compute non-convective interior CVMix contributions.

Return type:

None

Parameters:
pygotm.cvmix.gotm_cvmix.post_init_cvmix(state, nlev, h0, gravity, rho0)[source]

Initialise grid arrays and physical constants.

Return type:

None

Parameters:
pygotm.cvmix.gotm_cvmix.surface_layer(state, nlev, h, num, nuh, *, u_taus, hbl)[source]

Simple parabolic surface boundary-layer enhancement.

Return type:

None

Parameters: