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:
objectPython-side CVMix interface state.
- Parameters:
zsbl (float)
zbbl (float)
cvmix_g (float)
cvmix_rho0 (float)
cvmix_gorho0 (float)
use_surface_layer (bool)
use_interior (bool)
use_bottom_layer (bool)
use_background (bool)
use_shear (bool)
use_convection (bool)
use_tidal_mixing (bool)
use_double_diffusion (bool)
sbl_langmuir_method (int)
background_diffusivity (float)
background_viscosity (float)
shear_mix_scheme (int)
shear_num_smooth_Ri (int)
shear_PP_nu_zero (float)
shear_PP_alpha (float)
shear_PP_exp (float)
shear_KPP_nu_zero (float)
shear_KPP_Ri_zero (float)
shear_KPP_exp (float)
convection_diffusivity (float)
convection_viscosity (float)
convection_basedOnBVF (bool)
convection_triggerBVF (float)
z_w (ndarray | None)
z_r (ndarray | None)
h_r (ndarray | None)
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:
Surface boundary layer —
surface_layer()(parabolic KPP-style).Bottom boundary layer —
bottom_layer().Interior non-convective —
interior_nonconv()(background diffusivity; Pacanowski–Philander or KPP shear scheme).Interior convective —
interior_conv().
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:
objectPython-side CVMix interface state.
- Parameters:
zsbl (float)
zbbl (float)
cvmix_g (float)
cvmix_rho0 (float)
cvmix_gorho0 (float)
use_surface_layer (bool)
use_interior (bool)
use_bottom_layer (bool)
use_background (bool)
use_shear (bool)
use_convection (bool)
use_tidal_mixing (bool)
use_double_diffusion (bool)
sbl_langmuir_method (int)
background_diffusivity (float)
background_viscosity (float)
shear_mix_scheme (int)
shear_num_smooth_Ri (int)
shear_PP_nu_zero (float)
shear_PP_alpha (float)
shear_PP_exp (float)
shear_KPP_nu_zero (float)
shear_KPP_Ri_zero (float)
shear_KPP_exp (float)
convection_diffusivity (float)
convection_viscosity (float)
convection_basedOnBVF (bool)
convection_triggerBVF (float)
z_w (ndarray | None)
z_r (ndarray | None)
h_r (ndarray | None)
- pygotm.cvmix.gotm_cvmix.bottom_layer(state, nlev, h, num, nuh, *, u_taub, hbl)[source]¶
Simple parabolic bottom boundary-layer enhancement.
- pygotm.cvmix.gotm_cvmix.clean_cvmix(state)[source]¶
Release CVMix work arrays.
- Return type:
- 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.
- pygotm.cvmix.gotm_cvmix.init_cvmix(state=None, branch=None)[source]¶
Initialise CVMix state from an optional YAML-like branch.
- Return type:
- Parameters:
state (CVMixState | None)
- pygotm.cvmix.gotm_cvmix.init_cvmix_yaml(state, branch)[source]¶
Apply CVMix YAML options.
- Return type:
- Parameters:
state (CVMixState)
- pygotm.cvmix.gotm_cvmix.interior_conv(state, nlev, NN, num, nuh, nus)[source]¶
Apply convective interior mixing where the water column is unstable.
- pygotm.cvmix.gotm_cvmix.interior_nonconv(state, nlev, NN, NNT, NNS, SS, num, nuh, nus, Rig)[source]¶
Compute non-convective interior CVMix contributions.