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).

More…

Data Types

set_visc_cs

Control structure for MOM_set_visc.

Functions/Subroutines

set_viscous_bbl()

Calculates the thickness of the bottom boundary layer and the viscosity within that layer.

find_l_open_uniform_slope()

Determine the normalized open length of each interface, given the edge depths and normalized volumes below each interface.

find_l_open_concave_trigonometric()

Determine the normalized open length of each interface for concave bathymetry (from the ocean perspective) using trigonometric expressions.

find_l_open_concave_iterative()

Determine the normalized open length of each interface for concave bathymetry (from the ocean perspective) using iterative methods to solve the relevant cubic equations.

test_l_open_concave()

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.

find_l_open_convex()

Determine the normalized open length of each interface for convex bathymetry (from the ocean perspective) using Newton’s method iterations.

set_v_at_u()

This subroutine finds a thickness-weighted value of v at the u-points.

set_u_at_v()

This subroutine finds a thickness-weighted value of u at the v-points.

set_viscous_ml()

Calculates the thickness of the surface boundary layer for applying an elevated viscosity.

set_visc_register_restarts()

Register any fields associated with the vertvisc_type.

remap_vertvisc_aux_vars()

This subroutine does remapping for the auxiliary restart variables in a vertvisc_type that are used across timesteps.

set_visc_init()

Initializes the MOM_set_visc control structure.

set_visc_end()

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 mom_set_visc/set_visc_cs

Control structure for MOM_set_visc.

Type fields:
  • % id_bbl_thick_u [integer] :: Diagnostics handles.

  • % id_kv_bbl_u [integer] :: Diagnostics handles.

  • % id_bbl_u [integer] :: Diagnostics handles.

  • % id_bbl_thick_v [integer] :: Diagnostics handles.

  • % id_kv_bbl_v [integer] :: Diagnostics handles.

  • % id_bbl_v [integer] :: Diagnostics handles.

  • % id_ray_u [integer] :: Diagnostics handles.

  • % id_ray_v [integer] :: Diagnostics handles.

  • % id_nkml_visc_u [integer] :: Diagnostics handles.

  • % id_nkml_visc_v [integer] :: Diagnostics handles.

  • % initialized [logical] :: True if this control structure has been initialized.

  • % hbbl [real] :: The static bottom boundary layer thickness [H ~> m or kg m-2]. Runtime parameter

  • % dz_bbl [real] :: The static bottom boundary layer thickness in height units [Z ~> m]. Runtime parameter

  • % cdrag [real] :: The quadratic drag coefficient [nondim]. Runtime parameter

  • % c_smag [real] :: The Laplacian Smagorinsky coefficient for calculating the drag in channels [nondim].

  • % drag_bg_vel [real] :: An assumed unresolved background velocity for calculating the bottom drag [L T-1 ~> m s-1]. Runtime parameter

  • % bbl_thick_min [real] :: 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 [real] :: 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 [real] :: The minimum surface boundary layer thickness [Z ~> m].

  • % kv_bbl_min [real] :: The minimum viscosity in the bottom boundary layer [H Z T-1 ~> m2 s-1 or Pa s].

  • % kv_tbl_min [real] :: The minimum viscosity in the top boundary layer [H Z T-1 ~> m2 s-1 or Pa s].

  • % bottomdraglaw [logical] :: 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

  • % body_force_drag [logical] :: 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 [logical] :: If true, use the equation of state in determining the properties of the bottom boundary layer.

  • % linear_drag [logical] :: If true, the drag law is cdrag*

  • % channel_drag [logical] :: If true, the drag is exerted directly on each layer according to what fraction of the bottom they overlie.

  • % chan_drag_max_vol [real] :: 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].

  • % correct_bbl_bounds [logical] :: If true, uses the correct bounds on the BBL thickness and viscosity so that the bottom layer feels the intended drag.

  • % rino_mix [logical] :: If true, use Richardson number dependent mixing.

  • % dynamic_viscous_ml [logical] :: If true, use a bulk Richardson number criterion to determine the mixed layer thickness for viscosity.

  • % bulk_ri_ml [real] :: The bulk mixed layer used to determine the thickness of the viscous mixed layer [nondim].

  • % omega [real] :: The Earth’s rotation rate [T-1 ~> s-1].

  • % ustar_min [real] :: 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 [real] :: The ratio of the natural Ekman depth to the TKE decay scale [nondim].

  • % omega_frac [real] :: 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].

  • % concave_trigonometric_l [logical] :: If true, use trigonometric expressions to determine the fractional open interface lengths for concave topography.

  • % answer_date [integer] :: 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.

  • % debug [logical] :: If true, write verbose checksums for debugging purposes.

  • % bbl_use_tidal_bg [logical] :: If true, use a tidal background amplitude for the bottom velocity when computing the bottom stress.

  • % inputdir [character (len=200)] :: The directory for input files.

  • % obc [type( ocean_obc_type ),pointer] :: Open boundaries control structure.

  • % diag [type( diag_ctrl ),pointer] :: A structure that is used to regulate the timing of diagnostic output.

  • % tideamp [real(:,:),allocatable] :: RMS tidal amplitude at h points [Z T-1 ~> m s-1].

  • % bbl_u [real(:,:),allocatable] :: BBL mean U current [L T-1 ~> m s-1].

  • % bbl_v [real(:,:),allocatable] :: BBL mean V current [L T-1 ~> m s-1].

