mom_lateral_mixing_coeffs module reference
Variable mixing coefficients.
Data Types
Variable mixing coefficients. |
Functions/Subroutines
Calculates the non-dimensional depth functions. |
|
Calculates and stores the non-dimensional resolution functions. |
|
Calculates and stores functions of SQG mode. |
|
Calculates and stores functions of isopycnal slopes, e.g. |
|
Calculates factors used when setting diffusivity coefficients similar to Visbeck et al., 1997. |
|
Calculates the Eady growth rate (2D fields) for use in MEKE and the Visbeck schemes. |
|
The original calc_slope_function() that calculated slopes using interface positions only, not accounting for density variations. |
|
Calculates and returns isopycnal slopes with wider halos for use in finding QG viscosity. |
|
Calculates the Leith Laplacian and bi-harmonic viscosity coefficients. |
|
Initializes the variables mixing coefficients container. |
|
Destructor for VarMix control structure. |
Detailed Description
This module provides a container for various factors used in prescribing diffusivities, that are a function of the state (in particular the stratification and isoneutral slopes).
The resolution function
The resolution function is expressed in terms of the ratio of grid-spacing to deformation radius. The square of the resolution parameter is
where the grid spacing is calculated as
Todo
Check this reference to Bob on/off paper. The resolution function used in scaling diffusivities ([38]) is
The resolution function can be applied independently to thickness diffusion (module mom_thickness_diffuse()), tracer diffusion (mom_tracer_hordiff) lateral viscosity (), tracer diffusion (mom_tracer_hordiff) lateral viscosity (mom_hor_visc()).).
Robert Hallberg, 2013: Using a resolution function to regulate parameterizations of oceanic mesoscale eddy effects. Ocean Modelling, 71, pp 92-103. http://dx.doi.org/10.1016/j.ocemod.2013.08.007
Symbol |
Module parameter |
|---|---|
|
|
|
|
|
|
|
|
\(\alpha\) |
|
\(p\) |
|
\(\alpha\) |
|
\(p\) |
|
|
Visbeck diffusivity
This module also calculates factors used in setting the thickness diffusivity similar to a Visbeck et al., 1997, scheme. The factors are combined in mom_thickness_diffuse::thickness_diffuse but calculated in this module.but calculated in this module.
where \(S\) is the magnitude of the isoneutral slope and \(N\) is the Brunt-Vaisala frequency.
Visbeck, Marshall, Haine and Spall, 1997: Specification of Eddy Transfer Coefficients in Coarse-Resolution Ocean Circulation Models. J. Phys. Oceanogr. http://dx.doi.org/10.1175/1520-0485(1997)027%3C0381:SOETCI%3E2.0.CO;2
Symbol |
Module parameter |
|---|---|
|
|
\(\alpha_s\) |
|
\(\alpha_s\) |
|
\(L_{s}\) |
|
\(S_{max}\) |
|
Vertical structure function for KhTh
The thickness diffusivity can be prescribed a vertical distribution with the shape of the equivalent barotropic velocity mode. The structure function is stored in the control structure for this module (varmix_cs()) but is calculated using subroutines in ) but is calculated using subroutines in mom_wave_speed()..
Symbol |
Module parameter |
|---|---|
|
Type Documentation
- type mom_lateral_mixing_coeffs/varmix_cs
Variable mixing coefficients.
- Type fields:
% id_sn_u ::
integerDiagnostic identifier.% id_sn_v ::
integerDiagnostic identifier.% id_l2u ::
integerDiagnostic identifier.% id_l2v ::
integerDiagnostic identifier.% id_res_fn ::
integerDiagnostic identifier.% id_n2_u ::
integerDiagnostic identifier.% id_n2_v ::
integerDiagnostic identifier.% id_s2_u ::
integerDiagnostic identifier.% id_s2_v ::
integerDiagnostic identifier.% id_dzu ::
integerDiagnostic identifier.% id_dzv ::
integerDiagnostic identifier.% id_dzsxn ::
integerDiagnostic identifier.% id_dzsyn ::
integerDiagnostic identifier.% id_rd_dx ::
integerDiagnostic identifier.% id_kh_u_qg ::
integerDiagnostic identifier.% id_kh_v_qg ::
integerDiagnostic identifier.% id_sqg_struct ::
integerDiagnostic identifier.% id_bs_struct ::
integerDiagnostic identifier.% id_khth_struct ::
integerDiagnostic identifier.% id_khtr_struct ::
integerDiagnostic identifier.% id_kdgl90_struct ::
integerDiagnostic identifier.% diag ::
type(diag_ctrl), pointerA structure that is used to regulate the timing of diagnostic output.% initialized ::
logicalTrue if this control structure has been initialized.% use_variable_mixing ::
logicalIf true, use the variable mixing.% resoln_scaling_used ::
logicalIf true, a resolution function is used somewhere to scale away one of the viscosities or diffusivities when the deformation radius is well resolved.% resoln_scaled_kh ::
logicalIf true, scale away the Laplacian viscosity when the deformation radius is well resolved.% resoln_scaled_khth ::
logicalIf true, scale away the thickness diffusivity when the deformation radius is well resolved.% depth_scaled_khth ::
logicalIf true, KHTH is scaled away when the depth is shallower than a reference depth.% resoln_scaled_khtr ::
logicalIf true, scale away the tracer diffusivity when the deformation radius is well resolved.% interpolate_res_fn ::
logicalIf true, interpolate the resolution function to the velocity points from the thickness points; otherwise interpolate the wave speed and calculate the resolution function independently at each point.% use_stored_slopes ::
logicalIf true, stores isopycnal slopes in this structure.% resoln_use_ebt ::
logicalIf true, use the equivalent barotropic wave speed instead of the first baroclinic wave speed for calculating the resolution function.% khth_use_ebt_struct ::
logicalIf true, uses the equivalent barotropic structure as the vertical structure of thickness diffusivity.% kdgl90_use_ebt_struct ::
logicalIf true, uses the equivalent barotropic structure as the vertical structure of diffusivity in the GL90 scheme.% kdgl90_use_sqg_struct ::
logicalIf true, uses the surface quasigeostrophic structure as the vertical structure of diffusivity in the GL90 scheme.% khth_use_sqg_struct ::
logicalIf true, uses the surface quasigeostrophic structure as the vertical structure of thickness diffusivity.% khtr_use_ebt_struct ::
logicalIf true, uses the equivalent barotropic structure as the vertical structure of tracer diffusivity.% khtr_use_sqg_struct ::
logicalIf true, uses the surface quasigeostrophic structure as the vertical structure of tracer diffusivity.% calculate_cg1 ::
logicalIf true, calls% calculate_rd_dx ::
logicalIf true, calculates Rd/dx and populate CSRd_dx_h. This parameter is set depending on other parameters.% calculate_res_fns ::
logicalIf true, calculate all the resolution factors. This parameter is set depending on other parameters.% calculate_depth_fns ::
logicalIf true, calculate all the depth factors. This parameter is set depending on other parameters.% calculate_eady_growth_rate ::
logicalIf true, calculate all the Eady growth rates. This parameter is set depending on other parameters.% use_stanley_iso ::
logicalIf true, use Stanley parameterization in MOM_isopycnal_slopes.% use_simpler_eady_growth_rate ::
logicalIf true, use a simpler method to calculate the Eady growth rate that avoids division by layer thickness. This parameter is set depending on other parameters.% full_depth_eady_growth_rate ::
logicalIf true, calculate the Eady growth rate based on an average that includes contributions from sea-level changes in its denominator, rather than just the nominal depth of the bathymetry. This only applies when using the model interface heights as a proxy for isopycnal slopes.% obc_friendly ::
logicalIf true, use only interior data for thickness weighting and to calculate stratification and other fields at open boundary condition faces.% res_fn_obc_bug ::
logicalIf false, use only interior data for calculating the resolution functions at open boundary condition faces and vertices.% cropping_distance ::
realDistance from surface or bottom to filter out outcropped or incropped interfaces for the Eady growth rate calc [Z ~> m].% h_min_n2 ::
realThe minimum vertical distance to use in the denominator of the buoyancy frequency used in the slope calculation [H ~> m or kg m-2].% sn_u ::
real, dimension(:,:), allocatableS*N at u-points [T-1 ~> s-1].% sn_v ::
real, dimension(:,:), allocatableS*N at v-points [T-1 ~> s-1].% l2u ::
real, dimension(:,:), allocatableLength scale^2 at u-points [L2 ~> m2].% l2v ::
real, dimension(:,:), allocatableLength scale^2 at v-points [L2 ~> m2].% cg1 ::
real, dimension(:,:), allocatableThe first baroclinic gravity wave speed [L T-1 ~> m s-1].% res_fn_h ::
real, dimension(:,:), allocatableNon-dimensional function of the ratio the first baroclinic deformation radius to the grid spacing at h points [nondim].% res_fn_q ::
real, dimension(:,:), allocatableNon-dimensional function of the ratio the first baroclinic deformation radius to the grid spacing at q points [nondim].% res_fn_u ::
real, dimension(:,:), allocatableNon-dimensional function of the ratio the first baroclinic deformation radius to the grid spacing at u points [nondim].% res_fn_v ::
real, dimension(:,:), allocatableNon-dimensional function of the ratio the first baroclinic deformation radius to the grid spacing at v points [nondim].% depth_fn_u ::
real, dimension(:,:), allocatableNon-dimensional function of the ratio of the depth to a reference depth (maximum 1) at u points [nondim].% depth_fn_v ::
real, dimension(:,:), allocatableNon-dimensional function of the ratio of the depth to a reference depth (maximum 1) at v points [nondim].% beta_dx2_h ::
real, dimension(:,:), allocatableThe magnitude of the gradient of the Coriolis parameter times the grid spacing squared at h points [L T-1 ~> m s-1].% beta_dx2_q ::
real, dimension(:,:), allocatableThe magnitude of the gradient of the Coriolis parameter times the grid spacing squared at q points [L T-1 ~> m s-1].% beta_dx2_u ::
real, dimension(:,:), allocatableThe magnitude of the gradient of the Coriolis parameter times the grid spacing squared at u points [L T-1 ~> m s-1].% beta_dx2_v ::
real, dimension(:,:), allocatableThe magnitude of the gradient of the Coriolis parameter times the grid spacing squared at v points [L T-1 ~> m s-1].% f2_dx2_h ::
real, dimension(:,:), allocatableThe Coriolis parameter squared times the grid spacing squared at h [L2 T-2 ~> m2 s-2].% f2_dx2_q ::
real, dimension(:,:), allocatableThe Coriolis parameter squared times the grid spacing squared at q [L2 T-2 ~> m2 s-2].% f2_dx2_u ::
real, dimension(:,:), allocatableThe Coriolis parameter squared times the grid spacing squared at u [L2 T-2 ~> m2 s-2].% f2_dx2_v ::
real, dimension(:,:), allocatableThe Coriolis parameter squared times the grid spacing squared at v [L2 T-2 ~> m2 s-2].% rd_dx_h ::
real, dimension(:,:), allocatableDeformation radius over grid spacing [nondim].% slope_x ::
real, dimension(:,:,:), allocatableZonal isopycnal slope [Z L-1 ~> nondim].% slope_y ::
real, dimension(:,:,:), allocatableMeridional isopycnal slope [Z L-1 ~> nondim].% ebt_struct ::
real, dimension(:,:,:), allocatableEBT vertical structure to scale diffusivities with [nondim].% sqg_struct ::
real, dimension(:,:,:), allocatableSQG vertical structure to scale diffusivities with [nondim].% bs_struct ::
real, dimension(:,:,:), allocatableVertical structure function used in backscatter [nondim].% khth_struct ::
real, dimension(:,:,:), allocatableVertical structure function used in thickness diffusivity [nondim].% khtr_struct ::
real, dimension(:,:,:), allocatableVertical structure function used in tracer diffusivity [nondim].% kdgl90_struct ::
real, dimension(:,:,:), allocatableVertical structure function used in GL90 diffusivity [nondim].% bs_ebt_power ::
realPower to raise EBT vertical structure to. Default 0.0.% sqg_expo ::
realExponent for SQG vertical structure [nondim]. Default 1.0.% interpolated_sqg_struct ::
logicalIf true, interpolate properties to velocity points and then interpolate the buoyancy frequencies and layer thicknesses back to tracer points when calculating the SQG vertical structure.% bs_use_sqg_struct ::
logicalIf true, use sqg_stuct for backscatter vertical structure.% laplac3_const_u ::
real, dimension(:,:), allocatableLaplacian metric-dependent constants at u-points [L3 ~> m3].% laplac3_const_v ::
real, dimension(:,:), allocatableLaplacian metric-dependent constants at u-points [L3 ~> m3].% kh_u_qg ::
real, dimension(:,:,:), allocatableQG Leith GM coefficient at u-points [L2 T-1 ~> m2 s-1].% kh_v_qg ::
real, dimension(:,:,:), allocatableQG Leith GM coefficient at v-points [L2 T-1 ~> m2 s-1].% use_visbeck ::
logicalUse Visbeck formulation for thickness diffusivity.% varmix_ktop ::
integerTop layer to start downward integrals.% visbeck_l_scale ::
realFixed length scale in Visbeck formula [L ~> m], or if negative a scaling factor [nondim] relating this length scale squared to the cell area.% eady_gr_d_scale ::
realDepth over which to average SN [Z ~> m].% res_coef_khth ::
realA coefficient [nondim] that determines the function of resolution, used for thickness and tracer mixing, as: F = 1 / (1 + (Res_coef_khth*Ld/dx)^Res_fn_power)% res_coef_visc ::
realA coefficient [nondim] that determines the function of resolution, used for lateral viscosity, as: F = 1 / (1 + (Res_coef_visc*Ld/dx)^Res_fn_power)% depth_scaled_khth_h0 ::
realThe depth above which KHTH is linearly scaled away [Z ~> m].% depth_scaled_khth_exp ::
realThe exponent used in the depth dependent scaling function for KHTH [nondim].% kappa_smooth ::
realA diffusivity for smoothing T/S in vanished layers [H Z T-1 ~> m2 s-1 or kg m-1 s-1].% res_fn_power_khth ::
integerThe power of dx/Ld in the KhTh resolution function. Any positive integer power may be used, but even powers and especially 2 are coded to be more efficient.% res_fn_power_visc ::
integerThe power of dx/Ld in the Kh resolution function. Any positive integer power may be used, but even powers and especially 2 are coded to be more efficient.% visbeck_s_max ::
realUpper bound on slope used in Eady growth rate [Z L-1 ~> nondim].% use_qg_leith_gm ::
logicalIf true, uses the QG Leith viscosity as the GM coefficient.% use_beta_in_qg_leith ::
logicalIf true, includes the beta term in the QG Leith GM coefficient.% wave_speed ::
type(wave_speed_cs)Wave speed control structure.% pass_cg1 ::
type(group_pass_type)For group halo pass.% debug ::
logicalIf true, write out checksums of data for debugging.
Function/Subroutine Documentation
- subroutine mom_lateral_mixing_coeffs/calc_depth_function(G, CS)
Calculates the non-dimensional depth functions.
- Parameters:
g :: [in] Ocean grid structure
cs :: [inout] Variable mixing control structure
- Call to:
- Called from:
- subroutine mom_lateral_mixing_coeffs/calc_resoln_function(h, tv, G, GV, US, CS, MEKE, OBC, dt)
Calculates and stores the non-dimensional resolution functions.
- Parameters:
g :: [inout] Ocean grid structure
gv :: [in] Vertical grid structure
h ::
h[in] Layer thickness [H ~> m or kg m-2]tv ::
tv[in] Thermodynamic variablesus :: [in] A dimensional unit scaling type
cs :: [inout] Variable mixing control structure
meke :: [in] MEKE struct
obc :: Open boundaries control structure
dt ::
dt[in] Time increment [T ~> s]
- Call to:
calc_sqg_structmom_error_handler::mom_errormom_diag_mediator::query_averaging_enabledmom_wave_speed::wave_speed- Called from:
- subroutine mom_lateral_mixing_coeffs/calc_sqg_struct(h, tv, G, GV, US, CS, dt, MEKE, OBC)
Calculates and stores functions of SQG mode.
- Parameters:
g :: [inout] Ocean grid structure
gv :: [in] Vertical grid structure
us :: [in] A dimensional unit scaling type
h ::
h[in] Layer thickness [H ~> m or kg m-2]tv ::
tv[in] Thermodynamic variablesdt ::
dt[in] Time increment [T ~> s]cs :: [inout] Variable mixing control struct
meke :: [in] MEKE struct
obc :: Open boundaries control structure
- Call to:
mom_isopycnal_slopes::calc_isoneutral_slopesmom_eos::eos_domainmom_error_handler::mom_errormom_diag_mediator::query_averaging_enabled- Called from:
- subroutine mom_lateral_mixing_coeffs/calc_slope_functions(h, tv, dt, G, GV, US, CS, OBC)
Calculates and stores functions of isopycnal slopes, e.g. Sx, Sy, S*N, mostly used in the Visbeck et al. style scaling of diffusivity.
- Parameters:
g :: [inout] Ocean grid structure
gv :: [in] Vertical grid structure
us :: [in] A dimensional unit scaling type
h ::
h[inout] Layer thickness [H ~> m or kg m-2]tv ::
tv[in] Thermodynamic variablesdt ::
dt[in] Time increment [T ~> s]cs :: [inout] Variable mixing control structure
obc :: Open boundaries control structure
- Call to:
calc_eady_growth_rate_2dmom_isopycnal_slopes::calc_isoneutral_slopescalc_slope_functions_using_just_ecalc_visbeck_coeffs_oldmom_error_handler::mom_errormom_diag_mediator::query_averaging_enabled
- subroutine mom_lateral_mixing_coeffs/calc_visbeck_coeffs_old(h, slope_x, slope_y, N2_u, N2_v, G, GV, US, CS, OBC)
Calculates factors used when setting diffusivity coefficients similar to Visbeck et al., 1997. This is on older implementation that is susceptible to large values of Eady growth rate for incropping layers.
- Parameters:
g :: [inout] Ocean grid structure
gv :: [in] Vertical grid structure
h ::
h[in] Layer thickness [H ~> m or kg m-2]slope_x ::
slope_x[in] Zonal isoneutral slope [Z L-1 ~> nondim]n2_u :: [in] Buoyancy (Brunt-Vaisala) frequency at u-points [L2 Z-2 T-2 ~> s-2]
slope_y ::
slope_y[in] Meridional isoneutral slope [Z L-1 ~> nondim]n2_v :: [in] Buoyancy (Brunt-Vaisala) frequency at v-points [L2 Z-2 T-2 ~> s-2]
us :: [in] A dimensional unit scaling type
cs :: [inout] Variable mixing control structure
obc :: Open boundaries control structure.
- Call to:
mom_error_handler::mom_errormom_diag_mediator::query_averaging_enabled- Called from:
- subroutine mom_lateral_mixing_coeffs/calc_eady_growth_rate_2d(CS, G, GV, US, h, e, dzu, dzv, dzSxN, dzSyN, SN_u, SN_v)
Calculates the Eady growth rate (2D fields) for use in MEKE and the Visbeck schemes.
- Parameters:
cs :: [inout] Variable mixing coefficients
g :: [in] Ocean grid structure
gv :: [in] Vertical grid structure
us :: [in] A dimensional unit scaling type
h ::
h[in] Interface height [Z ~> m]e ::
e[in] Interface height [Z ~> m]dzu ::
dzu[in] dz at u-points [Z ~> m]dzv ::
dzv[in] dz at v-points [Z ~> m]dzsxn :: [in] dz Sx N at u-points [Z T-1 ~> m s-1]
dzsyn :: [in] dz Sy N at v-points [Z T-1 ~> m s-1]
sn_u :: [inout] SN at u-points [T-1 ~> s-1]
sn_v :: [inout] SN at v-points [T-1 ~> s-1]
- Called from:
- subroutine mom_lateral_mixing_coeffs/calc_slope_functions_using_just_e(h, G, GV, US, CS, e)
The original calc_slope_function() that calculated slopes using interface positions only, not accounting for density variations.
- Parameters:
g :: [inout] Ocean grid structure
gv :: [in] Vertical grid structure
h ::
h[inout] Layer thickness [H ~> m or kg m-2]us :: [in] A dimensional unit scaling type
cs :: [inout] Variable mixing control structure
e ::
e[in] Interface position [Z ~> m]
- Call to:
- Called from:
- subroutine mom_lateral_mixing_coeffs/calc_qg_slopes(h, tv, dt, G, GV, US, slope_x, slope_y, CS, OBC)
Calculates and returns isopycnal slopes with wider halos for use in finding QG viscosity.
- Parameters:
g :: [in] Ocean grid structure
gv :: [in] Vertical grid structure
us :: [in] A dimensional unit scaling type
h ::
h[in] Layer thickness [H ~> m or kg m-2]tv ::
tv[in] Thermodynamic variablesdt ::
dt[in] Time increment [T ~> s]slope_x ::
slope_x[inout] Isopycnal slope in i-dir [Z L-1 ~> nondim]slope_y ::
slope_y[inout] Isopycnal slope in j-dir [Z L-1 ~> nondim]cs :: [in] Variable mixing control structure
obc :: Open boundaries control structure
- Call to:
mom_isopycnal_slopes::calc_isoneutral_slopesmom_error_handler::mom_error- Called from:
- subroutine mom_lateral_mixing_coeffs/calc_qg_leith_viscosity(CS, G, GV, US, h, dz, k, div_xx_dx, div_xx_dy, slope_x, slope_y, vort_xy_dx, vort_xy_dy)
Calculates the Leith Laplacian and bi-harmonic viscosity coefficients.
- Parameters:
cs :: [inout] Variable mixing coefficients
g :: [in] Ocean grid structure
gv :: [in] The ocean’s vertical grid structure.
us :: [in] A dimensional unit scaling type
h ::
h[in] Layer thickness [H ~> m or kg m-2]dz ::
dz[in] Layer vertical extents [Z ~> m]k ::
k[in] Layer for which to calculate vorticity magnitudediv_xx_dx ::
div_xx_dx[in] x-derivative of horizontal divergence (d/dx(du/dx + dv/dy)) [L-1 T-1 ~> m-1 s-1]div_xx_dy ::
div_xx_dy[in] y-derivative of horizontal divergence (d/dy(du/dx + dv/dy)) [L-1 T-1 ~> m-1 s-1]slope_x ::
slope_x[inout] Isopycnal slope in i-dir [Z L-1 ~> nondim]slope_y ::
slope_y[inout] Isopycnal slope in j-dir [Z L-1 ~> nondim]vort_xy_dx ::
vort_xy_dx[inout] x-derivative of vertical vorticity (d/dx(dv/dx - du/dy)) [L-1 T-1 ~> m-1 s-1]vort_xy_dy ::
vort_xy_dy[inout] y-derivative of vertical vorticity (d/dy(dv/dx - du/dy)) [L-1 T-1 ~> m-1 s-1]
- Called from:
- subroutine mom_lateral_mixing_coeffs/varmix_init(Time, G, GV, US, param_file, diag, CS)
Initializes the variables mixing coefficients container.
- Parameters:
time :: [in] Current model time
g :: [in] Ocean grid structure
gv :: [in] The ocean’s vertical grid structure
us :: [in] A dimensional unit scaling type
param_file ::
param_file[in] Parameter file handlesdiag ::
diag[inout] Diagnostics control structurecs :: [inout] Variable mixing coefficients
- Call to:
mom_error_handler::mom_errormom_wave_speed::wave_speed_init
- subroutine mom_lateral_mixing_coeffs/varmix_end(CS)
Destructor for VarMix control structure.