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.

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.

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.

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

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

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

  • % 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 [H ~> m or kg m-2]. 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 [H ~> m or kg m-2].

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

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

  • % 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

  • % 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.

  • % 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 [Z T-1 ~> m 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, nondimensional.

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

  • % answers_2018 [logical] :: If true, use the order of arithmetic and expressions that recover the answers from the end of 2018. Otherwise, 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)

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

  • visc :: [inout] A structure containing vertical viscosities and related fields.

  • cs :: The control structure returned by a previous call to set_visc_init.

Call to

mom_error_handler::mom_error set_u_at_v set_v_at_u

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

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

Called from

set_viscous_bbl set_viscous_ml

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

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

Called from

set_viscous_bbl set_viscous_ml

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

  • 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 :: The control structure returned by a previous call to set_visc_init.

Call to

mom_error_handler::mom_error set_u_at_v set_v_at_u

Called from

mom_dynamics_split_rk2::step_mom_dyn_split_rk2 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, GV, param_file, visc, restart_CS)

Register any fields associated with the vertvisc_type.

Parameters
  • hi :: [in] A horizontal index type structure.

  • gv :: [in] The ocean’s vertical grid structure.

  • 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 :: A pointer to the restart control structure.

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

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. Allocated here.

  • cs :: A pointer that is set to point to the control structure for this module

  • restart_cs :: A pointer to the 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

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 :: The control structure returned by a previous call to set_visc_init.