Function/Subroutine Documentation

subroutine mom_set_visc/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

Call to:

find_l_open_concave_iterative find_l_open_concave_trigonometric find_l_open_convex find_l_open_uniform_slope mom_error_handler::mom_error mom_open_boundary::obc_direction_n mom_open_boundary::obc_direction_s mom_open_boundary::obc_direction_w set_u_at_v set_v_at_u test_l_open_concave

subroutine mom_set_visc/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]

Called from:

set_viscous_bbl

subroutine mom_set_visc/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]

Called from:

set_viscous_bbl

subroutine mom_set_visc/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]

Called from:

set_viscous_bbl

subroutine mom_set_visc/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]

Called from:

set_viscous_bbl

subroutine mom_set_visc/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.

Called from:

set_viscous_bbl

function mom_set_visc/set_v_at_u(v, h, G, GV, i, j, k, mask2dCv, OBC) [real]

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

Return:

undefined :: 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.

Call to:

mom_open_boundary::obc_direction_n mom_open_boundary::obc_direction_s

Called from:

set_viscous_bbl set_viscous_ml mom_vert_friction::vertfpmix

function mom_set_visc/set_u_at_v(u, h, G, GV, i, j, k, mask2dCu, OBC) [real]

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

Return:

undefined :: 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.

Call to:

mom_open_boundary::obc_direction_w

Called from:

set_viscous_bbl set_viscous_ml mom_vert_friction::vertfpmix

subroutine mom_set_visc/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.

Call to:

mom_error_handler::mom_error mom_open_boundary::obc_direction_n mom_open_boundary::obc_direction_s mom_open_boundary::obc_direction_w set_u_at_v set_v_at_u

Called from:

mom_dynamics_split_rk2::step_mom_dyn_split_rk2 mom_dynamics_split_rk2b::step_mom_dyn_split_rk2b mom_dynamics_unsplit::step_mom_dyn_unsplit mom_dynamics_unsplit_rk2::step_mom_dyn_unsplit_rk2

subroutine mom_set_visc/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

Call to:

mom_cvmix_conv::cvmix_conv_is_used mom_cvmix_shear::cvmix_shear_is_used mom_kappa_shear::kappa_shear_at_vertex mom_kappa_shear::kappa_shear_is_used mom_io::var_desc

subroutine mom_set_visc/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

Call to:

mom_ale::ale_remap_interface_vals mom_ale::ale_remap_vertex_vals

subroutine mom_set_visc/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

Call to:

mom_kappa_shear::kappa_shear_at_vertex mom_kappa_shear::kappa_shear_is_used mom_error_handler::mom_error mom_restart::register_restart_field_as_obsolete

Called from:

mom::initialize_mom

subroutine mom_set_visc/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.

Called from:

mom::mom_end