MOM_set_visc module reference
Calculates various values related to the bottom boundary layer, such as the viscosity and thickness of the BBL (set_viscous_BBL).
Data Types
Control structure for MOM_set_visc |
Functions/Subroutines
Calculates the thickness of the bottom boundary layer and the viscosity within that layer. |
|
Determine the normalized open length of each interface, given the edge depths and normalized volumes below each interface. |
|
Determine the normalized open length of each interface for concave bathymetry (from the ocean perspective) using trigonometric expressions. In this case there can be two separate open regions. |
|
Determine the normalized open length of each interface for concave bathymetry (from the ocean perspective) using iterative methods to solve the relevant cubic equations. In this case there can be two separate open regions. |
|
Test the validity the normalized open lengths of each interface for concave bathymetry (from the ocean perspective) by evaluating and returing the relevant cubic equations. |
|
Determine the normalized open length of each interface for convex bathymetry (from the ocean perspective) using Newton's method iterations. In this case there is a single open region with the minimum depth at one edge of the cell. |
|
This subroutine finds a thickness-weighted value of v at the u-points. |
|
This subroutine finds a thickness-weighted value of u at the v-points. |
|
Calculates the thickness of the surface boundary layer for applying an elevated viscosity. |
|
Register any fields associated with the vertvisc_type. |
|
This subroutine does remapping for the auxiliary restart variables in a vertvisc_type that are used across timesteps |
|
Initializes the MOM_set_visc control structure |
|
This subroutine dellocates any memory in the set_visc control structure. |
Detailed Description
This would also be the module in which other viscous quantities that are flow-independent might be set. This information is transmitted to other modules via a vertvisc type structure.
The same code is used for the two velocity components, by indirectly referencing the velocities and defining a handful of direction-specific defined variables.
Type Documentation
- type, public :: set_visc_CS
Control structure for MOM_set_visc
- Parameters
initialized
True if this control structure has been initialized.
Hbbl
The static bottom boundary layer thickness [H ~> m or kg m-2]. Runtime parameter HBBL.
dz_bbl
The static bottom boundary layer thickness in height units [Z ~> m]. Runtime parameter HBBL.
cdrag
The quadratic drag coefficient [nondim]. Runtime parameter CDRAG.
c_Smag
The Laplacian Smagorinsky coefficient for calculating the drag in channels [nondim].
drag_bg_vel
An assumed unresolved background velocity for calculating the bottom drag [L T-1 ~> m s-1]. Runtime parameter DRAG_BG_VEL. Should not be used if BBL_USE_TIDAL_BG is True.
BBL_thick_min
The minimum bottom boundary layer thickness [Z ~> m]. This might be Kv / (cdrag * drag_bg_vel) to give Kv as the minimum near-bottom viscosity.
Htbl_shelf
A nominal thickness of the surface boundary layer for use in calculating the near-surface velocity [H ~> m or kg m-2].
Htbl_shelf_min
The minimum surface boundary layer thickness [Z ~> m].
KV_BBL_min
The minimum viscosity in the bottom boundary layer [H Z T-1 ~> m2 s-1 or Pa s]
KV_TBL_min
The minimum viscosity in the top boundary layer [H Z T-1 ~> m2 s-1 or Pa s]
bottomdraglaw
If true, the bottom stress is calculated with a drag law c_drag*|u|*u. The velocity magnitude may be an assumed value or it may be based on the actual velocity in the bottommost HBBL, depending on whether linear_drag is true. Runtime parameter BOTTOMDRAGLAW.
bottomdragmap
If true, apply the spatially varying drag coefficient (cdrag_2d) instead of the spatially uniform drag coefficient (cdrag).
body_force_drag
If true, the bottom stress is imposed as an explicit body force applied over a fixed distance from the bottom, rather than as an implicit calculation based on an enhanced near-bottom viscosity.
BBL_use_EOS
If true, use the equation of state in determining the properties of the bottom boundary layer.
linear_drag
If true, the drag law is cdrag*``DRAG_BG_VEL``*u. Runtime parameter LINEAR_DRAG.
Channel_drag
If true, the drag is exerted directly on each layer according to what fraction of the bottom they overlie.
Chan_drag_max_vol
The maximum bottom boundary layer volume within which the channel drag is applied, normalized by the full cell area, or a negative value to apply no maximum [Z ~> m].
channel_break_depth
When CHANNEL_DRAG is true, the bathymetric depth interpolated to the vorticity point is a combination of the harmonic mean of the adjacent velocity point depths below this depth [Z ~> m] and the arithmetic mean of the adjacent depths above it, to roughly mimic a continental shelf break profile. The internal version of this depth uses the same offset (G%Z_ref) as the bathymetry.
correct_BBL_bounds
If true, uses the correct bounds on the BBL thickness and viscosity so that the bottom layer feels the intended drag.
RiNo_mix
If true, use Richardson number dependent mixing.
dynamic_viscous_ML
If true, use a bulk Richardson number criterion to determine the mixed layer thickness for viscosity.
bulk_Ri_ML
The bulk mixed layer used to determine the thickness of the viscous mixed layer [nondim]
omega
The Earth's rotation rate [T-1 ~> s-1].
ustar_min
A minimum value of ustar to avoid numerical problems [H T-1 ~> m s-1 or kg m-2 s-1]. If the value is small enough, this should not affect the solution.
TKE_decay
The ratio of the natural Ekman depth to the TKE decay scale [nondim]
omega_frac
When setting the decay scale for turbulence, use this fraction of the absolute rotation rate blended with the local value of f, as sqrt((1-of)*f^2 + of*4*omega^2) [nondim]
tideampfac2
A factor to multiply by tideamp to convert to a mean ustar, accounts for conversion of amplitude to mean magnitude over a time average much longer than the tidal periods and for non-commuting conversion of mean tideamp to mean ustar**3 [nondim]
concave_trigonometric_L
If true, use trigonometric expressions to determine the fractional open interface lengths for concave topography.
answer_date
The vintage of the order of arithmetic and expressions in the set viscosity calculations. Values below 20190101 recover the answers from the end of 2018, while higher values use updated and more robust forms of the same expressions. Values below 20260704 use the non-reproducible power operator in place of cuberoot() when finding the open distances with CHANNEL_DRAG.
debug
If true, write verbose checksums for debugging purposes.
BBL_use_tidal_bg
If true, use a tidal background amplitude for the bottom velocity when computing the bottom stress.
inputdir
The directory for input files.
OBC
Open boundaries control structure
diag
A structure that is used to regulate the timing of diagnostic output.
cdrag_u
The spatially varying quadratic drag coefficient [nondim]
cdrag_v
The spatially varying quadratic drag coefficient [nondim]
tideamp
RMS tidal amplitude at h points [L T-1 ~> m s-1]
bbl_u
BBL mean U current [L T-1 ~> m s-1]
id_bbl_thick_u
Diagnostics handles
id_kv_bbl_u
Diagnostics handles
id_bbl_u
Diagnostics handles
id_bbl_thick_v
Diagnostics handles
id_kv_bbl_v
Diagnostics handles
id_bbl_v
Diagnostics handles
id_Ray_u
Diagnostics handles
id_Ray_v
Diagnostics handles
id_nkml_visc_u
Diagnostics handles
id_nkml_visc_v
Diagnostics handles
Functions/Subroutine Documentation
- subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, pbv)
Calculates the thickness of the bottom boundary layer and the viscosity within that layer.
- Parameters
G [inout]
The ocean's grid structure.
GV [in]
The ocean's vertical grid structure.
US [in]
A dimensional unit scaling type
u [in]
The zonal velocity [L T-1 ~> m s-1].
v [in]
The meridional velocity [L T-1 ~> m s-1].
h [in]
Layer thicknesses [H ~> m or kg m-2].
tv [in]
A structure containing pointers to any available thermodynamic fields. Absent fields have NULL pointers.
visc [inout]
A structure containing vertical viscosities and related fields.
CS [inout]
The control structure returned by a previous call to set_visc_init.
pbv [in]
porous barrier fractional cell metrics
Callees call graph
Text view
mom_set_visc::set_viscous_bbl → mom_checksums::interface::hchksum
mom_set_visc::set_viscous_bbl → mom_checksums::interface::uvchksum
mom_set_visc::set_viscous_bbl → mom_diag_mediator::interface::post_data
mom_set_visc::set_viscous_bbl → mom_eos::interface::calculate_density
mom_set_visc::set_viscous_bbl → mom_eos::interface::calculate_density_derivs
mom_set_visc::set_viscous_bbl → mom_error_handler::mom_error
mom_set_visc::set_viscous_bbl → mom_interface_heights::interface::thickness_to_dz
mom_set_visc::set_viscous_bbl → mom_set_visc::find_l_open_concave_iterative
mom_set_visc::set_viscous_bbl → mom_set_visc::find_l_open_concave_trigonometric
mom_set_visc::set_viscous_bbl → mom_set_visc::find_l_open_convex
mom_set_visc::set_viscous_bbl → mom_set_visc::find_l_open_uniform_slope
mom_set_visc::set_viscous_bbl → mom_set_visc::test_l_open_concave
Callers call graph
- subroutine find_L_open_uniform_slope(vol_below, Dp, Dm, L, GV)
Determine the normalized open length of each interface, given the edge depths and normalized volumes below each interface.
- Parameters
GV [in]
The ocean's vertical grid structure.
vol_below [in]
The volume below each interface, normalized by the full horizontal area of a velocity cell [Z ~> m]
Dp [in]
The larger of the two depths at the edge of a velocity cell [Z ~> m]
Dm [in]
The smaller of the two depths at the edge of a velocity cell [Z ~> m]
L [out]
The fraction of the full cell width that is open at the depth of each interface [nondim]
Callers call graph
- subroutine find_L_open_concave_trigonometric(vol_below, D_vel, Dp, Dm, L, GV)
Determine the normalized open length of each interface for concave bathymetry (from the ocean perspective) using trigonometric expressions. In this case there can be two separate open regions.
- Parameters
GV [in]
The ocean's vertical grid structure.
vol_below [in]
The volume below each interface, normalized by the full horizontal area of a velocity cell [Z ~> m]
D_vel [in]
The average bottom depth at a velocity point [Z ~> m]
Dp [in]
The larger of the two depths at the edge of a velocity cell [Z ~> m]
Dm [in]
The smaller of the two depths at the edge of a velocity cell [Z ~> m]
L [out]
The fraction of the full cell width that is open at the depth of each interface [nondim]
Callers call graph
- subroutine find_L_open_concave_iterative(vol_below, D_vel, Dp, Dm, L, GV)
Determine the normalized open length of each interface for concave bathymetry (from the ocean perspective) using iterative methods to solve the relevant cubic equations. In this case there can be two separate open regions.
- Parameters
GV [in]
The ocean's vertical grid structure.
vol_below [in]
The volume below each interface, normalized by the full horizontal area of a velocity cell [Z ~> m]
D_vel [in]
The average bottom depth at a velocity point [Z ~> m]
Dp [in]
The larger of the two depths at the edge of a velocity cell [Z ~> m]
Dm [in]
The smaller of the two depths at the edge of a velocity cell [Z ~> m]
L [out]
The fraction of the full cell width that is open at the depth of each interface [nondim]
Callers call graph
- subroutine test_L_open_concave(vol_below, D_vel, Dp, Dm, L, vol_err, GV)
Test the validity the normalized open lengths of each interface for concave bathymetry (from the ocean perspective) by evaluating and returing the relevant cubic equations.
- Parameters
GV [in]
The ocean's vertical grid structure.
vol_below [in]
The volume below each interface, normalized by the full horizontal area of a velocity cell [Z ~> m]
D_vel [in]
The average bottom depth at a velocity point [Z ~> m]
Dp [in]
The larger of the two depths at the edge of a velocity cell [Z ~> m]
Dm [in]
The smaller of the two depths at the edge of a velocity cell [Z ~> m]
L [in]
The fraction of the full cell width that is open at the depth of each interface [nondim]
vol_err [out]
The difference between vol_below and the value obtained from using L in the cubic equation [Z ~> m]
- subroutine find_L_open_convex(vol_below, D_vel, Dp, Dm, L, GV, US, CS)
Determine the normalized open length of each interface for convex bathymetry (from the ocean perspective) using Newton's method iterations. In this case there is a single open region with the minimum depth at one edge of the cell.
- Parameters
GV [in]
The ocean's vertical grid structure.
vol_below [in]
The volume below each interface, normalized by the full horizontal area of a velocity cell [Z ~> m]
D_vel [in]
The average bottom depth at a velocity point [Z ~> m]
Dp [in]
The larger of the two depths at the edge of a velocity cell [Z ~> m]
Dm [in]
The smaller of the two depths at the edge of a velocity cell [Z ~> m]
L [out]
The fraction of the full cell width that is open at the depth of each interface [nondim]
US [in]
A dimensional unit scaling type
CS [in]
The control structure returned by a previous call to set_visc_init.
- function set_v_at_u(v, h, G, GV, i, j, k, mask2dCv, OBC)
This subroutine finds a thickness-weighted value of v at the u-points.
- Parameters
G [in]
The ocean's grid structure
GV [in]
Vertical grid structure
v [in]
The meridional velocity [L T-1 ~> m s-1]
h [in]
Layer thicknesses [H ~> m or kg m-2]
i [in]
The i-index of the u-location to work on.
j [in]
The j-index of the u-location to work on.
k [in]
The k-index of the u-location to work on.
mask2dCv [in]
A multiplicative mask of the v-points [nondim]
OBC
A pointer to an open boundary condition structure
set_v_at_u
The return value of v at u points points in the same units as u, i.e. [L T-1 ~> m s-1] or other units.
Callers call graph
- function set_u_at_v(u, h, G, GV, i, j, k, mask2dCu, OBC)
This subroutine finds a thickness-weighted value of u at the v-points.
- Parameters
G [in]
The ocean's grid structure
GV [in]
Vertical grid structure
u [in]
The zonal velocity [L T-1 ~> m s-1] or other units.
h [in]
Layer thicknesses [H ~> m or kg m-2]
i [in]
The i-index of the u-location to work on.
j [in]
The j-index of the u-location to work on.
k [in]
The k-index of the u-location to work on.
mask2dCu [in]
A multiplicative mask of the u-points [nondim]
OBC
A pointer to an open boundary condition structure
set_u_at_v
The return value of u at v points in the same units as u, i.e. [L T-1 ~> m s-1] or other units.
Callers call graph
- subroutine set_viscous_ML(u, v, h, tv, forces, visc, dt, G, GV, US, CS)
Calculates the thickness of the surface boundary layer for applying an elevated viscosity.
A bulk Richardson criterion or the thickness of the topmost NKML layers (with a bulk mixed layer) are currently used. The thicknesses are given in terms of fractional layers, so that this thickness will move as the thickness of the topmost layers change.
- Parameters
G [inout]
The ocean's grid structure.
GV [in]
The ocean's vertical grid structure.
US [in]
A dimensional unit scaling type
u [in]
The zonal velocity [L T-1 ~> m s-1].
v [in]
The meridional velocity [L T-1 ~> m s-1].
h [in]
Layer thicknesses [H ~> m or kg m-2].
tv [in]
A structure containing pointers to any available thermodynamic fields. Absent fields have NULL pointers.
forces [in]
A structure with the driving mechanical forces
visc [inout]
A structure containing vertical viscosities and related fields.
dt [in]
Time increment [T ~> s].
CS [inout]
The control structure returned by a previous call to set_visc_init.
Callees call graph
Text view
mom_set_visc::set_viscous_ml → mom_checksums::interface::uvchksum
mom_set_visc::set_viscous_ml → mom_diag_mediator::interface::post_data
mom_set_visc::set_viscous_ml → mom_eos::interface::calculate_density_derivs
mom_set_visc::set_viscous_ml → mom_eos::interface::calculate_specific_vol_derivs
mom_set_visc::set_viscous_ml → mom_forcing_type::interface::find_ustar
mom_set_visc::set_viscous_ml → mom_interface_heights::interface::thickness_to_dz
Callers call graph
Text view
mom_dynamics_split_rk2::step_mom_dyn_split_rk2 → mom_set_visc::set_viscous_ml
mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b → mom_set_visc::set_viscous_ml
mom_dynamics_unsplit::step_mom_dyn_unsplit → mom_set_visc::set_viscous_ml
mom_dynamics_unsplit_rk2::step_mom_dyn_unsplit_rk2 → mom_set_visc::set_viscous_ml
- subroutine set_visc_register_restarts(HI, G, GV, US, param_file, visc, restart_CS, use_ice_shelf)
Register any fields associated with the vertvisc_type.
- Parameters
HI [in]
A horizontal index type structure.
G [in]
The ocean's grid structure.
GV [in]
The ocean's vertical grid structure.
US [in]
A dimensional unit scaling type
param_file [in]
A structure to parse for run-time parameters.
visc [inout]
A structure containing vertical viscosities and related fields. Allocated here.
restart_CS [inout]
MOM restart control structure
use_ice_shelf [in]
if true, register tau_shelf restarts
hfreeze
If hfreeze > 0 [Z ~> m], melt potential will be computed.
Callees call graph
Text view
mom_set_visc::set_visc_register_restarts → mom_cvmix_conv::cvmix_conv_is_used
mom_set_visc::set_visc_register_restarts → mom_cvmix_shear::cvmix_shear_is_used
mom_set_visc::set_visc_register_restarts → mom_file_parser::closeparameterblock
mom_set_visc::set_visc_register_restarts → mom_file_parser::interface::get_param
mom_set_visc::set_visc_register_restarts → mom_file_parser::openparameterblock
mom_set_visc::set_visc_register_restarts → mom_kappa_shear::kappa_shear_at_vertex
mom_set_visc::set_visc_register_restarts → mom_kappa_shear::kappa_shear_is_used
mom_set_visc::set_visc_register_restarts → mom_restart::interface::register_restart_field
mom_set_visc::set_visc_register_restarts → mom_restart::interface::register_restart_pair
mom_set_visc::set_visc_register_restarts → mom_safe_alloc::interface::safe_alloc_ptr
mom_set_visc::set_visc_register_restarts → mom_verticalgrid::get_thickness_units
- subroutine remap_vertvisc_aux_vars(G, GV, visc, h_old, h_new, ALE_CSp, OBC)
This subroutine does remapping for the auxiliary restart variables in a vertvisc_type that are used across timesteps
- Parameters
G [inout]
ocean grid structure
GV [in]
ocean vertical grid structure
visc [inout]
A structure containing vertical viscosities and related fields.
h_old [in]
Thickness of source grid [H ~> m or kg m-2]
h_new [in]
Thickness of destination grid [H ~> m or kg m-2]
ALE_CSp
ALE control structure to use when remapping
OBC
Open boundary structure
Callees call graph
Callers call graph
- subroutine set_visc_init(Time, G, GV, US, param_file, diag, visc, CS, restart_CS, OBC)
Initializes the MOM_set_visc control structure
- Parameters
Time [in]
The current model time.
G [inout]
The ocean's grid structure.
GV [in]
The ocean's vertical grid structure.
US [in]
A dimensional unit scaling type
param_file [in]
A structure to parse for run-time parameters.
diag [inout]
A structure that is used to regulate diagnostic output.
visc [inout]
A structure containing vertical viscosities and related fields.
CS [inout]
Vertical viscosity control structure
restart_CS [inout]
MOM restart control structure
OBC
A pointer to an open boundary condition structure
cdrag_h
The spatially varying quadratic drag coefficient [nondim]
Callees call graph
Text view
mom_set_visc::set_visc_init → mom_diag_mediator::register_diag_field
mom_set_visc::set_visc_init → mom_domain_infra::interface::pass_var
mom_set_visc::set_visc_init → mom_file_parser::interface::get_param
mom_set_visc::set_visc_init → mom_file_parser::interface::log_param
mom_set_visc::set_visc_init → mom_file_parser::interface::log_version
mom_set_visc::set_visc_init → mom_io::interface::mom_read_data
mom_set_visc::set_visc_init → mom_kappa_shear::kappa_shear_at_vertex
mom_set_visc::set_visc_init → mom_kappa_shear::kappa_shear_is_used
mom_set_visc::set_visc_init → mom_restart::register_restart_field_as_obsolete
- subroutine set_visc_end(visc, CS)
This subroutine dellocates any memory in the set_visc control structure.
- Parameters
visc [inout]
A structure containing vertical viscosities and related fields. Elements are deallocated here.
CS [inout]
The control structure returned by a previous call to set_visc_init.